diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-08-27 17:55:49 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-08-27 17:55:49 -0400 |
commit | b72d58843e853b0f260527a3689f76b13946bcb8 (patch) | |
tree | 3be22bc6eb5365f59e0c4d84944172af1eddf379 | |
parent | a297485a0a0e54bf5942642b633dc31be934da0f (diff) | |
download | tanzanite-b72d58843e853b0f260527a3689f76b13946bcb8.tar.gz tanzanite-b72d58843e853b0f260527a3689f76b13946bcb8.tar.bz2 tanzanite-b72d58843e853b0f260527a3689f76b13946bcb8.zip |
add bot -> application mapping for user command
-rw-r--r-- | lib/utils/BushConstants.ts | 21 | ||||
-rw-r--r-- | 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<Snowflake, { applicationId: Snowflake }> = { + // 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; |