Skip to content

Commit 3fa42e2

Browse files
committed
imp: use username instead of userid when no caves are found related to user
1 parent 9342716 commit 3fa42e2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/command/search-cave.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { checkUsersInGroup } from '../../adapters/onebot/user';
1+
import { checkUsersInGroup, getUserName } from '../../adapters/onebot/user';
22
import { parseUserIds } from '../../utils/msg/element-helper';
33
import { Context, Session, $ } from 'koishi';
44

@@ -42,7 +42,8 @@ export async function searchCave(ctx: Context, session: Session, userIds: string
4242
);
4343

4444
if (matchingCaves.length === 0) {
45-
return session.text('.noMatchingCaves', [targetUserId]);
45+
const userName = await getUserName(ctx, session, targetUserId);
46+
return session.text('.noMatchingCaves', [userName]);
4647
}
4748

4849
const caveIds = matchingCaves.map((cave) => cave.id).join(', ');

0 commit comments

Comments
 (0)