mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-19 17:23:59 +00:00
- Migrated to a new command framework which looks better and works better - Fixed commands not being bundled correctly - Added message (prefix) commands with argument validation - Added a new CommandErrorType, for invalid arguments - `/eval` is now a bit safer - Corrected colors for the coinflip embed - `/stop` now works even when the bot is not connected to the API
25 lines
790 B
TypeScript
25 lines
790 B
TypeScript
import { AdminCommand } from '$/classes/Command'
|
|
|
|
export default new AdminCommand({
|
|
name: 'stop',
|
|
description: "You don't want to run this unless the bot starts to go insane, and like, you really need to stop it.",
|
|
async execute({ api, logger, executor }, trigger) {
|
|
api.intentionallyDisconnecting = true
|
|
|
|
logger.fatal('Stopping bot...')
|
|
trigger.reply({
|
|
content: 'Stopping... (I will go offline once done)',
|
|
ephemeral: true,
|
|
})
|
|
|
|
if (!api.client.disconnected) api.client.disconnect()
|
|
logger.warn('Disconnected from API')
|
|
|
|
trigger.client.destroy()
|
|
logger.warn('Disconnected from Discord API')
|
|
|
|
logger.info(`Bot stopped, requested by ${executor.id}`)
|
|
process.exit(0)
|
|
},
|
|
})
|