diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-23 18:20:35 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-23 18:20:35 -0400 |
commit | e1c9873287b1bdc24a07982b61652894423efa51 (patch) | |
tree | e8a551c2caa03f285e882e6b2519cbe52ac3376e /src/commands/utilities | |
parent | 8200a4427bb5c4093e7d4f1b30a3fdd7ee3380c1 (diff) | |
download | tanzanite-e1c9873287b1bdc24a07982b61652894423efa51.tar.gz tanzanite-e1c9873287b1bdc24a07982b61652894423efa51.tar.bz2 tanzanite-e1c9873287b1bdc24a07982b61652894423efa51.zip |
use isSlashMessage
Diffstat (limited to 'src/commands/utilities')
-rw-r--r-- | src/commands/utilities/price.ts | 4 | ||||
-rw-r--r-- | src/commands/utilities/suicide.ts | 4 | ||||
-rw-r--r-- | src/commands/utilities/wolframAlpha.ts | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/commands/utilities/price.ts b/src/commands/utilities/price.ts index 4d21c02..059533b 100644 --- a/src/commands/utilities/price.ts +++ b/src/commands/utilities/price.ts @@ -1,5 +1,5 @@ import { BushCommand, BushMessage } from '@lib'; -import { CommandInteraction, MessageEmbed } from 'discord.js'; +import { MessageEmbed } from 'discord.js'; import Fuse from 'fuse.js'; import got from 'got'; @@ -95,7 +95,7 @@ export default class PriceCommand extends BushCommand { } public override async exec(message: BushMessage, { item, strict }: { item: string; strict: boolean }): Promise<unknown> { - if (message.util.isSlash) await (message.interaction as CommandInteraction).deferReply(); + if (message.util.isSlashMessage(message)) await message.interaction.deferReply(); const errors = new Array<string>(); //prettier-ignore diff --git a/src/commands/utilities/suicide.ts b/src/commands/utilities/suicide.ts index 9289b1c..31bdca0 100644 --- a/src/commands/utilities/suicide.ts +++ b/src/commands/utilities/suicide.ts @@ -47,8 +47,8 @@ export default class TemplateCommand extends BushCommand { return ( // If the original message was a reply -> imitate it - (message as BushMessage).reference?.messageId && !message.util.isSlash && message.guild && message.channel - ? await message.channel.messages.fetch((message as BushMessage).reference!.messageId!).then(async (message1) => { + !message.util.isSlashMessage(message) && message.reference?.messageId && message.guild && message.channel + ? await message.channel.messages.fetch(message.reference!.messageId!).then(async (message1) => { await message1.reply({ embeds: [suicideEmbed], allowedMentions: AllowedMentions.users(), target: message1 }); }) : await message.util.send({ embeds: [suicideEmbed], allowedMentions: AllowedMentions.users() }) diff --git a/src/commands/utilities/wolframAlpha.ts b/src/commands/utilities/wolframAlpha.ts index 049dd60..426a0c7 100644 --- a/src/commands/utilities/wolframAlpha.ts +++ b/src/commands/utilities/wolframAlpha.ts @@ -1,5 +1,5 @@ import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib'; -import { CommandInteraction, MessageEmbed, MessageOptions } from 'discord.js'; +import { MessageEmbed, MessageOptions } from 'discord.js'; import WolframAlphaAPI from 'wolfram-alpha-api'; export default class WolframAlphaCommand extends BushCommand { @@ -48,7 +48,7 @@ export default class WolframAlphaCommand extends BushCommand { message: BushMessage | BushSlashMessage, args: { expression: string; image: boolean } ): Promise<unknown> { - if (message.util.isSlash) await (message.interaction as CommandInteraction).deferReply(); + if (message.util.isSlashMessage(message)) await message.interaction.deferReply(); args.image && void message.util.reply({ content: `${util.emojis.loading} Loading...`, embeds: [] }); const waApi = WolframAlphaAPI(client.config.credentials.wolframAlphaAppId); |