diff options
author | Tyman <tyman@tyman.tech> | 2021-05-07 20:09:01 +0000 |
---|---|---|
committer | Tyman <tyman@tyman.tech> | 2021-05-07 20:09:01 +0000 |
commit | 45f6cc57ef53163928a5f792e2cf6bcb1d201a6c (patch) | |
tree | 394b2fc9f93db34405958207066d7aa326ee62d7 | |
parent | d4d5d0e822c9570a2ca9ef86cc21073dbbec2087 (diff) | |
download | tanzanite-45f6cc57ef53163928a5f792e2cf6bcb1d201a6c.tar.gz tanzanite-45f6cc57ef53163928a5f792e2cf6bcb1d201a6c.tar.bz2 tanzanite-45f6cc57ef53163928a5f792e2cf6bcb1d201a6c.zip |
format
-rw-r--r-- | src/commands/info/PingCommand.ts | 12 | ||||
-rw-r--r-- | src/lib/extensions/BotCommand.ts | 4 | ||||
-rw-r--r-- | src/listeners/client/CreateSlashCommands.ts | 7 |
3 files changed, 12 insertions, 11 deletions
diff --git a/src/commands/info/PingCommand.ts b/src/commands/info/PingCommand.ts index bb3324d..7f8ab6b 100644 --- a/src/commands/info/PingCommand.ts +++ b/src/commands/info/PingCommand.ts @@ -45,13 +45,13 @@ export default class PingCommand extends BotCommand { public async execSlash(message: CommandInteraction): Promise<void> { const timestamp1 = message.createdTimestamp; await message.reply('Pong!'); - const timestamp2 = await message.fetchReply().then(m => (m as Message).createdTimestamp) + const timestamp2 = await message + .fetchReply() + .then((m) => (m as Message).createdTimestamp); const botLatency = `\`\`\`\n ${Math.floor( timestamp2 - timestamp1 )}ms \`\`\``; - const apiLatency = `\`\`\`\n ${Math.round( - this.client.ws.ping - )}ms \`\`\``; + const apiLatency = `\`\`\`\n ${Math.round(this.client.ws.ping)}ms \`\`\``; const embed = new MessageEmbed() .setTitle('Pong! 🏓') .addField('Bot Latency', botLatency, true) @@ -63,9 +63,7 @@ export default class PingCommand extends BotCommand { .setTimestamp(); await message.editReply({ content: null, - embeds: [ - embed - ] + embeds: [embed] }); } } diff --git a/src/lib/extensions/BotCommand.ts b/src/lib/extensions/BotCommand.ts index e86e176..79c7a9f 100644 --- a/src/lib/extensions/BotCommand.ts +++ b/src/lib/extensions/BotCommand.ts @@ -4,7 +4,7 @@ import { BotClient } from './BotClient'; export class BotCommand extends Command { public client: BotClient; constructor(id: string, options?: CommandOptions) { - super(id, options) - this.options = options + super(id, options); + this.options = options; } } diff --git a/src/listeners/client/CreateSlashCommands.ts b/src/listeners/client/CreateSlashCommands.ts index f747f4a..b860bec 100644 --- a/src/listeners/client/CreateSlashCommands.ts +++ b/src/listeners/client/CreateSlashCommands.ts @@ -11,7 +11,11 @@ export default class CreateSlashCommands extends BotListener { try { const enabled = await this.client.application.commands.fetch(); for (const command of enabled) { - if (!this.client.commandHandler.modules.find((cmd) => cmd.id == command[1].name)) { + if ( + !this.client.commandHandler.modules.find( + (cmd) => cmd.id == command[1].name + ) + ) { await this.client.application.commands.delete(command[1].id); console.log('deleted', command[1].name); } @@ -38,7 +42,6 @@ export default class CreateSlashCommands extends BotListener { } } - return console.log('Slash commands registered'); } catch (e) { console.log(e); |