koishi-plugin-echo-cave 1.16.8 → 1.16.10
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 +4 -6
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -189,10 +189,7 @@ function parseUserIds(userIds) {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
} catch (e) {
|
|
192
|
-
|
|
193
|
-
if (!Number.isNaN(num)) {
|
|
194
|
-
parsedUserIds.push(String(num));
|
|
195
|
-
}
|
|
192
|
+
parsedUserIds.push(userIdStr.split(":")[1]);
|
|
196
193
|
}
|
|
197
194
|
}
|
|
198
195
|
return {
|
|
@@ -586,7 +583,7 @@ function apply(ctx, cfg) {
|
|
|
586
583
|
ctx.command("cave [id:number]").action(
|
|
587
584
|
async ({ session }, id) => await getCave(ctx, session, cfg, id)
|
|
588
585
|
);
|
|
589
|
-
ctx.command("cave.echo [...userIds
|
|
586
|
+
ctx.command("cave.echo [...userIds]").action(
|
|
590
587
|
async ({ session }, ...userIds) => await addCave(ctx, session, cfg, userIds)
|
|
591
588
|
);
|
|
592
589
|
ctx.command("cave.wipe <id:number>").action(
|
|
@@ -596,7 +593,7 @@ function apply(ctx, cfg) {
|
|
|
596
593
|
ctx.command("cave.trace").action(
|
|
597
594
|
async ({ session }) => await getCaveListByOriginUser(ctx, session)
|
|
598
595
|
);
|
|
599
|
-
ctx.command("cave.bind <id:number> <...userIds
|
|
596
|
+
ctx.command("cave.bind <id:number> <...userIds>", { authority: 4 }).action(
|
|
600
597
|
async ({ session }, id, ...userIds) => await bindUsersToCave(ctx, session, id, userIds)
|
|
601
598
|
);
|
|
602
599
|
}
|
|
@@ -715,6 +712,7 @@ async function addCave(ctx, session, cfg, userIds) {
|
|
|
715
712
|
const messageId = quote.id;
|
|
716
713
|
let parsedUserIds = [];
|
|
717
714
|
if (userIds && userIds.length > 0) {
|
|
715
|
+
ctx.logger.info(`Original userIds in addCave: ${JSON.stringify(userIds)}`);
|
|
718
716
|
const result = parseUserIds(userIds);
|
|
719
717
|
if (result.error === "invalid_all_mention") {
|
|
720
718
|
return session.text(".invalidAllMention");
|