diff --git a/commands/games/akinator.js b/commands/games/akinator.js index 1bfaaa7e..b7aa310b 100644 --- a/commands/games/akinator.js +++ b/commands/games/akinator.js @@ -42,15 +42,14 @@ module.exports = class AkinatorCommand extends Command { break; } if (msgs.first().content.toLowerCase() === 'end') break; - ans = answers.indexOf(msgs.first().content.toLowerCase()); + ans = answers.indexOf(msgs.first().content.toLowerCase().replace(/(‘|’)/g, '\'')); } const guess = await this.finish(msg.channel); const embed = new MessageEmbed() .setColor(0xF78B26) .setTitle(`I'm ${Math.round(guess.proba * 100)}% sure it's...`) .setDescription(stripIndents` - ${guess.name} - _${guess.description}_ + ${guess.name}${guess.description ? `\n_${guess.description}_` : ''} `) .setThumbnail(guess.absolute_picture_path); await msg.embed(embed); diff --git a/commands/games/battle.js b/commands/games/battle.js index 74e69d22..c9a4f1e5 100644 --- a/commands/games/battle.js +++ b/commands/games/battle.js @@ -67,7 +67,7 @@ module.exports = class BattleCommand extends Command { time: 30000 }); if (!turn.size) { - await msg.say('Time!'); + await msg.say('Sorry, time is up!'); reset(); continue; } diff --git a/commands/games/hangman.js b/commands/games/hangman.js index 5d86607d..eefc135c 100644 --- a/commands/games/hangman.js +++ b/commands/games/hangman.js @@ -29,7 +29,7 @@ module.exports = class HangmanCommand extends Command { const display = '_'.repeat(word.length).split(''); while (word.length !== confirmation.length && points < 7) { await msg.say(stripIndents` - The word is: \`${display.join(' ')}\`. Which letter do you choose? + \`${display.join(' ')}\`. Which letter do you choose? \`\`\` ___________ | | @@ -44,7 +44,7 @@ module.exports = class HangmanCommand extends Command { time: 30000 }); if (!guess.size) { - await msg.say('Time!'); + await msg.say('Sorry, time is up!'); break; } const choice = guess.first().content.toLowerCase(); diff --git a/commands/games/math-game.js b/commands/games/math-game.js index 5ea1bb00..8253aa74 100644 --- a/commands/games/math-game.js +++ b/commands/games/math-game.js @@ -52,7 +52,7 @@ module.exports = class MathGameCommand extends Command { max: 1, time: 10000 }); - if (!msgs.size) return msg.say(`Time! It was ${answer}, sorry!`); + if (!msgs.size) return msg.say(`Sorry, time is up! It was ${answer}.`); if (msgs.first().content !== answer.toString()) return msg.say(`Nope, sorry, it's ${answer}.`); return msg.say('Nice job! 10/10! You deserve some cake!'); } diff --git a/commands/games/quiz.js b/commands/games/quiz.js index 4a0522d6..affd3569 100644 --- a/commands/games/quiz.js +++ b/commands/games/quiz.js @@ -63,7 +63,7 @@ module.exports = class QuizCommand extends Command { max: 1, time: 15000 }); - if (!msgs.size) return msg.say(`Time! It was ${correct}, sorry!`); + if (!msgs.size) return msg.say(`Sorry, time is up! It was ${correct}.`); if (msgs.first().content.toLowerCase() !== correct) return msg.say(`Nope, sorry, it's ${correct}.`); return msg.say('Nice job! 10/10! You deserve some cake!'); } catch (err) { diff --git a/commands/games/quizlet.js b/commands/games/quizlet.js deleted file mode 100644 index adce0da3..00000000 --- a/commands/games/quizlet.js +++ /dev/null @@ -1,77 +0,0 @@ -const { Command } = require('discord.js-commando'); -const { stripIndents } = require('common-tags'); -const snekfetch = require('snekfetch'); -const { shuffle } = require('../../util/Util'); -const { QUIZLET_KEY } = process.env; - -module.exports = class QuizletGameCommand extends Command { - constructor(client) { - super(client, { - name: 'quizlet', - aliases: ['quizlet-game', 'quizlet-quiz', 'quizlet-test'], - group: 'games', - memberName: 'quizlet', - description: 'Shuffle a Quizlet study set and play a game similar to a quiz.', - args: [ - { - key: 'id', - prompt: 'What is the ID of the deck you wish to use?', - type: 'string', - parse: id => encodeURIComponent(id) - } - ] - }); - - this.playing = new Set(); - } - - async run(msg, { id }) { - if (this.playing.has(msg.channel.id)) return msg.say('Only one game may be occurring per channel.'); - this.playing.add(msg.channel.id); - try { - const { body } = await snekfetch - .get(`https://api.quizlet.com/2.0/sets/${id}/terms`) - .query({ client_id: QUIZLET_KEY }); - const terms = shuffle(body); - const seen = new Set(); - while (terms.length > 0) { - const term = terms[0]; - await msg.say(stripIndents` - **You have 30 seconds to answer which word this is.** - ${term.definition} - ${term.image ? term.image.url : ''} - `); - const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { - max: 1, - time: 30000 - }); - if (!msgs.size) { - await msg.say('Time!'); - continue; - } - const choice = msgs.first().content.toLowerCase(); - if (choice === 'end') break; - if (choice !== term.term.toLowerCase()) { - await msg.say(`Nope, sorry, it was ${term.term}.`); - if (seen.has(term.term)) seen.delete(term.term); - terms.push(term); - } else { - await msg.say('Nice job! 10/10! You deserve some cake!'); - if (seen.has(term.term)) { - seen.delete(term.term); - } else { - seen.add(term.term); - terms.push(term); - } - } - terms.shift(); - } - this.playing.delete(msg.channel.id); - return msg.say('See you next time!'); - } catch (err) { - this.playing.delete(msg.channel.id); - if (err.status === 404) return msg.say('Could not find any results.'); - return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); - } - } -}; diff --git a/commands/games/tic-tac-toe.js b/commands/games/tic-tac-toe.js index a8ddadf4..85078b75 100644 --- a/commands/games/tic-tac-toe.js +++ b/commands/games/tic-tac-toe.js @@ -55,7 +55,7 @@ module.exports = class TicTacToeCommand extends Command { time: 30000 }); if (!turn.size) { - await msg.say('Time!'); + await msg.say('Sorry, time is up!'); userTurn = !userTurn; continue; } diff --git a/commands/games/whos-that-pokemon.js b/commands/games/whos-that-pokemon.js index 9ec4edde..d6c04a44 100644 --- a/commands/games/whos-that-pokemon.js +++ b/commands/games/whos-that-pokemon.js @@ -58,7 +58,7 @@ module.exports = class WhosThatPokemonCommand extends Command { max: 1, time: 15000 }); - if (!msgs.size) return msg.say(`Time! It was ${displayName}, sorry!`); + if (!msgs.size) return msg.say(`Sorry, time is up! It was ${displayName}.`); if (!names.includes(msgs.first().content.toLowerCase())) return msg.say(`Nope, sorry, it's ${displayName}.`); return msg.say('Nice job! 10/10! You deserve some cake!'); } catch (err) { diff --git a/package.json b/package.json index 4b5bb49f..aa041f36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "47.9.0", + "version": "47.9.1", "description": "Your personal server companion.", "main": "Shard.js", "scripts": {