mirror of
https://github.com/jcreek/denBot.git
synced 2026-07-13 10:53:45 +00:00
fix(*): Fix bug with blank pokemon name and captain ign fields showing
This commit is contained in:
@@ -69,7 +69,12 @@ function checkQueue(message) {
|
|||||||
// DM users
|
// DM users
|
||||||
const randomCode = generateRandomCode();
|
const randomCode = generateRandomCode();
|
||||||
playerQueue.forEach(player => {
|
playerQueue.forEach(player => {
|
||||||
client.users.cache.get(player.id).send(`${queueTitle}\nPokemon: ${pokemonName}\Captain's IGN: ${captainInGameName}\nHere is your link code ${randomCode} - @${playerQueue[0].username} is making the lobby, have fun!`);
|
if (pokemonName === '' && captainInGameName === '') {
|
||||||
|
client.users.cache.get(player.id).send(`${queueTitle}\nHere is your link code ${randomCode} - @${playerQueue[0].username} is making the lobby, have fun!`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
client.users.cache.get(player.id).send(`${queueTitle}\nPokemon: ${pokemonName}\nCaptain's IGN: ${captainInGameName}\nHere is your link code ${randomCode} - @${playerQueue[0].username} is making the lobby, have fun!`);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.log('error', error);
|
logger.log('error', error);
|
||||||
@@ -89,12 +94,11 @@ function checkQueue(message) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Show queue after adding
|
// Show queue after adding
|
||||||
|
if (pokemonName === '' && captainInGameName === '') {
|
||||||
if (pokemonName.length > 0 && captainInGameName.length > 0) {
|
message.channel.send(`${queueTitle}\n${playerQueue.map((player, index) => `${index + 1} - ${player.username}`).join('\n')}`);
|
||||||
message.channel.send(`${queueTitle}\nPokemon: ${pokemonName}\Captain's IGN: ${captainInGameName}\n${playerQueue.map((player, index) => `${index + 1} - ${player.username}`).join('\n')}`);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
message.channel.send(`${queueTitle}\n${playerQueue.map((player, index) => `${index + 1} - ${player.username}`).join('\n')}`);
|
message.channel.send(`${queueTitle}\nPokemon: ${pokemonName}\nCaptain's IGN: ${captainInGameName}\n${playerQueue.map((player, index) => `${index + 1} - ${player.username}`).join('\n')}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user