mirror of
https://github.com/jcreek/denBot.git
synced 2026-07-13 02:43:46 +00:00
feat(*): Add working code to clear the queue
This commit is contained in:
@@ -16,6 +16,7 @@ client.once('ready', () =>{
|
|||||||
* q - Join the queue
|
* q - Join the queue
|
||||||
* lq - Leave the queue
|
* lq - Leave the queue
|
||||||
* sq - Show the queue
|
* sq - Show the queue
|
||||||
|
* cq - Clear the queue
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function generateRandomCode() {
|
function generateRandomCode() {
|
||||||
@@ -113,4 +114,20 @@ client.on('message', function (message) {
|
|||||||
message.delete();
|
message.delete();
|
||||||
checkQueue(message);
|
checkQueue(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clear the queue
|
||||||
|
if(command === 'cq') {
|
||||||
|
// Delete the message with the bot command
|
||||||
|
message.delete();
|
||||||
|
|
||||||
|
if (playerQueue.length === 0) {
|
||||||
|
message.channel.send(`The queue is already empty...`);
|
||||||
|
console.log(`${message.author.username} attmepted to clear the queue but it was already empty.`);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
rankedList = [];
|
||||||
|
message.channel.send(`The queue has been cleared!`);
|
||||||
|
console.log(`${message.author.username} cleared the queue.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user