added cancel command

This commit is contained in:
2022-01-31 17:39:06 -06:00
parent 50c297bfea
commit f0283145dc
6 changed files with 115 additions and 22 deletions

View File

@@ -3,7 +3,7 @@ import { Client, Intents } from 'discord.js';
import * as fs from 'fs';
import { getPlayerInteraction } from './api';
import { registerCommands } from './discord';
import { createQueue, joinQueue, leaveQueue, queueInfo, readyQueue } from './queue';
import { cancelQueue, createQueue, joinQueue, leaveQueue, queueInfo, readyQueue } from './queue';
const CLIENT = new Client({ intents: [Intents.FLAGS.GUILDS] });
//init logs with a timestamp
@@ -37,6 +37,8 @@ CLIENT.on('interactionCreate', async interaction => {
await leaveQueue(interaction);
else if (interaction.commandName === 'ready')
await readyQueue(interaction);
else if (interaction.commandName === 'cancel')
await cancelQueue(interaction);
else if (interaction.commandName === 'queueinfo')
await queueInfo(interaction);
else if (interaction.commandName === 'elo')