improved messages and general cleanup
This commit is contained in:
14
dist/index.js
vendored
14
dist/index.js
vendored
@@ -24,6 +24,7 @@ const fs = __importStar(require("fs"));
|
||||
const api_1 = require("./api");
|
||||
const discord_1 = require("./discord");
|
||||
const queue_1 = require("./queue");
|
||||
const util_1 = require("./util");
|
||||
const CLIENT = new discord_js_1.Client({ intents: [discord_js_1.Intents.FLAGS.GUILDS] });
|
||||
//init logs with a timestamp
|
||||
console.log(new Date().toISOString() + '\n\n');
|
||||
@@ -53,17 +54,18 @@ CLIENT.on('interactionCreate', async (interaction) => {
|
||||
await (0, queue_1.readyQueue)(interaction);
|
||||
else if (interaction.commandName === 'cancel')
|
||||
await (0, queue_1.cancelQueue)(interaction);
|
||||
else if (interaction.commandName === 'queueinfo')
|
||||
await (0, queue_1.queueInfo)(interaction);
|
||||
else if (interaction.commandName === 'elo')
|
||||
else if (interaction.commandName === 'player')
|
||||
await (0, api_1.getPlayerInteraction)(interaction);
|
||||
}
|
||||
catch (e) {
|
||||
if (typeof e === 'string') {
|
||||
if (e instanceof util_1.errorMessage) {
|
||||
if (interaction.deferred || interaction.replied)
|
||||
interaction.editReply(e);
|
||||
interaction.editReply(e.msg);
|
||||
else
|
||||
interaction.reply(e);
|
||||
interaction.reply({
|
||||
content: e.msg,
|
||||
ephemeral: e.ephemeral
|
||||
});
|
||||
}
|
||||
else
|
||||
console.error(e);
|
||||
|
||||
Reference in New Issue
Block a user