Add commands dir import to examples register commands (#3848)

This commit is contained in:
Fleny
2024-08-18 08:49:27 +02:00
committed by GitHub
parent 40ad08238a
commit 03f17ee36a
4 changed files with 41 additions and 0 deletions
@@ -1,7 +1,16 @@
import 'dotenv/config'
import { bot } from './bot.js'
import importDirectory from './utils/loader.js'
import { updateApplicationCommands } from './utils/updateCommands.js'
bot.logger.info('Loading commands...')
await importDirectory('./dist/commands')
bot.logger.info('Updating commands...')
await updateApplicationCommands()
bot.logger.info('Done!')
// We need to manually exit as the REST Manager has timeouts that will keep NodeJS alive
process.exit()