diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-05-26 21:53:35 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-05-26 21:53:35 -0400 |
commit | cd0f853a2e4732cea5356f9ee3603bb804b0ab1f (patch) | |
tree | ac2f6ced46dfae7ca376e4dbd957d99a341d86a9 /src/commands/info/ping.ts | |
parent | 0caccda67d97dd74405aa4ece5d3f07e7c7dfc66 (diff) | |
download | tanzanite-cd0f853a2e4732cea5356f9ee3603bb804b0ab1f.tar.gz tanzanite-cd0f853a2e4732cea5356f9ee3603bb804b0ab1f.tar.bz2 tanzanite-cd0f853a2e4732cea5356f9ee3603bb804b0ab1f.zip |
made some more changes
Diffstat (limited to 'src/commands/info/ping.ts')
-rw-r--r-- | src/commands/info/ping.ts | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/src/commands/info/ping.ts b/src/commands/info/ping.ts deleted file mode 100644 index 62b8e60..0000000 --- a/src/commands/info/ping.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { CommandInteraction } from 'discord.js'; -import { Message } from 'discord.js'; -import { MessageEmbed } from 'discord.js'; -import { BushCommand } from '../../lib/extensions/BushCommand'; - -export default class PingCommand extends BushCommand { - constructor() { - super('ping', { - aliases: ['ping'], - description: { - content: 'Gets the latency of the bot', - usage: 'ping', - examples: ['ping'] - } - }); - } - - public async exec(message: Message): Promise<void> { - const sentMessage = await message.util.send('Pong!'); - 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 embed = new MessageEmbed() - .setTitle('Pong! 🏓') - .addField('Bot Latency', botLatency, true) - .addField('API Latency', apiLatency, true) - .setFooter( - message.author.username, - message.author.displayAvatarURL({ dynamic: true }) - ) - .setTimestamp(); - await sentMessage.edit({ - content: null, - embed - }); - } - - 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 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 }) - ) - .setTimestamp(); - await message.editReply({ - content: null, - embeds: [embed] - }); - } -} |