Fix stuck game if sorting-hat runs out of time

This commit is contained in:
Dragon Fire
2019-06-16 13:39:20 -04:00
parent c387acfab4
commit a8beea127b
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -63,7 +63,10 @@ module.exports = class SortingHatCommand extends Command {
max: 1,
time: 120000
});
if (!choice.size) return msg.say('Oh no, you ran out of time! Too bad.');
if (!choice.size) {
this.client.games.delete(msg.channel.id);
return msg.say('Oh no, you ran out of time! Too bad.');
}
const answer = answers[choices.indexOf(choice.first().content.toUpperCase())];
for (const [house, amount] of Object.entries(answer.points)) points[house] += amount;
++turn;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "106.0.0",
"version": "106.0.1",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {