koishi-plugin-echo-cave 1.16.13 → 1.16.14
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 +8 -6
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -172,7 +172,14 @@ function parseUserIds(userIds) {
|
|
|
172
172
|
try {
|
|
173
173
|
const element = import_koishi.h.parse(userId);
|
|
174
174
|
if (element.length === 1 && element[0].type === "at") {
|
|
175
|
-
|
|
175
|
+
const userId2 = element[0].attrs.id;
|
|
176
|
+
if (userId2 === "all") {
|
|
177
|
+
return {
|
|
178
|
+
parsedUserIds: [],
|
|
179
|
+
error: "invalid_all_mention"
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
parsedUserIds.push(userId2);
|
|
176
183
|
}
|
|
177
184
|
} catch (e) {
|
|
178
185
|
const num = Number(userId);
|
|
@@ -584,11 +591,6 @@ function apply(ctx, cfg) {
|
|
|
584
591
|
);
|
|
585
592
|
ctx.command("cave.bind <id:number> <...userIds>", { authority: 4 }).action(
|
|
586
593
|
async ({ session }, id, ...userIds) => {
|
|
587
|
-
ctx.logger.info(`Binding users ${JSON.stringify(userIds)} to cave ID ${id}`);
|
|
588
|
-
for (const uid of userIds) {
|
|
589
|
-
ctx.logger.info(`User ID to bind: ${uid}`);
|
|
590
|
-
ctx.logger.info(`userid type: ${typeof uid}`);
|
|
591
|
-
}
|
|
592
594
|
await bindUsersToCave(ctx, session, id, userIds);
|
|
593
595
|
}
|
|
594
596
|
);
|