diff options
author | TymanWasTaken <32660892+tymanwastaken@users.noreply.github.com> | 2021-05-28 21:55:26 -0600 |
---|---|---|
committer | TymanWasTaken <32660892+tymanwastaken@users.noreply.github.com> | 2021-05-28 21:55:26 -0600 |
commit | 18f1af36bfe0a7c442ea5e80567a522a14bcbaf3 (patch) | |
tree | 4eeb10ccbe6d55bf85e3a64c1ad2a3aafed679fe /src/commands | |
parent | 2456dab3db0d8eaae515606b83a6c0c317d009b0 (diff) | |
download | tanzanite-18f1af36bfe0a7c442ea5e80567a522a14bcbaf3.tar.gz tanzanite-18f1af36bfe0a7c442ea5e80567a522a14bcbaf3.tar.bz2 tanzanite-18f1af36bfe0a7c442ea5e80567a522a14bcbaf3.zip |
format
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/dev/reload.ts | 14 | ||||
-rw-r--r-- | src/commands/info/pronouns.ts | 25 | ||||
-rw-r--r-- | src/commands/moulberry-bush/level.ts | 5 |
3 files changed, 9 insertions, 35 deletions
diff --git a/src/commands/dev/reload.ts b/src/commands/dev/reload.ts index 36c6fd7..0cf32ce 100644 --- a/src/commands/dev/reload.ts +++ b/src/commands/dev/reload.ts @@ -42,9 +42,7 @@ export default class ReloadCommand extends BushCommand { this.client.commandHandler.reloadAll(); this.client.listenerHandler.reloadAll(); this.client.inhibitorHandler.reloadAll(); - return `🔁 Successfully reloaded! (${ - new Date().getTime() - s.getTime() - }ms)`; + return `🔁 Successfully reloaded! (${new Date().getTime() - s.getTime()}ms)`; } catch (e) { return stripIndent` An error occured while reloading: @@ -53,17 +51,11 @@ export default class ReloadCommand extends BushCommand { } } - public async exec( - message: Message, - { fast }: { fast: boolean } - ): Promise<void> { + public async exec(message: Message, { fast }: { fast: boolean }): Promise<void> { await message.util.send(await this.getResponse(fast)); } - public async execSlash( - message: CommandInteraction, - { fast }: { fast: SlashCommandOption<boolean> } - ): Promise<void> { + public async execSlash(message: CommandInteraction, { fast }: { fast: SlashCommandOption<boolean> }): Promise<void> { await message.reply(await this.getResponse(fast?.value)); } } diff --git a/src/commands/info/pronouns.ts b/src/commands/info/pronouns.ts index 2c1d5f2..c53c542 100644 --- a/src/commands/info/pronouns.ts +++ b/src/commands/info/pronouns.ts @@ -59,17 +59,9 @@ export default class PronounsCommand extends BushCommand { slashEmphemeral: true // I'll add dynamic checking to this later }); } - async sendResponse( - message: Message | CommandInteraction, - user: User, - author: boolean - ): Promise<void> { + async sendResponse(message: Message | CommandInteraction, user: User, author: boolean): Promise<void> { try { - const apiRes: { pronouns: pronounsType } = await got - .get( - `https://pronoundb.org/api/v1/lookup?platform=discord&id=${user.id}` - ) - .json(); + const apiRes: { pronouns: pronounsType } = await got.get(`https://pronoundb.org/api/v1/lookup?platform=discord&id=${user.id}`).json(); if (message instanceof Message) { message.reply( new MessageEmbed({ @@ -96,13 +88,9 @@ export default class PronounsCommand extends BushCommand { } catch (e) { if (e instanceof HTTPError && e.response.statusCode === 404) { if (author) { - await message.reply( - 'You do not appear to have any pronouns set. Please go to https://pronoundb.org/ and set your pronouns.' - ); + await message.reply('You do not appear to have any pronouns set. Please go to https://pronoundb.org/ and set your pronouns.'); } else { - await message.reply( - `${user.tag} does not appear to have any pronouns set. Please tell them to go to https://pronoundb.org/ and set their pronouns.` - ); + await message.reply(`${user.tag} does not appear to have any pronouns set. Please tell them to go to https://pronoundb.org/ and set their pronouns.`); } } else throw e; } @@ -111,10 +99,7 @@ export default class PronounsCommand extends BushCommand { const u = user || message.author; await this.sendResponse(message, u, u.id === message.author.id); } - async execSlash( - message: CommandInteraction, - { user }: { user?: SlashCommandOption<void> } - ): Promise<void> { + async execSlash(message: CommandInteraction, { user }: { user?: SlashCommandOption<void> }): Promise<void> { const u = user?.user || message.user; await this.sendResponse(message, u, u.id === message.user.id); } diff --git a/src/commands/moulberry-bush/level.ts b/src/commands/moulberry-bush/level.ts index 554219d..05c1e0c 100644 --- a/src/commands/moulberry-bush/level.ts +++ b/src/commands/moulberry-bush/level.ts @@ -148,10 +148,7 @@ export default class LevelCommand extends BushCommand { // ); await message.reply(await this.getResponse(user || message.author)); } - async execSlash( - message: CommandInteraction, - { user }: { user?: CommandInteractionOption } - ): Promise<void> { + async execSlash(message: CommandInteraction, { user }: { user?: CommandInteractionOption }): Promise<void> { // await message.reply( // new MessageAttachment( // await this.getImage(user?.user || message.user), |