koishi-plugin-echo-cave 1.18.0 → 1.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  import { Context, Session } from 'koishi';
2
- export declare function searchCave(ctx: Context, session: Session, userIds: number): Promise<string>;
2
+ export declare function searchCave(ctx: Context, session: Session, userIds: string): Promise<string>;
package/lib/index.cjs CHANGED
@@ -110,7 +110,8 @@ var require_zh_CN = __commonJS({
110
110
  adminOnly: "\u26D4 \u8BE5\u6D88\u606F\u7531\u7BA1\u7406\u5458\u53D1\u5E03\uFF0C\u5DF2\u5F00\u542F\u7BA1\u7406\u5458\u6D88\u606F\u4FDD\u62A4\uFF0C\u53EA\u6709\u7BA1\u7406\u5458\u53EF\u4EE5\u5220\u9664\u3002",
111
111
  permissionDenied: "\u26D4 \u60A8\u6CA1\u6709\u6743\u9650\u5220\u9664\u6B64\u6D88\u606F\uFF01\u53EA\u6709\u7BA1\u7406\u5458\u53EF\u4EE5\u5220\u9664\u3002",
112
112
  contributorDeleteDenied: "\u26D4 \u60A8\u6CA1\u6709\u6743\u9650\u5220\u9664\u6B64\u6D88\u606F\uFF01\u5F53\u524D\u914D\u7F6E\u4E0D\u5141\u8BB8\u6295\u7A3F\u8005\u5220\u9664\u56DE\u58F0\u6D1E\u3002",
113
- senderDeleteDenied: "\u26D4 \u60A8\u6CA1\u6709\u6743\u9650\u5220\u9664\u6B64\u6D88\u606F\uFF01\u5F53\u524D\u914D\u7F6E\u4E0D\u5141\u8BB8\u539F\u59CB\u53D1\u9001\u8005\u5220\u9664\u56DE\u58F0\u6D1E\u3002"
113
+ senderDeleteDenied: "\u26D4 \u60A8\u6CA1\u6709\u6743\u9650\u5220\u9664\u6B64\u6D88\u606F\uFF01\u5F53\u524D\u914D\u7F6E\u4E0D\u5141\u8BB8\u539F\u59CB\u53D1\u9001\u8005\u5220\u9664\u56DE\u58F0\u6D1E\u3002",
114
+ msgDeleted: "\u2705 \u5DF2\u6210\u529F\u62B9\u53BB\u56DE\u58F0\u6D1E\u6D88\u606F ID\uFF1A{0}"
114
115
  }
115
116
  },
116
117
  "cave.purge": {
@@ -136,16 +137,16 @@ var require_zh_CN = __commonJS({
136
137
  description: "\u83B7\u5F97\u7531\u81EA\u5DF1\u6295\u7A3F\u7684\u56DE\u58F0\u6D1E\u5217\u8868",
137
138
  messages: {
138
139
  noMsgContributed: '\u{1F680} \u60A8\u5728\u56DE\u58F0\u6D1E\u4E2D\u6682\u65E0\u6295\u7A3F\uFF0C\u5FEB\u4F7F\u7528 "cave.echo" \u547D\u4EE4\u6DFB\u52A0\u7B2C\u4E00\u6761\u6D88\u606F\u5427\uFF01',
139
- msgListHeader: "\u{1F4DC} \u60A8\u5728\u672C\u9891\u9053\u6295\u7A3F\u7684\u56DE\u58F0\u6D1E\u6D88\u606F\u5217\u8868\uFF1A\n",
140
- msgListItem: "ID: {0} | \u521B\u5EFA\u65F6\u95F4: {1}\n"
140
+ msgListHeader: "\u{1F4DC} \u60A8\u5728\u672C\u9891\u9053\u6295\u7A3F\u7684\u56DE\u58F0\u6D1E\u6D88\u606F\u5217\u8868\uFF1A",
141
+ msgListItem: "ID: {0} | \u521B\u5EFA\u65F6\u95F4: {1}"
141
142
  }
142
143
  },
143
144
  "cave.trace": {
144
145
  description: "\u83B7\u5F97\u81EA\u5DF1\u53D1\u8A00\u7684\u56DE\u58F0\u6D1E\u5217\u8868",
145
146
  messages: {
146
147
  noMsgTraced: '\u{1F680} \u60A8\u5728\u56DE\u58F0\u6D1E\u4E2D\u6682\u65E0\u53D1\u8A00\u88AB\u6295\u7A3F\uFF0C\u5FEB\u4F7F\u7528 "cave.echo" \u547D\u4EE4\u6DFB\u52A0\u7B2C\u4E00\u6761\u6D88\u606F\u5427\uFF01',
147
- msgListHeader: "\u{1F4DC} \u60A8\u5728\u672C\u9891\u9053\u53D1\u8A00\u7684\u56DE\u58F0\u6D1E\u6D88\u606F\u5217\u8868\uFF1A\n",
148
- msgListItem: "ID: {0} | \u521B\u5EFA\u65F6\u95F4: {1}\n"
148
+ msgListHeader: "\u{1F4DC} \u60A8\u5728\u672C\u9891\u9053\u53D1\u8A00\u7684\u56DE\u58F0\u6D1E\u6D88\u606F\u5217\u8868\uFF1A",
149
+ msgListItem: "ID: {0} | \u521B\u5EFA\u65F6\u95F4: {1}"
149
150
  }
150
151
  },
151
152
  "cave.bind": {
@@ -205,7 +206,7 @@ async function checkUsersInGroup(ctx, session, userIds) {
205
206
  var import_koishi = require("koishi");
206
207
  function parseUserIds(userIds) {
207
208
  const parsedUserIds = [];
208
- for (const userId of userIds) {
209
+ for (const userId of typeof userIds === "string" ? [userIds] : userIds) {
209
210
  const num = Number(userId);
210
211
  if (!Number.isNaN(num)) {
211
212
  parsedUserIds.push(userId);
@@ -732,9 +733,9 @@ async function getCaveListByUser(ctx, session) {
732
733
  if (caves.length === 0) {
733
734
  return session.text(".noMsgContributed");
734
735
  }
735
- let response = session.text(".msgListHeader");
736
+ let response = session.text(".msgListHeader") + "\n";
736
737
  for (const cave of caves) {
737
- response += session.text(".msgListItem", [cave.id, formatDate(cave.createTime)]);
738
+ response += session.text(".msgListItem", [cave.id, formatDate(cave.createTime)]) + "\n";
738
739
  }
739
740
  return response;
740
741
  }
@@ -750,9 +751,9 @@ async function getCaveListByOriginUser(ctx, session) {
750
751
  if (caves.length === 0) {
751
752
  return session.text(".noMsgTraced");
752
753
  }
753
- let response = session.text(".msgListHeader");
754
+ let response = session.text(".msgListHeader") + "\n";
754
755
  for (const cave of caves) {
755
- response += session.text(".msgListItem", [cave.id, formatDate(cave.createTime)]);
756
+ response += session.text(".msgListItem", [cave.id, formatDate(cave.createTime)]) + "\n";
756
757
  }
757
758
  return response;
758
759
  }
@@ -825,7 +826,7 @@ async function searchCave(ctx, session, userIds) {
825
826
  if (!userIds) {
826
827
  return session.text(".noUserIdProvided");
827
828
  }
828
- const result = parseUserIds(userIds.toString());
829
+ const result = parseUserIds(userIds);
829
830
  if (result.error === "invalid_all_mention") {
830
831
  return session.text("echo-cave.user.invalidAllMention");
831
832
  }
@@ -892,7 +893,7 @@ function apply(ctx, cfg) {
892
893
  ctx.command("cave.purge <...ids:number>").action(
893
894
  async ({ session }, ...ids) => await deleteCaves(ctx, session, cfg, ids)
894
895
  );
895
- ctx.command("cave.search <id:number>").action(
896
+ ctx.command("cave.search <id>").action(
896
897
  async ({ session }, id) => await searchCave(ctx, session, id)
897
898
  );
898
899
  ctx.command("cave.bind <id:number> <...userIds>", { authority: 4 }).action(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-echo-cave",
3
3
  "description": "Group echo cave",
4
- "version": "1.18.0",
4
+ "version": "1.18.2",
5
5
  "main": "lib/index.cjs",
6
6
  "typings": "lib/index.d.ts",
7
7
  "type": "module",