2 Commits

+23 -17
View File
@@ -136,9 +136,11 @@ function checkQueue(message) {
makeTempChannel(message, adventureMessage);
// Clear the queue
// Clear the queue and votes
playerQueue = [];
logger.log('info', 'Emptied queue');
playerVotes = [];
logger.log('info', 'Emptied votes');
}
else if (playerQueue.length === 0) {
message.channel.send('The queue is empty :(');
@@ -328,6 +330,9 @@ client.on('message', function (message) {
if(playerQueue.length == 0) {
message.channel.send(`You can only vote to start an adventure early if there is a queue. You can start a queue by using the command ${config.prefix}help`);
}
else if (!playerQueue.includes(message.author)) {
message.channel.send(`You can only vote to start an adventure early if you are in the queue. You can join the queue by using the command ${config.prefix}q`);
}
else if(playerVotes.length == 0) {
// First player to vote
playerVotes.push(message.author);
@@ -377,10 +382,11 @@ client.on('message', function (message) {
message.channel.send(`The queue is already empty...`);
logger.log('info', `${message.author.username} attempted to clear the queue but it was already empty.`);
}
else {
else {
playerQueue = [];
playerVotes = [];
message.channel.send(`The queue has been cleared!`);
logger.log('info', `${message.author.username} cleared the queue.`);
logger.log('info', `${message.author.username} cleared the queue and the votes.`);
}
}
@@ -440,12 +446,12 @@ client.on('message', function (message) {
if (command === 'help') {
let msg = `
The commands available to you are:
- ${command}q - Join the queue
- ${command}q <pokemon> <ign> - Join the queue (first player can set the pokemon and their in-game name)
- ${command}lq - Leave the queue
- ${command}sq - Show the queue
- ${command}start - Vote to start the adventure early, without the full number of players (all players in the queue must use this to start early)
- ${command}dc - Delete an adventure channel (only the captain can use this)
- ${config.prefix}q - Join the queue
- ${config.prefix}q <pokemon> <ign> - Join the queue (first player can set the pokemon and their in-game name)
- ${config.prefix}lq - Leave the queue
- ${config.prefix}sq - Show the queue
- ${config.prefix}start - Vote to start the adventure early, without the full number of players (all players in the queue must use this to start early)
- ${config.prefix}dc - Delete an adventure channel (only the captain can use this)
`;
message.channel.send(msg);
@@ -454,14 +460,14 @@ The commands available to you are:
if (command === 'adminhelp') {
let msg = `
The commands available to you are:
- ${command}q - Join the queue
- ${command}q <pokemon> <ign> - Join the queue (first player can set the pokemon and their in-game name)
- ${command}lq - Leave the queue
- ${command}sq - Show the queue
- ${command}start - Vote to start the adventure early, without the full number of players (all players in the queue must use this to start early)
- ${command}cq - Clear the queue (admin-only, not to be shared with normal users)
- ${command}ru - Remove a tagged user from the queue (admin-only, not to be shared with normal users)
- ${command}dc - Delete an adventure channel (only the captain can use this)
- ${config.prefix}q - Join the queue
- ${config.prefix}q <pokemon> <ign> - Join the queue (first player can set the pokemon and their in-game name)
- ${config.prefix}lq - Leave the queue
- ${config.prefix}sq - Show the queue
- ${config.prefix}start - Vote to start the adventure early, without the full number of players (all players in the queue must use this to start early)
- ${config.prefix}cq - Clear the queue (admin-only, not to be shared with normal users)
- ${config.prefix}ru - Remove a tagged user from the queue (admin-only, not to be shared with normal users)
- ${config.prefix}dc - Delete an adventure channel (only the captain can use this)
`;
message.channel.send(msg);