diff options
Diffstat (limited to 'src/commands/info/ping.ts')
-rw-r--r-- | src/commands/info/ping.ts | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/commands/info/ping.ts b/src/commands/info/ping.ts index e0bbfc7..9468722 100644 --- a/src/commands/info/ping.ts +++ b/src/commands/info/ping.ts @@ -21,20 +21,13 @@ export default class PingCommand extends BushCommand { const timestamp: number = message.editedTimestamp ? message.editedTimestamp : message.createdTimestamp; - const botLatency = `\`\`\`\n ${Math.floor( - sentMessage.createdTimestamp - timestamp - )}ms \`\`\``; - const apiLatency = `\`\`\`\n ${Math.round( - message.client.ws.ping - )}ms \`\`\``; + const botLatency = `\`\`\`\n ${Math.floor(sentMessage.createdTimestamp - timestamp)}ms \`\`\``; + const apiLatency = `\`\`\`\n ${Math.round(message.client.ws.ping)}ms \`\`\``; const embed = new MessageEmbed() .setTitle('Pong! 🏓') .addField('Bot Latency', botLatency, true) .addField('API Latency', apiLatency, true) - .setFooter( - message.author.username, - message.author.displayAvatarURL({ dynamic: true }) - ) + .setFooter(message.author.username, message.author.displayAvatarURL({ dynamic: true })) .setTimestamp(); await sentMessage.edit({ content: null, @@ -45,21 +38,14 @@ export default class PingCommand extends BushCommand { 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 botLatency = `\`\`\`\n ${Math.floor( - timestamp2 - timestamp1 - )}ms \`\`\``; + 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 embed = new MessageEmbed() .setTitle('Pong! 🏓') .addField('Bot Latency', botLatency, true) .addField('API Latency', apiLatency, true) - .setFooter( - message.user.username, - message.user.displayAvatarURL({ dynamic: true }) - ) + .setFooter(message.user.username, message.user.displayAvatarURL({ dynamic: true })) .setTimestamp(); await message.editReply({ content: null, |