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 --- lib/utils/BushConstants.ts | 21 ++++++++++++++++++++- src/commands/info/userInfo.ts | 6 +++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/lib/utils/BushConstants.ts b/lib/utils/BushConstants.ts index 5eef88f..8e4871b 100644 --- a/lib/utils/BushConstants.ts +++ b/lib/utils/BushConstants.ts @@ -5,7 +5,7 @@ import { BuiltInReasons, CommandHandlerEvents as AkairoCommandHandlerEvents } from 'discord-akairo/dist/src/util/Constants.js'; -import { Colors, GuildFeature } from 'discord.js'; +import { Colors, GuildFeature, Snowflake } from 'discord.js'; const rawCapeUrl = 'https://raw.githubusercontent.com/NotEnoughUpdates/capes/master/'; @@ -470,6 +470,25 @@ export const mappings = deepLock({ } } as const); +export const bots: Record = { + // MEE6#4876 + '159985870458322944': { + applicationId: '159985415099514880' + }, + // Dyno + '155149108183695360': { + applicationId: '161660517914509312' + }, + // Tatsu#8792 + '172002275412279296': { + applicationId: '172002255350792192' + }, + // YAGPDB.xyz#8760 + '204255221017214977': { + applicationId: '204255083083333633' + } +}; + export const ArgumentMatches = Object.freeze({ ...AkairoArgumentMatches } as const); 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