koishi-plugin-echo-cave 1.18.1 → 1.18.2
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Context, Session } from 'koishi';
|
|
2
|
-
export declare function searchCave(ctx: Context, session: Session, userIds:
|
|
2
|
+
export declare function searchCave(ctx: Context, session: Session, userIds: string): Promise<string>;
|
package/lib/index.cjs
CHANGED
|
@@ -206,7 +206,7 @@ async function checkUsersInGroup(ctx, session, userIds) {
|
|
|
206
206
|
var import_koishi = require("koishi");
|
|
207
207
|
function parseUserIds(userIds) {
|
|
208
208
|
const parsedUserIds = [];
|
|
209
|
-
for (const userId of userIds) {
|
|
209
|
+
for (const userId of typeof userIds === "string" ? [userIds] : userIds) {
|
|
210
210
|
const num = Number(userId);
|
|
211
211
|
if (!Number.isNaN(num)) {
|
|
212
212
|
parsedUserIds.push(userId);
|
|
@@ -826,7 +826,7 @@ async function searchCave(ctx, session, userIds) {
|
|
|
826
826
|
if (!userIds) {
|
|
827
827
|
return session.text(".noUserIdProvided");
|
|
828
828
|
}
|
|
829
|
-
const result = parseUserIds(userIds
|
|
829
|
+
const result = parseUserIds(userIds);
|
|
830
830
|
if (result.error === "invalid_all_mention") {
|
|
831
831
|
return session.text("echo-cave.user.invalidAllMention");
|
|
832
832
|
}
|
|
@@ -893,7 +893,7 @@ function apply(ctx, cfg) {
|
|
|
893
893
|
ctx.command("cave.purge <...ids:number>").action(
|
|
894
894
|
async ({ session }, ...ids) => await deleteCaves(ctx, session, cfg, ids)
|
|
895
895
|
);
|
|
896
|
-
ctx.command("cave.search <id
|
|
896
|
+
ctx.command("cave.search <id>").action(
|
|
897
897
|
async ({ session }, id) => await searchCave(ctx, session, id)
|
|
898
898
|
);
|
|
899
899
|
ctx.command("cave.bind <id:number> <...userIds>", { authority: 4 }).action(
|