mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 14:38:49 +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 fs = require('node:fs');
|
||||||
|
const logger = require('./services/logger.js');
|
||||||
const { REST, Routes } = require('discord.js');
|
const { REST, Routes } = require('discord.js');
|
||||||
const { token, clientId } = require('./config.json');
|
const { token, clientId } = require('./config.json');
|
||||||
|
|
||||||
@@ -16,22 +17,22 @@ const rest = new REST({ version: '10' }).setToken(token);
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
console.log('DEPLOYING BOT SLASH COMMANDS');
|
logger.info('DEPLOYING BOT SLASH COMMANDS');
|
||||||
console.log(
|
logger.info(
|
||||||
'Commands: ',
|
commands.map((commands) => {
|
||||||
commands.map((command) => {
|
return commands.name;
|
||||||
return command.name;
|
}),
|
||||||
})
|
'Bot commands found:'
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log('Started refreshing application (/) commands.');
|
logger.info('Started refreshing application (/) bot commands.');
|
||||||
|
|
||||||
await rest.put(Routes.applicationCommands(clientId), {
|
await rest.put(Routes.applicationCommands(clientId), {
|
||||||
body: commands
|
body: commands
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('Successfully reloaded application (/) commands.');
|
logger.info('Successfully refreshed application (/) bot commands.');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
logger.error(error, 'Failed to refresh application (/) bot commands.');
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
|
const logger = require('./services/logger.js');
|
||||||
const { REST, Routes } = require('discord.js');
|
const { REST, Routes } = require('discord.js');
|
||||||
const { token, clientId, systemServerGuildId } = require('./config.json');
|
const { token, clientId, systemServerGuildId } = require('./config.json');
|
||||||
|
|
||||||
@@ -16,15 +17,15 @@ const rest = new REST({ version: '10' }).setToken(token);
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
console.log('DEPLOYING SYSTEM SLASH COMMANDS');
|
logger.info('DEPLOYING SYSTEM SLASH COMMANDS');
|
||||||
console.log(
|
logger.info(
|
||||||
'System Commands: ',
|
|
||||||
systemCommands.map((systemCommand) => {
|
systemCommands.map((systemCommand) => {
|
||||||
return systemCommand.name;
|
return systemCommand.name;
|
||||||
})
|
}),
|
||||||
|
'System commands found:'
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log('Started refreshing application (/) system commands.');
|
logger.info('Started refreshing application (/) system commands.');
|
||||||
|
|
||||||
await rest.put(
|
await rest.put(
|
||||||
Routes.applicationGuildCommands(clientId, systemServerGuildId),
|
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) {
|
} catch (error) {
|
||||||
console.error(error);
|
logger.error(
|
||||||
|
error,
|
||||||
|
'Failed to refresh application (/) system commands.'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
Reference in new issue
Block a user