mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 05:51:35 +02:00
Fix
This commit is contained in:
@@ -23,7 +23,8 @@ module.exports = class GoogleFeudCommand extends Command {
|
|||||||
const suggestions = await this.fetchSuggestions(question);
|
const suggestions = await this.fetchSuggestions(question);
|
||||||
const display = new Array(suggestions.length).fill('???');
|
const display = new Array(suggestions.length).fill('???');
|
||||||
let tries = 3;
|
let tries = 3;
|
||||||
while (display.includes('???') && tries) {
|
let win = false;
|
||||||
|
while (!win) {
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setColor(0x005AF0)
|
.setColor(0x005AF0)
|
||||||
.setTitle(`${question}...?`)
|
.setTitle(`${question}...?`)
|
||||||
@@ -47,9 +48,10 @@ module.exports = class GoogleFeudCommand extends Command {
|
|||||||
--tries;
|
--tries;
|
||||||
await msg.say(`Nope! ${tries} tries remaining!`);
|
await msg.say(`Nope! ${tries} tries remaining!`);
|
||||||
}
|
}
|
||||||
|
if (!display.includes('???')) win = true;
|
||||||
}
|
}
|
||||||
this.playing.delete(msg.channel.id);
|
this.playing.delete(msg.channel.id);
|
||||||
if (!tries) return msg.say('Better luck next time!');
|
if (!win) return msg.say('Better luck next time!');
|
||||||
return msg.say('You win! Nice job, master of Google!');
|
return msg.say('You win! Nice job, master of Google!');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.playing.delete(msg.channel.id);
|
this.playing.delete(msg.channel.id);
|
||||||
|
|||||||
Reference in New Issue
Block a user