diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-25 16:16:44 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-25 16:16:44 -0400 |
commit | 4364f1d344e75d23728ce951fc768bc9c8405bed (patch) | |
tree | 47dbdb0482fc16842271c44e3736ba86e0064351 /src/commands/info | |
parent | 95dc4c4a4abeed75f419c9ccd5b3f072609c5035 (diff) | |
download | tanzanite-4364f1d344e75d23728ce951fc768bc9c8405bed.tar.gz tanzanite-4364f1d344e75d23728ce951fc768bc9c8405bed.tar.bz2 tanzanite-4364f1d344e75d23728ce951fc768bc9c8405bed.zip |
cleaned up, wolfram alpha command, a few fixes
Diffstat (limited to 'src/commands/info')
-rw-r--r-- | src/commands/info/guildInfo.ts | 6 | ||||
-rw-r--r-- | src/commands/info/pronouns.ts | 5 | ||||
-rw-r--r-- | src/commands/info/snowflakeInfo.ts | 4 | ||||
-rw-r--r-- | src/commands/info/userInfo.ts | 6 |
4 files changed, 11 insertions, 10 deletions
diff --git a/src/commands/info/guildInfo.ts b/src/commands/info/guildInfo.ts index 431b8bd..0aa5fc0 100644 --- a/src/commands/info/guildInfo.ts +++ b/src/commands/info/guildInfo.ts @@ -14,7 +14,7 @@ export default class GuildInfoCommand extends BushCommand { args: [ { id: 'guild', - customType: util.arg.union('guild', 'bigint'), + customType: util.arg.union('guild', 'snowflake'), prompt: { start: 'What server would you like to find information about?', retry: '{error} Choose a valid server to find information about.', @@ -38,7 +38,7 @@ export default class GuildInfoCommand extends BushCommand { public override async exec( message: BushMessage | BushSlashMessage, - args: { guild: Guild | bigint | GuildPreview } + args: { guild: Guild | Snowflake | GuildPreview } ): Promise<unknown> { if (!args?.guild && !message.guild) { return await message.util.reply( @@ -46,7 +46,7 @@ export default class GuildInfoCommand extends BushCommand { ); } let isPreview = false; - if (['bigint', 'number', 'string'].includes(typeof args?.guild)) { + if (['number', 'string'].includes(typeof args?.guild)) { const preview = await client.fetchGuildPreview(`${args.guild}` as Snowflake).catch(() => {}); if (preview) { args.guild = preview; diff --git a/src/commands/info/pronouns.ts b/src/commands/info/pronouns.ts index 96040c0..ea20d41 100644 --- a/src/commands/info/pronouns.ts +++ b/src/commands/info/pronouns.ts @@ -1,4 +1,5 @@ import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { Snowflake } from 'discord-api-types'; import { MessageEmbed, User } from 'discord.js'; import got, { HTTPError } from 'got'; @@ -40,7 +41,7 @@ export default class PronounsCommand extends BushCommand { args: [ { id: 'user', - customType: util.arg.union('user', 'bigint'), + customType: util.arg.union('user', 'snowflake'), prompt: { start: 'Who would you like to view the pronouns of?', retry: '{error} Choose a valid user to view the pronouns of.', @@ -60,7 +61,7 @@ export default class PronounsCommand extends BushCommand { slash: true }); } - override async exec(message: BushMessage | BushSlashMessage, args: { user?: User | string }): Promise<unknown> { + override async exec(message: BushMessage | BushSlashMessage, args: { user?: User | Snowflake }): Promise<unknown> { const user = args?.user === undefined || args?.user === null ? message.author diff --git a/src/commands/info/snowflakeInfo.ts b/src/commands/info/snowflakeInfo.ts index 02c8d39..603993a 100644 --- a/src/commands/info/snowflakeInfo.ts +++ b/src/commands/info/snowflakeInfo.ts @@ -32,7 +32,7 @@ export default class SnowflakeInfoCommand extends BushCommand { args: [ { id: 'snowflake', - type: 'bigint', + type: 'snowflake', prompt: { start: 'Enter the snowflake you would like to get information about.', retry: '{error} Choose a valid snowflake.', @@ -52,7 +52,7 @@ export default class SnowflakeInfoCommand extends BushCommand { ] }); } - public override async exec(message: BushMessage | BushSlashMessage, args: { snowflake: bigint }): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage, args: { snowflake: Snowflake }): Promise<unknown> { const snowflake = `${args.snowflake}` as Snowflake; const snowflakeEmbed = new MessageEmbed().setTitle('Unknown :snowflake:').setColor(util.colors.default); diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts index 7b8d7d8..ae204f7 100644 --- a/src/commands/info/userInfo.ts +++ b/src/commands/info/userInfo.ts @@ -1,5 +1,5 @@ import { BushCommand, BushMessage, BushSlashMessage, BushUser } from '@lib'; -import { MessageEmbed } from 'discord.js'; +import { MessageEmbed, Snowflake } from 'discord.js'; // TODO: Add bot information export default class UserInfoCommand extends BushCommand { @@ -15,7 +15,7 @@ export default class UserInfoCommand extends BushCommand { args: [ { id: 'user', - customType: util.arg.union('user', 'bigint'), + customType: util.arg.union('user', 'snowflake'), prompt: { start: 'What user would you like to find information about?', retry: '{error} Choose a valid user to find information about.', @@ -38,7 +38,7 @@ export default class UserInfoCommand extends BushCommand { }); } - public override async exec(message: BushMessage | BushSlashMessage, args: { user: BushUser | bigint }): Promise<unknown> { + public override async exec(message: BushMessage | BushSlashMessage, args: { user: BushUser | Snowflake }): Promise<unknown> { const user = args?.user === undefined || args?.user === null ? message.author |