mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
feat(bots/discord/commands): add reload command
This commit is contained in:
3
bots/discord/.gitignore
vendored
3
bots/discord/.gitignore
vendored
@@ -174,9 +174,6 @@ dist
|
||||
# Finder (MacOS) folder config
|
||||
.DS_Store
|
||||
|
||||
# Config
|
||||
config.ts
|
||||
|
||||
# DB
|
||||
*.db
|
||||
*.sqlite
|
||||
|
||||
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