cleaned up queue file

This commit is contained in:
2022-01-31 13:18:58 -06:00
parent e719eaef95
commit ae7093ae1d
4 changed files with 202 additions and 199 deletions

View File

@@ -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);