aboutsummaryrefslogtreecommitdiff
path: root/src/commands/info/PingCommand.ts
diff options
context:
space:
mode:
authorTymanWasTaken <32660892+tymanwastaken@users.noreply.github.com>2021-05-11 10:52:26 -0600
committerTymanWasTaken <32660892+tymanwastaken@users.noreply.github.com>2021-05-11 10:52:26 -0600
commit199d413119f3656d9f2da118f91a22a3cc55f6bb (patch)
tree7d1ba161a51bb6303e5a537f8043d07cfc325a76 /src/commands/info/PingCommand.ts
parente0b2b559219d642d6b5353490ab60ae1a754b560 (diff)
downloadtanzanite-199d413119f3656d9f2da118f91a22a3cc55f6bb.tar.gz
tanzanite-199d413119f3656d9f2da118f91a22a3cc55f6bb.tar.bz2
tanzanite-199d413119f3656d9f2da118f91a22a3cc55f6bb.zip
whoops forgot about these
Diffstat (limited to 'src/commands/info/PingCommand.ts')
-rw-r--r--src/commands/info/PingCommand.ts69
1 files changed, 0 insertions, 69 deletions
diff --git a/src/commands/info/PingCommand.ts b/src/commands/info/PingCommand.ts
deleted file mode 100644
index 7f8ab6b..0000000
--- a/src/commands/info/PingCommand.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-import { CommandInteraction } from 'discord.js';
-import { Message } from 'discord.js';
-import { MessageEmbed } from 'discord.js';
-import { BotCommand } from '../../lib/extensions/BotCommand';
-import { BotMessage } from '../../lib/extensions/BotMessage';
-
-export default class PingCommand extends BotCommand {
- constructor() {
- super('ping', {
- aliases: ['ping'],
- description: {
- content: 'Gets the latency of the bot',
- usage: 'ping',
- examples: ['ping']
- }
- });
- }
-
- public async exec(message: BotMessage): 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]
- });
- }
-}