Slash Commands Test

This commit is contained in:
Dragon Fire
2024-04-07 20:10:26 -04:00
parent 204c056ea1
commit 76fd56b03a
7 changed files with 107 additions and 0 deletions
+10
View File
@@ -63,9 +63,19 @@ client.registry
])
.registerCommandsIn(path.join(__dirname, 'commands'));
client.slashRegistry.registerCommandsIn(path.join(__dirname, 'slash-commands'));
client.on('ready', async () => {
client.logger.info(`[READY] Logged in as ${client.user.tag}! ID: ${client.user.id}`);
// Register Slash Commands in Test Server
try {
const slashCmds = await client.slashRegistry.uploadTestCommands();
client.logger.info(`[SLASH] Registered ${slashCmds.length} slash commands for testing!`);
} catch (err) {
client.logger.error(`[SLASH] Failed to register slash commands for testing:\n${err.stack}`);
}
// Make temp directories
const tmpFolderExists = await checkFileExists(path.join(__dirname, 'tmp'));
if (!tmpFolderExists) await mkdir(path.join(__dirname, 'tmp'));