diff --git a/src/commands/ping.ts b/src/commands/ping.ts new file mode 100644 index 0000000..a2bb0b3 --- /dev/null +++ b/src/commands/ping.ts @@ -0,0 +1,17 @@ +import { Discord, Slash } from 'discordx' +import { CommandInteraction } from 'discord.js' + +@Discord() +export class Ping { + @Slash({ + name: 'ping', + description: 'ping the bot', + defaultMemberPermissions: ['Administrator'], + }) + async ping(interaction: CommandInteraction) { + await interaction.deferReply({ ephemeral: true }) + await interaction.editReply({ + content: `🏓Pong! ${interaction.client.ws.ping} ms`, + }) + } +} diff --git a/src/main.ts b/src/main.ts index c957f0e..e3acabf 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,10 +19,15 @@ export const bot = new Client({ simpleCommand: { prefix: '!', }, + + presence: { + status: 'online', + activities: [{ name: 'Designing...', type: 3 }], + }, }) bot.once('ready', async () => { - await bot.initApplicationCommands() + await bot.initApplicationCommands({ global: { disable: { delete: true } } }) console.log('Bot started') })