koishi-plugin-echo-cave 1.18.3 → 1.18.5

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.
@@ -2,6 +2,6 @@ import { Context, Session } from 'koishi';
2
2
  export declare function getUserIdFromNickname(session: Session, nickname: string, userId: number): Promise<number>;
3
3
  export declare function getUserName(ctx: Context, session: Session, userId: string): Promise<string>;
4
4
  /**
5
- * 检查用户是否属于指定群组
5
+ * Check if users belong to the specified group
6
6
  */
7
7
  export declare function checkUsersInGroup(ctx: Context, session: Session, userIds: string[]): Promise<boolean>;
package/lib/index.cjs CHANGED
@@ -29,8 +29,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  ));
30
30
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
31
 
32
- // src/locales/zh-CN.json
32
+ // src/config/locales/zh-CN.json
33
33
  var require_zh_CN = __commonJS({
34
+ "src/config/locales/zh-CN.json"(exports2, module2) {
35
+ module2.exports = {
36
+ adminMessageProtection: "\u5F00\u542F\u7BA1\u7406\u5458\u6D88\u606F\u4FDD\u62A4\uFF0C\u5F00\u542F\u540E\u7BA1\u7406\u5458\u53D1\u5E03\u7684\u6D88\u606F\u53EA\u80FD\u7531\u7BA1\u7406\u5458\u5220\u9664",
37
+ allowContributorDelete: "\u5141\u8BB8\u6295\u7A3F\u8005\u5220\u9664\u81EA\u5DF1\u6295\u7A3F\u7684\u56DE\u58F0\u6D1E",
38
+ allowSenderDelete: "\u5141\u8BB8\u539F\u59CB\u53D1\u9001\u8005\u5220\u9664\u88AB\u6295\u7A3F\u7684\u56DE\u58F0\u6D1E",
39
+ deleteMediaWhenDeletingMsg: "\u5220\u9664\u56DE\u58F0\u6D1E\u6D88\u606F\u65F6\u662F\u5426\u540C\u65F6\u5220\u9664\u5173\u8054\u7684\u5A92\u4F53\u6587\u4EF6",
40
+ enableSizeLimit: "\u662F\u5426\u542F\u7528\u5A92\u4F53\u6587\u4EF6\u5927\u5C0F\u9650\u5236",
41
+ maxImageSize: "\u6700\u5927\u56FE\u7247\u5927\u5C0F (MB)",
42
+ maxVideoSize: "\u6700\u5927\u89C6\u9891\u5927\u5C0F (MB)",
43
+ maxFileSize: "\u6700\u5927\u6587\u4EF6\u5927\u5C0F (MB)",
44
+ maxRecordSize: "\u6700\u5927\u5F55\u97F3\u5927\u5C0F (MB)",
45
+ useBase64ForMedia: "\u662F\u5426\u4F7F\u7528 Base64 \u7F16\u7801\u53D1\u9001\u5A92\u4F53\u6587\u4EF6\uFF0C\u5F00\u542F\u540E\u5C06\u8BFB\u53D6 base64 \u7F16\u7801\u53D1\u9001\u800C\u4E0D\u662F\u4F7F\u7528 file uri"
46
+ };
47
+ }
48
+ });
49
+
50
+ // src/locales/zh-CN.json
51
+ var require_zh_CN2 = __commonJS({
34
52
  "src/locales/zh-CN.json"(exports2, module2) {
35
53
  module2.exports = {
36
54
  _config: {
@@ -138,7 +156,7 @@ var require_zh_CN = __commonJS({
138
156
  messages: {
139
157
  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',
140
158
  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}"
159
+ msgListItem: "ID: {0} | \u521B\u5EFA\u65F6\u95F4\uFF1A{1}"
142
160
  }
143
161
  },
144
162
  "cave.trace": {
@@ -146,7 +164,7 @@ var require_zh_CN = __commonJS({
146
164
  messages: {
147
165
  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',
148
166
  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}"
167
+ msgListItem: "ID: {0} | \u521B\u5EFA\u65F6\u95F4\uFF1A{1}"
150
168
  }
151
169
  },
152
170
  "cave.bind": {
@@ -166,6 +184,7 @@ var require_zh_CN = __commonJS({
166
184
  // src/index.ts
167
185
  var index_exports = {};
168
186
  __export(index_exports, {
187
+ Config: () => Config,
169
188
  apply: () => apply,
170
189
  inject: () => inject,
171
190
  name: () => name
@@ -346,7 +365,7 @@ async function checkAndCleanMediaFiles(ctx, cfg, type) {
346
365
  switch (type) {
347
366
  case "image":
348
367
  return (cfg.maxImageSize || 100) * 1024 * 1024;
349
- // 转换为字节
368
+ // Convert to bytes
350
369
  case "video":
351
370
  return (cfg.maxVideoSize || 500) * 1024 * 1024;
352
371
  case "file":
@@ -486,7 +505,6 @@ async function addCave(ctx, session, cfg, userIds) {
486
505
  const messageId = quote.id;
487
506
  let parsedUserIds = [];
488
507
  if (userIds && userIds.length > 0) {
489
- ctx.logger.info(`Original userIds in addCave: ${JSON.stringify(userIds)}`);
490
508
  const result = parseUserIds(userIds);
491
509
  if (result.error === "invalid_all_mention") {
492
510
  return session.text("echo-cave.user.invalidAllMention");
@@ -853,11 +871,28 @@ async function searchCave(ctx, session, userIds) {
853
871
  return session.text(".searchResult", [count, caveIds]);
854
872
  }
855
873
 
874
+ // src/config/config.ts
875
+ var import_koishi2 = require("koishi");
876
+ var Config = import_koishi2.Schema.object({
877
+ adminMessageProtection: import_koishi2.Schema.boolean().default(false),
878
+ allowContributorDelete: import_koishi2.Schema.boolean().default(true),
879
+ allowSenderDelete: import_koishi2.Schema.boolean().default(true),
880
+ deleteMediaWhenDeletingMsg: import_koishi2.Schema.boolean().default(true),
881
+ enableSizeLimit: import_koishi2.Schema.boolean().default(false),
882
+ maxImageSize: import_koishi2.Schema.number().default(2048),
883
+ maxVideoSize: import_koishi2.Schema.number().default(512),
884
+ maxFileSize: import_koishi2.Schema.number().default(512),
885
+ maxRecordSize: import_koishi2.Schema.number().default(512),
886
+ useBase64ForMedia: import_koishi2.Schema.boolean().default(false)
887
+ }).i18n({
888
+ "zh-CN": require_zh_CN()
889
+ });
890
+
856
891
  // src/index.ts
857
892
  var name = "echo-cave";
858
893
  var inject = ["database"];
859
894
  function apply(ctx, cfg) {
860
- ctx.i18n.define("zh-CN", require_zh_CN());
895
+ ctx.i18n.define("zh-CN", require_zh_CN2());
861
896
  ctx.model.extend(
862
897
  "echo_cave",
863
898
  {
@@ -900,6 +935,7 @@ function apply(ctx, cfg) {
900
935
  }
901
936
  // Annotate the CommonJS export names for ESM import in node:
902
937
  0 && (module.exports = {
938
+ Config,
903
939
  apply,
904
940
  inject,
905
941
  name
package/lib/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { Config } from './config/config';
3
3
  import { Context } from 'koishi';
4
4
  export declare const name = "echo-cave";
5
5
  export declare const inject: string[];
6
+ export * from './config/config';
6
7
  export interface EchoCave {
7
8
  id: number;
8
9
  channelId: string;
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.3",
4
+ "version": "1.18.5",
5
5
  "main": "lib/index.cjs",
6
6
  "typings": "lib/index.d.ts",
7
7
  "type": "module",