maybe
This commit is contained in:
parent
30cce5845c
commit
4745fb5145
@ -30,11 +30,11 @@ export class CommandRegistry {
|
||||
}
|
||||
|
||||
private async loadCommandFile(file: fs.Dirent): Promise<void> {
|
||||
const fullPath = getAppPath('commands', file.name)
|
||||
const commandName = path.basename(file.name, path.extname(file.name))
|
||||
|
||||
try {
|
||||
const module = await import(fullPath)
|
||||
const filePath = getAppPath('commands', file.name)
|
||||
const commandName = path.basename(file.name, path.extname(file.name))
|
||||
|
||||
const module = await import(filePath)
|
||||
if (typeof module.default !== 'function') {
|
||||
this.logger.warn(`Unrecognized export in ${file.name}`)
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user