mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-01 22:14:59 +00:00
fix: implemented new logging service to command deployment
This commit is contained in:
1 parent
53d15b05e1
commit
4a2f47c949
2 files changed
+21
-16
No files matched your search
+10
-9
@@ -1,4 +1,5 @@
|
||||
const fs = require('node:fs');
|
||||
const logger = require('./services/logger.js');
|
||||
const { REST, Routes } = require('discord.js');
|
||||
const { token, clientId } = require('./config.json');
|
||||
|
||||
@@ -16,22 +17,22 @@ const rest = new REST({ version: '10' }).setToken(token);
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
console.log('DEPLOYING BOT SLASH COMMANDS');
|
||||
console.log(
|
||||
'Commands: ',
|
||||
commands.map((command) => {
|
||||
return command.name;
|
||||
})
|
||||
logger.info('DEPLOYING BOT SLASH COMMANDS');
|
||||
logger.info(
|
||||
commands.map((commands) => {
|
||||
return commands.name;
|
||||
}),
|
||||
'Bot commands found:'
|
||||
);
|
||||
|
||||
console.log('Started refreshing application (/) commands.');
|
||||
logger.info('Started refreshing application (/) bot commands.');
|
||||
|
||||
await rest.put(Routes.applicationCommands(clientId), {
|
||||
body: commands
|
||||
});
|
||||
|
||||
console.log('Successfully reloaded application (/) commands.');
|
||||
logger.info('Successfully refreshed application (/) bot commands.');
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error, 'Failed to refresh application (/) bot commands.');
|
||||
}
|
||||
})();
|
||||
@@ -1,4 +1,5 @@
|
||||
const fs = require('node:fs');
|
||||
const logger = require('./services/logger.js');
|
||||
const { REST, Routes } = require('discord.js');
|
||||
const { token, clientId, systemServerGuildId } = require('./config.json');
|
||||
|
||||
@@ -16,15 +17,15 @@ const rest = new REST({ version: '10' }).setToken(token);
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
console.log('DEPLOYING SYSTEM SLASH COMMANDS');
|
||||
console.log(
|
||||
'System Commands: ',
|
||||
logger.info('DEPLOYING SYSTEM SLASH COMMANDS');
|
||||
logger.info(
|
||||
systemCommands.map((systemCommand) => {
|
||||
return systemCommand.name;
|
||||
})
|
||||
}),
|
||||
'System commands found:'
|
||||
);
|
||||
|
||||
console.log('Started refreshing application (/) system commands.');
|
||||
logger.info('Started refreshing application (/) system commands.');
|
||||
|
||||
await rest.put(
|
||||
Routes.applicationGuildCommands(clientId, systemServerGuildId),
|
||||
@@ -33,8 +34,11 @@ const rest = new REST({ version: '10' }).setToken(token);
|
||||
}
|
||||
);
|
||||
|
||||
console.log('Successfully reloaded application (/) system commands.');
|
||||
logger.info('Successfully refreshed application (/) system commands.');
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(
|
||||
error,
|
||||
'Failed to refresh application (/) system commands.'
|
||||
);
|
||||
}
|
||||
})();
|
||||
Reference in new issue
Block a user