mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-26 04:31:03 +00:00
feat(bots/discord/commands): add reload command
This commit is contained in:
17
bots/discord/src/commands/admin/reload.ts
Normal file
17
bots/discord/src/commands/admin/reload.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { AdminCommand } from '$/classes/Command'
|
||||
import { join, dirname } from 'path'
|
||||
|
||||
import type { Config } from 'config.schema'
|
||||
|
||||
export default new AdminCommand({
|
||||
name: 'reload',
|
||||
description: 'Reload configuration',
|
||||
async execute(context, trigger) {
|
||||
context.config = ((await import(join(dirname(Bun.main), '..', 'config.js'))) as { default: Config }).default
|
||||
|
||||
await trigger.reply({
|
||||
content: 'Reloaded configuration',
|
||||
ephemeral: true,
|
||||
})
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user