koishi-plugin-echo-cave 1.18.2 → 1.18.4
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.
- package/lib/index.cjs +44 -9
- package/lib/index.d.ts +1 -0
- package/package.json +1 -1
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: {
|
|
@@ -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
|
|
@@ -818,7 +837,6 @@ async function bindUsersToCave(ctx, session, id, userIds) {
|
|
|
818
837
|
}
|
|
819
838
|
|
|
820
839
|
// src/core/command/search-cave.ts
|
|
821
|
-
var import_koishi2 = require("koishi");
|
|
822
840
|
async function searchCave(ctx, session, userIds) {
|
|
823
841
|
if (!session.guildId) {
|
|
824
842
|
return session.text("echo-cave.general.privateChatReminder");
|
|
@@ -840,12 +858,11 @@ async function searchCave(ctx, session, userIds) {
|
|
|
840
858
|
}
|
|
841
859
|
const targetUserId = parsedUserIds[0];
|
|
842
860
|
const { channelId } = session;
|
|
843
|
-
const
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
)
|
|
861
|
+
const caves = await ctx.database.get("echo_cave", {
|
|
862
|
+
channelId
|
|
863
|
+
});
|
|
864
|
+
const matchingCaves = caves.filter(
|
|
865
|
+
(cave) => cave.originUserId === targetUserId || cave.relatedUsers.includes(targetUserId)
|
|
849
866
|
);
|
|
850
867
|
if (matchingCaves.length === 0) {
|
|
851
868
|
return session.text(".noMatchingCaves", [targetUserId]);
|
|
@@ -855,11 +872,28 @@ async function searchCave(ctx, session, userIds) {
|
|
|
855
872
|
return session.text(".searchResult", [count, caveIds]);
|
|
856
873
|
}
|
|
857
874
|
|
|
875
|
+
// src/config/config.ts
|
|
876
|
+
var import_koishi2 = require("koishi");
|
|
877
|
+
var Config = import_koishi2.Schema.object({
|
|
878
|
+
adminMessageProtection: import_koishi2.Schema.boolean().default(false),
|
|
879
|
+
allowContributorDelete: import_koishi2.Schema.boolean().default(true),
|
|
880
|
+
allowSenderDelete: import_koishi2.Schema.boolean().default(true),
|
|
881
|
+
deleteMediaWhenDeletingMsg: import_koishi2.Schema.boolean().default(true),
|
|
882
|
+
enableSizeLimit: import_koishi2.Schema.boolean().default(false),
|
|
883
|
+
maxImageSize: import_koishi2.Schema.number().default(2048),
|
|
884
|
+
maxVideoSize: import_koishi2.Schema.number().default(512),
|
|
885
|
+
maxFileSize: import_koishi2.Schema.number().default(512),
|
|
886
|
+
maxRecordSize: import_koishi2.Schema.number().default(512),
|
|
887
|
+
useBase64ForMedia: import_koishi2.Schema.boolean().default(false)
|
|
888
|
+
}).i18n({
|
|
889
|
+
"zh-CN": require_zh_CN()
|
|
890
|
+
});
|
|
891
|
+
|
|
858
892
|
// src/index.ts
|
|
859
893
|
var name = "echo-cave";
|
|
860
894
|
var inject = ["database"];
|
|
861
895
|
function apply(ctx, cfg) {
|
|
862
|
-
ctx.i18n.define("zh-CN",
|
|
896
|
+
ctx.i18n.define("zh-CN", require_zh_CN2());
|
|
863
897
|
ctx.model.extend(
|
|
864
898
|
"echo_cave",
|
|
865
899
|
{
|
|
@@ -902,6 +936,7 @@ function apply(ctx, cfg) {
|
|
|
902
936
|
}
|
|
903
937
|
// Annotate the CommonJS export names for ESM import in node:
|
|
904
938
|
0 && (module.exports = {
|
|
939
|
+
Config,
|
|
905
940
|
apply,
|
|
906
941
|
inject,
|
|
907
942
|
name
|
package/lib/index.d.ts
CHANGED