pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 1 | import { CommandInteraction } from "discord.js"; |
| 2 | import { SlashCommandSubcommandBuilder } from "@discordjs/builders"; |
| 3 | import { WrappedCheck } from "jshaiku"; |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 4 | import generateEmojiEmbed from "../../utils/generateEmojiEmbed.js"; |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 5 | |
| 6 | const command = (builder: SlashCommandSubcommandBuilder) => |
| 7 | builder |
| 8 | .setName("stats") |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 9 | .setDescription("Gets the bot's stats") |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 10 | |
| 11 | const callback = (interaction: CommandInteraction) => { |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 12 | interaction.reply({ |
| 13 | embeds: [new generateEmojiEmbed() |
| 14 | .setTitle("Stats") |
| 15 | .setDescription( |
| 16 | `**Servers:** ${interaction.client.guilds.cache.size}\n` + |
| 17 | `**Ping:** \`${interaction.client.ws.ping*2}ms\`` |
| 18 | ) |
| 19 | .setStatus("Success") |
| 20 | .setEmoji("GUILD.GRAPHS") |
| 21 | |
| 22 | ], ephemeral: true |
| 23 | }); |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => { |
| 27 | return true; |
| 28 | } |
| 29 | |
| 30 | export { command }; |
| 31 | export { callback }; |
| 32 | export { check }; |