cleaned up queue file
This commit is contained in:
37
src/index.ts
37
src/index.ts
@@ -24,18 +24,31 @@ CLIENT.on('ready', client => {
|
||||
CLIENT.on('interactionCreate', async interaction => {
|
||||
if (!interaction.isCommand()) return;
|
||||
|
||||
if (interaction.commandName === 'queue')
|
||||
await createQueue(interaction);
|
||||
else if (interaction.commandName === 'join')
|
||||
await joinQueue(interaction);
|
||||
else if (interaction.commandName === 'leave')
|
||||
await leaveQueue(interaction);
|
||||
else if (interaction.commandName === 'ready')
|
||||
await readyQueue(interaction);
|
||||
else if (interaction.commandName === 'queueinfo')
|
||||
await queueInfo(interaction);
|
||||
else if (interaction.commandName === 'elo')
|
||||
await getPlayerInteraction(interaction);
|
||||
try {
|
||||
|
||||
if (interaction.commandName === 'queue')
|
||||
await createQueue(interaction);
|
||||
else if (interaction.commandName === 'join')
|
||||
await joinQueue(interaction);
|
||||
else if (interaction.commandName === 'leave')
|
||||
await leaveQueue(interaction);
|
||||
else if (interaction.commandName === 'ready')
|
||||
await readyQueue(interaction);
|
||||
else if (interaction.commandName === 'queueinfo')
|
||||
await queueInfo(interaction);
|
||||
else if (interaction.commandName === 'elo')
|
||||
await getPlayerInteraction(interaction);
|
||||
|
||||
} catch (e) {
|
||||
|
||||
if (typeof e === 'string') {
|
||||
if (interaction.deferred || interaction.replied)
|
||||
interaction.editReply(e);
|
||||
else
|
||||
interaction.reply(e);
|
||||
} else console.error(e);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
CLIENT.login(TOKEN);
|
||||
|
||||
Reference in New Issue
Block a user