koishi-plugin-echo-cave 1.16.12 → 1.16.13
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 +23 -13
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -157,6 +157,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
157
157
|
var import_koishi_plugin_adapter_onebot = require("@pynickle/koishi-plugin-adapter-onebot");
|
|
158
158
|
|
|
159
159
|
// src/cqcode-helper.ts
|
|
160
|
+
var import_koishi = require("koishi");
|
|
160
161
|
function createTextMsg(content) {
|
|
161
162
|
return {
|
|
162
163
|
type: "text",
|
|
@@ -168,7 +169,16 @@ function createTextMsg(content) {
|
|
|
168
169
|
function parseUserIds(userIds) {
|
|
169
170
|
const parsedUserIds = [];
|
|
170
171
|
for (const userId of userIds) {
|
|
171
|
-
|
|
172
|
+
try {
|
|
173
|
+
const element = import_koishi.h.parse(userId);
|
|
174
|
+
if (element.length === 1 && element[0].type === "at") {
|
|
175
|
+
parsedUserIds.push(element[0].attrs.id);
|
|
176
|
+
}
|
|
177
|
+
} catch (e) {
|
|
178
|
+
const num = Number(userId);
|
|
179
|
+
if (Number.isNaN(num)) {
|
|
180
|
+
parsedUserIds.push(userId);
|
|
181
|
+
}
|
|
172
182
|
}
|
|
173
183
|
}
|
|
174
184
|
return {
|
|
@@ -523,20 +533,20 @@ async function processMessageContent(ctx, msg, cfg) {
|
|
|
523
533
|
|
|
524
534
|
// src/index.ts
|
|
525
535
|
var import_koishi_plugin_adapter_onebot2 = require("@pynickle/koishi-plugin-adapter-onebot");
|
|
526
|
-
var
|
|
536
|
+
var import_koishi2 = require("koishi");
|
|
527
537
|
var name = "echo-cave";
|
|
528
538
|
var inject = ["database"];
|
|
529
|
-
var Config =
|
|
530
|
-
adminMessageProtection:
|
|
531
|
-
allowContributorDelete:
|
|
532
|
-
allowSenderDelete:
|
|
533
|
-
deleteMediaWhenDeletingMsg:
|
|
534
|
-
enableSizeLimit:
|
|
535
|
-
maxImageSize:
|
|
536
|
-
maxVideoSize:
|
|
537
|
-
maxFileSize:
|
|
538
|
-
maxRecordSize:
|
|
539
|
-
useBase64ForMedia:
|
|
539
|
+
var Config = import_koishi2.Schema.object({
|
|
540
|
+
adminMessageProtection: import_koishi2.Schema.boolean().default(false),
|
|
541
|
+
allowContributorDelete: import_koishi2.Schema.boolean().default(true),
|
|
542
|
+
allowSenderDelete: import_koishi2.Schema.boolean().default(true),
|
|
543
|
+
deleteMediaWhenDeletingMsg: import_koishi2.Schema.boolean().default(true),
|
|
544
|
+
enableSizeLimit: import_koishi2.Schema.boolean().default(false),
|
|
545
|
+
maxImageSize: import_koishi2.Schema.number().default(2048),
|
|
546
|
+
maxVideoSize: import_koishi2.Schema.number().default(512),
|
|
547
|
+
maxFileSize: import_koishi2.Schema.number().default(512),
|
|
548
|
+
maxRecordSize: import_koishi2.Schema.number().default(512),
|
|
549
|
+
useBase64ForMedia: import_koishi2.Schema.boolean().default(false)
|
|
540
550
|
}).i18n({
|
|
541
551
|
"zh-CN": require_zh_CN()._config
|
|
542
552
|
});
|