mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-13 15:58:06 +02:00
End Bingo game if no one calls bingo
This commit is contained in:
@@ -48,6 +48,7 @@ module.exports = class BingoCommand extends Command {
|
||||
const called = ['FR'];
|
||||
while (!winner) {
|
||||
const validNums = callNums.filter(num => !called.includes(num));
|
||||
if (!validNums.length) break;
|
||||
const picked = validNums[Math.floor(Math.random() * validNums.length)];
|
||||
called.push(picked);
|
||||
for (const player of players.values()) {
|
||||
@@ -80,6 +81,7 @@ module.exports = class BingoCommand extends Command {
|
||||
winner = bingo.first().author;
|
||||
}
|
||||
this.client.games.delete(msg.channel.id);
|
||||
if (!winner) return msg.say('I called the entire board, but no one called bingo...');
|
||||
return msg.say(`Congrats, ${winner.user}!`);
|
||||
} catch (err) {
|
||||
this.client.games.delete(msg.channel.id);
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "116.9.3",
|
||||
"version": "116.9.4",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user