added ping command
This commit is contained in:
parent
eb6d4f429d
commit
5fa78f5ccd
17
src/commands/ping.ts
Normal file
17
src/commands/ping.ts
Normal file
@ -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`,
|
||||
})
|
||||
}
|
||||
}
|
@ -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')
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user