Fix italics in jeopardy question/answer

This commit is contained in:
Dragon Fire
2020-05-05 22:10:25 -04:00
parent af99a7b6d9
commit 91b25c1af0
2 changed files with 7 additions and 6 deletions
+6 -5
View File
@@ -36,7 +36,7 @@ module.exports = class JeopardyCommand extends Command {
async run(msg) {
try {
const question = await this.fetchQuestion();
const clueCard = await this.generateClueCard(question.question);
const clueCard = await this.generateClueCard(question.question.replace(/<\/?i>/gi, ''));
await msg.reply(`The category is: **${question.category.title.toUpperCase()}**. 30 seconds, good luck.`, {
files: [{ attachment: clueCard, name: 'clue-card.png' }]
});
@@ -44,10 +44,11 @@ module.exports = class JeopardyCommand extends Command {
max: 1,
time: 30000
});
if (!msgs.size) return msg.reply(`Time's up, the answer was **${question.answer}**.`);
const win = msgs.first().content.toLowerCase() === question.answer.toLowerCase();
if (!win) return msg.reply(`The answer was **${question.answer}**.`);
return msg.reply(`The answer was **${question.answer}**. Good job!`);
const answer = question.answer.replace(/<\/?i>/gi, '*');
if (!msgs.size) return msg.reply(`Time's up, the answer was **${answer}**.`);
const win = msgs.first().content.toLowerCase() === answer.toLowerCase();
if (!win) return msg.reply(`The answer was **${answer}**.`);
return msg.reply(`The answer was **${answer}**. Good job!`);
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "114.6.0",
"version": "114.6.1",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {