From b72d58843e853b0f260527a3689f76b13946bcb8 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sat, 27 Aug 2022 17:55:49 -0400 Subject: add bot -> application mapping for user command --- src/commands/info/userInfo.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts index 045087f..1f139b5 100644 --- a/src/commands/info/userInfo.ts +++ b/src/commands/info/userInfo.ts @@ -1,5 +1,6 @@ import { Arg, + bots, BushCommand, clientSendAndPermCheck, colors, @@ -258,8 +259,11 @@ export default class UserInfoCommand extends BushCommand { public static async generateBotField(embed: EmbedBuilder, user: User, title = 'ยป Bot Information') { if (!user.bot) return; + // very old bots have different bot vs user ids + const applicationId = bots[user.id]?.applicationId ?? user.id; + const applicationInfo = (await user.client.rest - .get(`/applications/${user.id}/rpc`) + .get(`/applications/${applicationId}/rpc`) .catch(() => null)) as APIApplication | null; if (!applicationInfo) return; -- cgit