feat(bots/discord)!: read commit description

FEATURES:
- Updated documentation
- Improved configuration format
- Allow filter overriding for each response config (closes #29)
- Improved commands directory structure
- Improved slash command reload script
- New commands
- New command exception handling
This commit is contained in:
PalmDevs
2024-04-02 19:34:45 +07:00
parent a9add9ea9a
commit 7e5f6481c5
21 changed files with 542 additions and 558 deletions

View File

@@ -0,0 +1,29 @@
import { SlashCommandBuilder } from 'discord.js'
import type { Command } from '..'
export default {
data: new SlashCommandBuilder().setName('stop').setDescription('Stops the bot').setDMPermission(true).toJSON(),
ownerOnly: true,
global: true,
async execute({ api, logger }, interaction) {
api.isStopping = true
logger.fatal('Stopping bot...')
await interaction.reply({
content: 'Stopping... (I will go offline once done)',
ephemeral: true,
})
api.client.disconnect()
logger.warn('Disconnected from API')
await interaction.client.destroy()
logger.warn('Disconnected from Discord API')
logger.info(`Bot stopped, requested by ${interaction.user.id}`)
process.exit(0)
},
} satisfies Command