diff --git a/commands/games-sp/google-feud.js b/commands/games-sp/google-feud.js index 9c7e7c5b..2c7fbffc 100644 --- a/commands/games-sp/google-feud.js +++ b/commands/games-sp/google-feud.js @@ -43,12 +43,7 @@ module.exports = class GoogleFeudCommand extends Command { const display = new Array(suggestions.length).fill('???'); let tries = 3; while (display.includes('???') && tries) { - const embed = new MessageEmbed() - .setColor(0x005AF0) - .setTitle(`${question}...?`) - .setDescription('Type the choice you think is a suggestion _without_ the question.') - .setFooter(`${tries} ${tries === 1 ? 'try' : 'tries'} remaining!`); - for (let i = 0; i < suggestions.length; i++) embed.addField(`❯ ${10000 - (i * 1000)}`, display[i], true); + 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, { max: 1, @@ -64,7 +59,8 @@ module.exports = class GoogleFeudCommand extends Command { } this.client.games.delete(msg.channel.id); if (!display.includes('???')) return msg.say('You win! Nice job, master of Google!'); - return msg.say('Better luck next time!'); + const final = this.makeEmbed(question, tries, suggestions, suggestions); + return msg.say('Better luck next time!', { embed: final }); } catch (err) { this.client.games.delete(msg.channel.id); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); @@ -83,4 +79,14 @@ module.exports = class GoogleFeudCommand extends Command { if (!suggestions.length) return null; return suggestions.map(suggestion => suggestion.toLowerCase().replace(question.toLowerCase(), '').trim()); } + + makeEmbed(question, tries, suggestions, display) { + const embed = new MessageEmbed() + .setColor(0x005AF0) + .setTitle(`${question}...?`) + .setDescription('Type the choice you think is a suggestion _without_ the question.') + .setFooter(`${tries} ${tries === 1 ? 'try' : 'tries'} remaining!`); + for (let i = 0; i < suggestions.length; i++) embed.addField(`❯ ${10000 - (i * 1000)}`, display[i], true); + return embed; + } }; diff --git a/package.json b/package.json index ec28910c..25551956 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "112.19.10", + "version": "112.19.11", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": { @@ -39,11 +39,11 @@ "common-tags": "^1.8.0", "custom-translate": "^2.2.8", "didyoumean2": "^4.0.0", - "discord.js": "^12.0.2", + "discord.js": "^12.1.1", "discord.js-commando": "github:discordjs/Commando", "dotenv": "^8.2.0", "gifencoder": "^2.0.1", - "mathjs": "^6.6.1", + "mathjs": "^6.6.2", "moment": "^2.24.0", "moment-duration-format": "^2.3.2", "moment-timezone": "^0.5.28",