From 47f6333c6011e8f720dd91d5e78d5eb99be0f3c5 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Wed, 20 Mar 2024 00:04:07 -0400 Subject: [PATCH] Fix all awaitMessages --- commands/edit-image/yu-gi-oh-gen.js | 24 ++++++++++++------- commands/games-mp/apples-to-apples.js | 3 ++- commands/games-mp/bingo.js | 2 +- commands/games-mp/car-race.js | 12 ++++++---- commands/games-mp/cards-against-humanity.js | 3 ++- commands/games-mp/connect-four.js | 6 +++-- commands/games-mp/cram.js | 6 +++-- commands/games-mp/domineering.js | 6 +++-- commands/games-mp/dots-and-boxes.js | 3 ++- commands/games-mp/emoji-emoji-revolution.js | 3 ++- commands/games-mp/guesspionage.js | 6 +++-- commands/games-mp/gunfight.js | 3 ++- commands/games-mp/imposter.js | 6 +++-- commands/games-mp/island.js | 3 ++- commands/games-mp/jenga.js | 3 ++- commands/games-mp/lie-swatter.js | 3 ++- commands/games-mp/nim.js | 6 +++-- commands/games-mp/obstruction.js | 3 ++- commands/games-mp/pick-a-number.js | 6 +++-- commands/games-mp/poker.js | 2 +- commands/games-mp/quiz-duel.js | 3 ++- commands/games-mp/spam-war.js | 3 ++- commands/games-mp/tic-tac-toe.js | 3 ++- commands/games-mp/typing-race.js | 3 ++- commands/games-mp/word-chain.js | 3 ++- commands/games-mp/word-spud.js | 3 ++- commands/games-sp/20-questions.js | 3 ++- commands/games-sp/anagramica.js | 3 ++- commands/games-sp/anime-score.js | 3 ++- .../games-sp/antidepressant-or-tolkien.js | 3 ++- commands/games-sp/box-choosing.js | 3 ++- commands/games-sp/captcha.js | 3 ++- commands/games-sp/google-feud.js | 3 ++- commands/games-sp/guess-song.js | 3 ++- commands/games-sp/hangman.js | 3 ++- commands/games-sp/horse-race.js | 3 ++- commands/games-sp/jeopardy.js | 3 ++- commands/games-sp/mad-libs.js | 3 ++- commands/games-sp/math-quiz.js | 3 ++- commands/games-sp/memory.js | 3 ++- commands/games-sp/minesweeper.js | 3 ++- commands/games-sp/pokemon-advantage.js | 3 ++- commands/games-sp/quiz.js | 3 ++- commands/games-sp/reaction-time.js | 3 ++- commands/games-sp/sorting-hat.js | 3 ++- commands/games-sp/typing-test.js | 3 ++- commands/games-sp/whos-that-pokemon-cry.js | 3 ++- commands/games-sp/whos-that-pokemon.js | 3 ++- commands/games-sp/would-you-rather.js | 3 ++- 49 files changed, 130 insertions(+), 66 deletions(-) diff --git a/commands/edit-image/yu-gi-oh-gen.js b/commands/edit-image/yu-gi-oh-gen.js index 58df8e78..11b35859 100644 --- a/commands/edit-image/yu-gi-oh-gen.js +++ b/commands/edit-image/yu-gi-oh-gen.js @@ -171,7 +171,8 @@ module.exports = class YuGiOhGenCommand extends Command { if (res.author.id !== msg.author.id) return false; return res.content.toLowerCase() === 'cancel' || monsterTypes.includes(res.content.toLowerCase()); }; - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, max: 1, time: 60000 }); @@ -187,7 +188,8 @@ module.exports = class YuGiOhGenCommand extends Command { What name should your card have? Respond with \`cancel\` to cancel the command. The command will automatically be cancelled in 60 seconds. `); - const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages({ + filter: res => res.author.id === msg.author.id, max: 1, time: 60000 }); @@ -207,7 +209,8 @@ module.exports = class YuGiOhGenCommand extends Command { if (res.author.id !== msg.author.id) return false; return res.content.toLowerCase() === 'cancel' || atrs.includes(res.content.toLowerCase()); }; - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, max: 1, time: 60000 }); @@ -223,7 +226,8 @@ module.exports = class YuGiOhGenCommand extends Command { What type should your monster be? For example, "Dragon". Respond with \`cancel\` to cancel the command. The command will automatically be cancelled in 60 seconds. `); - const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages({ + filter: res => res.author.id === msg.author.id, max: 1, time: 60000 }); @@ -239,7 +243,8 @@ module.exports = class YuGiOhGenCommand extends Command { What effect should your card have? Respond with \`cancel\` to cancel the command. The command will automatically be cancelled in 60 seconds. `); - const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages({ + filter: res => res.author.id === msg.author.id, max: 1, time: 60000 }); @@ -261,7 +266,8 @@ module.exports = class YuGiOhGenCommand extends Command { const int = Number.parseInt(res.content, 10); return int >= 0 && int <= 12; }; - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, max: 1, time: 60000 }); @@ -283,7 +289,8 @@ module.exports = class YuGiOhGenCommand extends Command { const int = Number.parseInt(res.content, 10); return int >= 0 && int <= 9999; }; - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, max: 1, time: 60000 }); @@ -312,7 +319,8 @@ module.exports = class YuGiOhGenCommand extends Command { const int = Number.parseInt(res.content, 10); return int >= 0 && int <= (monsterType === 'link' ? 8 : 9999); }; - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, max: 1, time: 60000 }); diff --git a/commands/games-mp/apples-to-apples.js b/commands/games-mp/apples-to-apples.js index 5b7d96d4..7c65d25b 100644 --- a/commands/games-mp/apples-to-apples.js +++ b/commands/games-mp/apples-to-apples.js @@ -96,7 +96,8 @@ module.exports = class ApplesToApplesCommand extends Command { if (!cards[Number.parseInt(res.content, 10) - 1]) return false; return true; }; - const chosen = await msg.channel.awaitMessages(filter, { + const chosen = await msg.channel.awaitMessages({ + filter, max: 1, time: 120000 }); diff --git a/commands/games-mp/bingo.js b/commands/games-mp/bingo.js index 87257f0b..061144de 100644 --- a/commands/games-mp/bingo.js +++ b/commands/games-mp/bingo.js @@ -84,7 +84,7 @@ module.exports = class BingoCommand extends Command { } return true; }; - const bingo = await msg.channel.awaitMessages(filter, { max: 1, time: 20000 }); + const bingo = await msg.channel.awaitMessages({ filter, max: 1, time: 20000 }); if (!players.size) { winner = 0; break; diff --git a/commands/games-mp/car-race.js b/commands/games-mp/car-race.js index 05a161f8..1163e858 100644 --- a/commands/games-mp/car-race.js +++ b/commands/games-mp/car-race.js @@ -380,7 +380,8 @@ module.exports = class CarRaceCommand extends Command { if (res.author.id !== msg.author.id) return false; return Object.keys(difficulties).includes(res.content.toLowerCase()); }; - const difficultyPick = await msg.channel.awaitMessages(difficultyFilter, { + const difficultyPick = await msg.channel.awaitMessages({ + filter: difficultyFilter, max: 1, time: 30000 }); @@ -405,7 +406,8 @@ module.exports = class CarRaceCommand extends Command { if (res.author.id !== opponent.id) return false; return available.includes(res.content.toLowerCase()); }; - const p2Car = await msg.channel.awaitMessages(filter, { + const p2Car = await msg.channel.awaitMessages({ + filter, max: 1, time: 30000 }); @@ -448,7 +450,8 @@ module.exports = class CarRaceCommand extends Command { if (![opponent.id, msg.author.id].includes(res.author.id)) return false; return res.content.toLowerCase() === 'end'; }; - const earlyEnd = await msg.channel.awaitMessages(earlyFilter, { + const earlyEnd = await msg.channel.awaitMessages({ + filter: earlyFilter, max: 1, time: randomRange(1000, 30000) }); @@ -464,7 +467,8 @@ module.exports = class CarRaceCommand extends Command { if (res.content.toLowerCase() === 'end') return true; return res.content.toLowerCase() === word; }; - const winner = await msg.channel.awaitMessages(turnFilter, { + const winner = await msg.channel.awaitMessages({ + filter: turnFilter, max: 1, time: opponent.bot ? difficulties[difficulty] : 30000 }); diff --git a/commands/games-mp/cards-against-humanity.js b/commands/games-mp/cards-against-humanity.js index c5ecb5d8..cb7acb8c 100644 --- a/commands/games-mp/cards-against-humanity.js +++ b/commands/games-mp/cards-against-humanity.js @@ -96,7 +96,8 @@ module.exports = class CardsAgainstHumanityCommand extends Command { if (!cards[Number.parseInt(res.content, 10) - 1]) return false; return true; }; - const chosen = await msg.channel.awaitMessages(filter, { + const chosen = await msg.channel.awaitMessages({ + filter, max: 1, time: 120000 }); diff --git a/commands/games-mp/connect-four.js b/commands/games-mp/connect-four.js index 681ddcec..7210d403 100644 --- a/commands/games-mp/connect-four.js +++ b/commands/games-mp/connect-four.js @@ -88,7 +88,8 @@ module.exports = class ConnectFourCommand extends Command { if (hasCustom && msg.guild && !msg.guild.emojis.cache.has(hasCustom[2])) return false; return (hasCustom && msg.guild) || hasEmoji || available.includes(res.content.toLowerCase()); }; - const p2Color = await msg.channel.awaitMessages(filter, { + const p2Color = await msg.channel.awaitMessages({ + filter, max: 1, time: 30000 }); @@ -133,7 +134,8 @@ module.exports = class ConnectFourCommand extends Command { const j = Number.parseInt(choice, 10) - 1; return board[colLevels[j]] && board[colLevels[j]][j] !== undefined; }; - const turn = await msg.channel.awaitMessages(pickFilter, { + const turn = await msg.channel.awaitMessages({ + filter: pickFilter, max: 1, time: 60000 }); diff --git a/commands/games-mp/cram.js b/commands/games-mp/cram.js index 4ae8640c..da15481f 100644 --- a/commands/games-mp/cram.js +++ b/commands/games-mp/cram.js @@ -62,7 +62,8 @@ module.exports = class CramCommand extends Command { if (res.author.id !== opponent.id) return false; return available.includes(res.content.toLowerCase()); }; - const p2Color = await msg.channel.awaitMessages(filter, { + const p2Color = await msg.channel.awaitMessages({ + filter, max: 1, time: 30000 }); @@ -93,7 +94,8 @@ module.exports = class CramCommand extends Command { if (!possibleMoves.includes(`${direction}${x - 1},${y - 1}`)) return false; return true; }; - const turn = await msg.channel.awaitMessages(colorFilter, { + const turn = await msg.channel.awaitMessages({ + filter: colorFilter, max: 1, time: 60000 }); diff --git a/commands/games-mp/domineering.js b/commands/games-mp/domineering.js index 0542fdda..3a3af089 100644 --- a/commands/games-mp/domineering.js +++ b/commands/games-mp/domineering.js @@ -62,7 +62,8 @@ module.exports = class DomineeringCommand extends Command { if (res.author.id !== opponent.id) return false; return available.includes(res.content.toLowerCase()); }; - const p2Color = await msg.channel.awaitMessages(filter, { + const p2Color = await msg.channel.awaitMessages({ + filter, max: 1, time: 30000 }); @@ -92,7 +93,8 @@ module.exports = class DomineeringCommand extends Command { if (!possibleMoves.includes(`${x - 1},${y - 1}`)) return false; return true; }; - const turn = await msg.channel.awaitMessages(colorFilter, { + const turn = await msg.channel.awaitMessages({ + filter: colorFilter, max: 1, time: 60000 }); diff --git a/commands/games-mp/dots-and-boxes.js b/commands/games-mp/dots-and-boxes.js index c43d669d..b7090c4a 100644 --- a/commands/games-mp/dots-and-boxes.js +++ b/commands/games-mp/dots-and-boxes.js @@ -79,7 +79,8 @@ module.exports = class DotsAndBoxesCommand extends Command { } return !taken.includes(`${first}-${second}`); }; - const turn = await msg.channel.awaitMessages(filter, { + const turn = await msg.channel.awaitMessages({ + filter, max: 1, time: 60000 }); diff --git a/commands/games-mp/emoji-emoji-revolution.js b/commands/games-mp/emoji-emoji-revolution.js index abccd5e1..f627a502 100644 --- a/commands/games-mp/emoji-emoji-revolution.js +++ b/commands/games-mp/emoji-emoji-revolution.js @@ -54,7 +54,8 @@ module.exports = class EmojiEmojiRevolutionCommand extends Command { const emoji = [emojis[num], emojisNew[num]]; await msg.say(emojisNew[num]); const filter = res => [msg.author.id, opponent.id].includes(res.author.id) && emoji.includes(res.content); - const win = await msg.channel.awaitMessages(filter, { + const win = await msg.channel.awaitMessages({ + filter, max: 1, time: 30000 }); diff --git a/commands/games-mp/guesspionage.js b/commands/games-mp/guesspionage.js index c0bddd2c..ff8b75f8 100644 --- a/commands/games-mp/guesspionage.js +++ b/commands/games-mp/guesspionage.js @@ -90,7 +90,8 @@ module.exports = class GuesspionageCommand extends Command { const int = Number.parseInt(res.content, 10); return int >= 0 && int <= 100; }; - const initialGuess = await msg.channel.awaitMessages(initialGuessFilter, { + const initialGuess = await msg.channel.awaitMessages({ + filter: initialGuessFilter, max: 1, time: 30000 }); @@ -115,7 +116,8 @@ module.exports = class GuesspionageCommand extends Command { reactIfAble(res, res.author, SUCCESS_EMOJI_ID, '✅'); return true; }; - const everyoneElse = await msg.channel.awaitMessages(everyoneElseFilter, { + const everyoneElse = await msg.channel.awaitMessages({ + filter: everyoneElseFilter, max: awaitedPlayers.length - 1, time: 30000 }); diff --git a/commands/games-mp/gunfight.js b/commands/games-mp/gunfight.js index 2920a5a1..4f785a14 100644 --- a/commands/games-mp/gunfight.js +++ b/commands/games-mp/gunfight.js @@ -42,7 +42,8 @@ module.exports = class GunfightCommand extends Command { await msg.say(`TYPE \`${word.toUpperCase()}\` NOW!`); const filter = res => [opponent.id, msg.author.id].includes(res.author.id) && res.content.toLowerCase() === word; const now = Date.now(); - const winner = await msg.channel.awaitMessages(filter, { + const winner = await msg.channel.awaitMessages({ + filter, max: 1, time: 30000 }); diff --git a/commands/games-mp/imposter.js b/commands/games-mp/imposter.js index d29c9ccb..8127004c 100644 --- a/commands/games-mp/imposter.js +++ b/commands/games-mp/imposter.js @@ -71,7 +71,8 @@ module.exports = class ImposterCommand extends Command { if (res.content && wordRegex.test(res.content)) return true; return false; }; - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, max: 1, time: 600000 }); @@ -119,7 +120,8 @@ module.exports = class ImposterCommand extends Command { } return false; }; - const vote = await msg.channel.awaitMessages(voteFilter, { + const vote = await msg.channel.awaitMessages({ + filter: voteFilter, max: players.filter(player => !player.killed).size, time: 60000 }); diff --git a/commands/games-mp/island.js b/commands/games-mp/island.js index d7d88483..54c10ef5 100644 --- a/commands/games-mp/island.js +++ b/commands/games-mp/island.js @@ -82,7 +82,8 @@ module.exports = class IslandCommand extends Command { } return false; }; - const vote = await msg.channel.awaitMessages(voteFilter, { + const vote = await msg.channel.awaitMessages({ + filter: voteFilter, max: playersLeft.size, time: 60000 }); diff --git a/commands/games-mp/jenga.js b/commands/games-mp/jenga.js index dbe94d40..048fb0c5 100644 --- a/commands/games-mp/jenga.js +++ b/commands/games-mp/jenga.js @@ -65,7 +65,8 @@ module.exports = class JengaCommand extends Command { const j = Number.parseInt(choice, 10) - 1; return board[j]; }; - const turn = await msg.channel.awaitMessages(pickFilter, { + const turn = await msg.channel.awaitMessages({ + filter: pickFilter, max: 1, time: 60000 }); diff --git a/commands/games-mp/lie-swatter.js b/commands/games-mp/lie-swatter.js index aba589e4..9dfee866 100644 --- a/commands/games-mp/lie-swatter.js +++ b/commands/games-mp/lie-swatter.js @@ -76,7 +76,8 @@ module.exports = class LieSwatterCommand extends Command { } return false; }; - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, max: pts.size, time: 30000 }); diff --git a/commands/games-mp/nim.js b/commands/games-mp/nim.js index fb916265..f0ba4306 100644 --- a/commands/games-mp/nim.js +++ b/commands/games-mp/nim.js @@ -71,7 +71,8 @@ module.exports = class NimCommand extends Command { const i = Number.parseInt(choice, 10) - 1; return board[i] && board[i] > 0; }; - const turn = await msg.channel.awaitMessages(pickFilter, { + const turn = await msg.channel.awaitMessages({ + filter: pickFilter, max: 1, time: 60000 }); @@ -110,7 +111,8 @@ module.exports = class NimCommand extends Command { const i = Number.parseInt(chosen, 10); return i <= row && i > 0; }; - const rowTurn = await msg.channel.awaitMessages(rowFilter, { + const rowTurn = await msg.channel.awaitMessages({ + filter: rowFilter, max: 1, time: 60000 }); diff --git a/commands/games-mp/obstruction.js b/commands/games-mp/obstruction.js index 7061ef8a..a33e15eb 100644 --- a/commands/games-mp/obstruction.js +++ b/commands/games-mp/obstruction.js @@ -74,7 +74,8 @@ module.exports = class ObstructionCommand extends Command { if (!possibleMoves.includes(`${x - 1},${y - 1}`)) return false; return true; }; - const turn = await msg.channel.awaitMessages(turnFilter, { + const turn = await msg.channel.awaitMessages({ + filter: turnFilter, max: 1, time: 60000 }); diff --git a/commands/games-mp/pick-a-number.js b/commands/games-mp/pick-a-number.js index 8abf7bc8..520ea2ae 100644 --- a/commands/games-mp/pick-a-number.js +++ b/commands/games-mp/pick-a-number.js @@ -45,7 +45,8 @@ module.exports = class PickANumberCommand extends Command { if (!userTurn && num === player1Pick) return false; return num && nums.includes(num); }; - const player1 = await msg.channel.awaitMessages(filter, { + const player1 = await msg.channel.awaitMessages({ + filter, max: 1, time: 30000 }); @@ -62,7 +63,8 @@ module.exports = class PickANumberCommand extends Command { } else { userTurn = false; await msg.say(`${opponent}, pick a number from 1 to 10, except ${player1Pick}.`); - const player2 = await msg.channel.awaitMessages(filter, { + const player2 = await msg.channel.awaitMessages({ + filter, max: 1, time: 30000 }); diff --git a/commands/games-mp/poker.js b/commands/games-mp/poker.js index 0bf72853..0c74ff3a 100644 --- a/commands/games-mp/poker.js +++ b/commands/games-mp/poker.js @@ -275,7 +275,7 @@ module.exports = class PokerCommand extends Command { } return false; }; - const msgs = await msg.channel.awaitMessages(filter, { max: 1, time: 60000 }); + const msgs = await msg.channel.awaitMessages({ filter, max: 1, time: 60000 }); let choiceAction; if (msgs.size) { choiceAction = msgs.first().content.toLowerCase().replace(/[$,]/g, ''); diff --git a/commands/games-mp/quiz-duel.js b/commands/games-mp/quiz-duel.js index 511c4150..c5dd8c4b 100644 --- a/commands/games-mp/quiz-duel.js +++ b/commands/games-mp/quiz-duel.js @@ -69,7 +69,8 @@ module.exports = class QuizDuelCommand extends Command { } return false; }; - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, max: pts.size, time: 30000 }); diff --git a/commands/games-mp/spam-war.js b/commands/games-mp/spam-war.js index 6a9d5539..618f5930 100644 --- a/commands/games-mp/spam-war.js +++ b/commands/games-mp/spam-war.js @@ -37,7 +37,8 @@ module.exports = class SpamWarCommand extends Command { await msg.say('You get one point per character in your messages. You get 1 minute to spam.'); await delay(5000); await msg.say('You have **1 minute** to spam. Go!'); - const msgs = await msg.channel.awaitMessages(res => [opponent.id, msg.author.id].includes(res.author.id), { + const msgs = await msg.channel.awaitMessages({ + filter: res => [opponent.id, msg.author.id].includes(res.author.id), time: 60000 }); const authorMsgs = msgs diff --git a/commands/games-mp/tic-tac-toe.js b/commands/games-mp/tic-tac-toe.js index 8a674d6d..0673a078 100644 --- a/commands/games-mp/tic-tac-toe.js +++ b/commands/games-mp/tic-tac-toe.js @@ -60,7 +60,8 @@ module.exports = class TicTacToeCommand extends Command { if (pick.toLowerCase() === 'end') return true; return sides.includes(pick) && !taken.includes(pick); }; - const turn = await msg.channel.awaitMessages(filter, { + const turn = await msg.channel.awaitMessages({ + filter, max: 1, time: 30000 }); diff --git a/commands/games-mp/typing-race.js b/commands/games-mp/typing-race.js index a61a6ca4..b57051e5 100644 --- a/commands/games-mp/typing-race.js +++ b/commands/games-mp/typing-race.js @@ -44,7 +44,8 @@ module.exports = class TypingRaceCommand extends Command { if (![opponent.id, msg.author.id].includes(res.author.id)) return false; return res.content.toLowerCase() === sentence; }; - const winner = await msg.channel.awaitMessages(filter, { + const winner = await msg.channel.awaitMessages({ + filter, max: 1, time: 30000 }); diff --git a/commands/games-mp/word-chain.js b/commands/games-mp/word-chain.js index 19b077f6..e2cfc3dc 100644 --- a/commands/games-mp/word-chain.js +++ b/commands/games-mp/word-chain.js @@ -72,7 +72,8 @@ module.exports = class WordChainCommand extends Command { await msg.say(`It's ${player}'s turn! The letter is **${letter}**.`); const filter = res => res.author.id === player.id && /^[a-zA-Z']+$/i.test(res.content) && res.content.length < 50; - const wordChoice = await msg.channel.awaitMessages(filter, { + const wordChoice = await msg.channel.awaitMessages({ + filter, max: 1, time: time * 1000 }); diff --git a/commands/games-mp/word-spud.js b/commands/games-mp/word-spud.js index 7c7a52b4..a89a1eed 100644 --- a/commands/games-mp/word-spud.js +++ b/commands/games-mp/word-spud.js @@ -54,7 +54,8 @@ module.exports = class WordSpudCommand extends Command { _Type \`end\` to end the game._ `); const filter = res => res.author.id === player.id && res.content.length <= 100; - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, max: 1, time: 30000 }); diff --git a/commands/games-sp/20-questions.js b/commands/games-sp/20-questions.js index 7c18350f..74216280 100644 --- a/commands/games-sp/20-questions.js +++ b/commands/games-sp/20-questions.js @@ -48,7 +48,8 @@ module.exports = class TwentyQuestionsCommand extends Command { ${question.answers.map(answer => answer.text).join(' | ')} | End `); const filter = res => res.author.id === msg.author.id && answers.includes(res.content.toLowerCase()); - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, max: 1, time: 30000 }); diff --git a/commands/games-sp/anagramica.js b/commands/games-sp/anagramica.js index 258c24d6..4069f6cb 100644 --- a/commands/games-sp/anagramica.js +++ b/commands/games-sp/anagramica.js @@ -70,7 +70,8 @@ module.exports = class AnagramicaCommand extends Command { reactIfAble(res, res.author, SUCCESS_EMOJI_ID, '✅'); return true; }; - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, time: time * 1000 }); const highScoreGet = await this.client.redis.get('anagramica'); diff --git a/commands/games-sp/anime-score.js b/commands/games-sp/anime-score.js index 0aee7e5d..b028919a 100644 --- a/commands/games-sp/anime-score.js +++ b/commands/games-sp/anime-score.js @@ -70,7 +70,8 @@ module.exports = class AnimeScoreCommand extends Command { if (res.author.id !== msg.author.id) return false; return Boolean(Number.parseInt(res.content, 10)); }; - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, max: 1, time: 15000 }); diff --git a/commands/games-sp/antidepressant-or-tolkien.js b/commands/games-sp/antidepressant-or-tolkien.js index aca2cbac..e09411bd 100644 --- a/commands/games-sp/antidepressant-or-tolkien.js +++ b/commands/games-sp/antidepressant-or-tolkien.js @@ -48,7 +48,8 @@ module.exports = class AntidepressantOrTolkienCommand extends Command { if (drugResponses.includes(choice) || tolkienResponses.includes(choice)) return true; return false; }; - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, max: 1, time: 15000 }); diff --git a/commands/games-sp/box-choosing.js b/commands/games-sp/box-choosing.js index f1c450a4..22407f77 100644 --- a/commands/games-sp/box-choosing.js +++ b/commands/games-sp/box-choosing.js @@ -51,7 +51,8 @@ module.exports = class BoxChoosingCommand extends Command { `); if (line.options) { const filter = res => res.author.id === msg.author.id && line.options.includes(res.content.toLowerCase()); - const choose = await msg.channel.awaitMessages(filter, { + const choose = await msg.channel.awaitMessages({ + filter, max: 1, time: 120000 }); diff --git a/commands/games-sp/captcha.js b/commands/games-sp/captcha.js index d20408a9..7d882f24 100644 --- a/commands/games-sp/captcha.js +++ b/commands/games-sp/captcha.js @@ -41,7 +41,8 @@ module.exports = class CaptchaCommand extends Command { '**You have 15 seconds, what does the captcha say?**', { files: [{ attachment: canvas.toBuffer(), name: 'captcha-quiz.png' }] } ); - const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages({ + filter: res => res.author.id === msg.author.id, max: 1, time: 15000 }); diff --git a/commands/games-sp/google-feud.js b/commands/games-sp/google-feud.js index e8cf4f5c..33aca71a 100644 --- a/commands/games-sp/google-feud.js +++ b/commands/games-sp/google-feud.js @@ -52,7 +52,8 @@ module.exports = class GoogleFeudCommand extends Command { while (display.includes('???') && tries) { const embed = this.makeEmbed(question, tries, suggestions, display); await msg.embed(embed); - const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages({ + filter: res => res.author.id === msg.author.id, max: 1, time: 30000 }); diff --git a/commands/games-sp/guess-song.js b/commands/games-sp/guess-song.js index bbae4830..352b524e 100644 --- a/commands/games-sp/guess-song.js +++ b/commands/games-sp/guess-song.js @@ -72,7 +72,8 @@ module.exports = class GuessSongCommand extends Command { dispatcher.once('error', () => this.client.dispatchers.delete(msg.guild.id)); await reactIfAble(msg, this.client.user, '🔉'); await msg.reply('**You have 30 seconds, what song is this?**'); - const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages({ + filter: res => res.author.id === msg.author.id, max: 1, time: 30000 }); diff --git a/commands/games-sp/hangman.js b/commands/games-sp/hangman.js index fc3eca3d..9a1f1e22 100644 --- a/commands/games-sp/hangman.js +++ b/commands/games-sp/hangman.js @@ -58,7 +58,8 @@ module.exports = class HangmanCommand extends Command { const choice = res.content.toLowerCase(); return res.author.id === msg.author.id && !confirmation.includes(choice) && !incorrect.includes(choice); }; - const guess = await msg.channel.awaitMessages(filter, { + const guess = await msg.channel.awaitMessages({ + filter, max: 1, time: 30000 }); diff --git a/commands/games-sp/horse-race.js b/commands/games-sp/horse-race.js index 33ef4b00..f21edc3c 100644 --- a/commands/games-sp/horse-race.js +++ b/commands/games-sp/horse-race.js @@ -68,7 +68,8 @@ module.exports = class HorseRaceCommand extends Command { if (!num) return false; return num > 0 && num <= chosenHorses.length; }; - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, max: 1, time: 30000 }); diff --git a/commands/games-sp/jeopardy.js b/commands/games-sp/jeopardy.js index cda40e37..1a3ecedb 100644 --- a/commands/games-sp/jeopardy.js +++ b/commands/games-sp/jeopardy.js @@ -58,7 +58,8 @@ module.exports = class JeopardyCommand extends Command { await msg.reply(`${category ? `The category is: **${category}**. ` : ''}30 seconds, good luck.`, { files: [{ attachment: clueCard, name: 'clue-card.png' }] }); - const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages({ + filter: res => res.author.id === msg.author.id, max: 1, time: 30000 }); diff --git a/commands/games-sp/mad-libs.js b/commands/games-sp/mad-libs.js index a1eab23d..34173e08 100644 --- a/commands/games-sp/mad-libs.js +++ b/commands/games-sp/mad-libs.js @@ -41,7 +41,8 @@ module.exports = class MadLibsCommand extends Command { } return true; }; - const choice = await msg.channel.awaitMessages(filter, { + const choice = await msg.channel.awaitMessages({ + filter, max: 1, time: 120000 }); diff --git a/commands/games-sp/math-quiz.js b/commands/games-sp/math-quiz.js index 0b7f8991..3e87022b 100644 --- a/commands/games-sp/math-quiz.js +++ b/commands/games-sp/math-quiz.js @@ -66,7 +66,8 @@ module.exports = class MathQuizCommand extends Command { **You have 10 seconds to answer this question.** ${value1} ${operation} ${value2} `); - const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages({ + filter: res => res.author.id === msg.author.id, max: 1, time: 10000 }); diff --git a/commands/games-sp/memory.js b/commands/games-sp/memory.js index c8bf497c..37a804b5 100644 --- a/commands/games-sp/memory.js +++ b/commands/games-sp/memory.js @@ -38,7 +38,8 @@ module.exports = class MemoryCommand extends Command { await delay(10000); await memorizeMsg.edit('Type what you saw. Don\'t worry about formatting, just the words.'); const memorizeType = memorize.join(' '); - const msgs = await msg.channel.awaitMessages(res => msg.author.id === res.author.id, { + const msgs = await msg.channel.awaitMessages({ + filter: res => msg.author.id === res.author.id, max: 1, time: 30000 }); diff --git a/commands/games-sp/minesweeper.js b/commands/games-sp/minesweeper.js index 5c5ccf61..f5cbd830 100644 --- a/commands/games-sp/minesweeper.js +++ b/commands/games-sp/minesweeper.js @@ -64,7 +64,8 @@ module.exports = class MinesweeperCommand extends Command { if (game.mask[y - 1][x - 1]) return false; return true; }; - const turn = await msg.channel.awaitMessages(filter, { + const turn = await msg.channel.awaitMessages({ + filter, max: 1, time: 120000 }); diff --git a/commands/games-sp/pokemon-advantage.js b/commands/games-sp/pokemon-advantage.js index a34aad9b..8ea2549b 100644 --- a/commands/games-sp/pokemon-advantage.js +++ b/commands/games-sp/pokemon-advantage.js @@ -81,7 +81,8 @@ module.exports = class PokemonAdvantageCommand extends Command { **You have 15 seconds, who\'s got the type advantage?** _If the Pokémon are evenly matched, type \`even\`._ `, { files: [attachment] }); - const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages({ + filter: res => res.author.id === msg.author.id, max: 1, time: 15000 }); diff --git a/commands/games-sp/quiz.js b/commands/games-sp/quiz.js index c043cc96..430eb481 100644 --- a/commands/games-sp/quiz.js +++ b/commands/games-sp/quiz.js @@ -56,7 +56,8 @@ module.exports = class QuizCommand extends Command { ${shuffled.map((answer, i) => `**${choices[i]}.** ${answer}`).join('\n')} `); const filter = res => res.author.id === msg.author.id && choices.includes(res.content.toUpperCase()); - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, max: 1, time: 15000 }); diff --git a/commands/games-sp/reaction-time.js b/commands/games-sp/reaction-time.js index a0670300..583f2cb6 100644 --- a/commands/games-sp/reaction-time.js +++ b/commands/games-sp/reaction-time.js @@ -25,7 +25,8 @@ module.exports = class ReactionTimeCommand extends Command { await msg.say(`TYPE \`${word.toUpperCase()}\` NOW!`); const filter = res => msg.author.id === res.author.id && res.content.toLowerCase() === word; const now = Date.now(); - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, max: 1, time: 30000 }); diff --git a/commands/games-sp/sorting-hat.js b/commands/games-sp/sorting-hat.js index 4e2ebc9f..d5926b54 100644 --- a/commands/games-sp/sorting-hat.js +++ b/commands/games-sp/sorting-hat.js @@ -62,7 +62,8 @@ module.exports = class SortingHatCommand extends Command { `); const filter = res => res.author.id === msg.author.id && choices.slice(0, answers.length).includes(res.content.toUpperCase()); - const choice = await msg.channel.awaitMessages(filter, { + const choice = await msg.channel.awaitMessages({ + filter, max: 1, time: 120000 }); diff --git a/commands/games-sp/typing-test.js b/commands/games-sp/typing-test.js index d07c7277..1948f84f 100644 --- a/commands/games-sp/typing-test.js +++ b/commands/games-sp/typing-test.js @@ -21,7 +21,8 @@ module.exports = class TypingTestCommand extends Command { files: [{ attachment: this.generateImage(sentence), name: 'typing-test.png' }] }); const now = Date.now(); - const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages({ + filter: res => res.author.id === msg.author.id, max: 1, time: 30000 }); diff --git a/commands/games-sp/whos-that-pokemon-cry.js b/commands/games-sp/whos-that-pokemon-cry.js index 38854c5b..82197d16 100644 --- a/commands/games-sp/whos-that-pokemon-cry.js +++ b/commands/games-sp/whos-that-pokemon-cry.js @@ -97,7 +97,8 @@ module.exports = class WhosThatPokemonCryCommand extends Command { dispatcher.once('error', () => this.client.dispatchers.delete(msg.guild.id)); await reactIfAble(msg, this.client.user, '🔉'); await msg.reply('**You have 15 seconds, who\'s that Pokémon?**'); - const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages({ + filter: res => res.author.id === msg.author.id, max: 1, time: 15000 }); diff --git a/commands/games-sp/whos-that-pokemon.js b/commands/games-sp/whos-that-pokemon.js index fe45400f..0d5b3c1b 100644 --- a/commands/games-sp/whos-that-pokemon.js +++ b/commands/games-sp/whos-that-pokemon.js @@ -104,7 +104,8 @@ module.exports = class WhosThatPokemonCommand extends Command { await reactIfAble(msg, this.client.user, '🔉'); } await msg.reply('**You have 15 seconds, who\'s that Pokémon?**', { files: [attachment] }); - const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages({ + filter: res => res.author.id === msg.author.id, max: 1, time: 15000 }); diff --git a/commands/games-sp/would-you-rather.js b/commands/games-sp/would-you-rather.js index f9cef61b..1f4911a6 100644 --- a/commands/games-sp/would-you-rather.js +++ b/commands/games-sp/would-you-rather.js @@ -36,7 +36,8 @@ module.exports = class WouldYouRatherCommand extends Command { _Respond with either **1** or **2** to continue._ `); const filter = res => res.author.id === msg.author.id && choices.includes(res.content.toLowerCase()); - const msgs = await msg.channel.awaitMessages(filter, { + const msgs = await msg.channel.awaitMessages({ + filter, time: 30000, max: 1 });