feat(bots/discord/utils): allow loading commands from custom dir

This commit is contained in:
PalmDevs
2024-03-29 17:24:53 +07:00
parent 7eeb631270
commit 8b690b879b
5 changed files with 21 additions and 14 deletions

View File

@@ -4,6 +4,7 @@ import { createLogger } from '@revanced/bot-shared'
import { ActivityType, Client as DiscordClient, Partials } from 'discord.js'
import config from '../config'
import { LabeledResponseDatabase } from './classes/Database'
import { pathJoinCurrentDir } from './utils/fs' with { type: 'macro' }
export { config }
export const logger = createLogger({
@@ -52,5 +53,5 @@ export const discord = {
],
},
}),
commands: await loadCommands(),
commands: await loadCommands(pathJoinCurrentDir(import.meta.url, 'commands')),
} as const