From bf19c9e39851524ef744e08f662bb361a509de20 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Mon, 9 Oct 2017 12:39:35 +0000 Subject: [PATCH] Stuff --- commands/games/math-game.js | 2 +- commands/image-edit/be-like-bill.js | 30 +++++++++++++---------------- package.json | 2 +- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/commands/games/math-game.js b/commands/games/math-game.js index 873eee90..49f38c1b 100644 --- a/commands/games/math-game.js +++ b/commands/games/math-game.js @@ -53,7 +53,7 @@ module.exports = class MathGameCommand extends Command { time: 10000 }); if (!msgs.size) return msg.say(`Time! It was ${answer}, sorry!`); - if (msgs.first().content !== answer) return msg.say(`Nope, sorry, it's ${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/image-edit/be-like-bill.js b/commands/image-edit/be-like-bill.js index 187ae25a..99d82aa4 100644 --- a/commands/image-edit/be-like-bill.js +++ b/commands/image-edit/be-like-bill.js @@ -32,25 +32,21 @@ module.exports = class BeLikeBillCommand extends Command { } async run(msg, { name }) { - try { - const canvas = createCanvas(800, 420); - const ctx = canvas.getContext('2d'); - const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'be-like-bill.png')); - ctx.drawImage(base, 0, 0); - ctx.font = '23px Noto'; - const text = stripIndents` - This is ${name}. + const canvas = createCanvas(800, 420); + const ctx = canvas.getContext('2d'); + const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'be-like-bill.png')); + ctx.drawImage(base, 0, 0); + ctx.font = '23px Noto'; + const text = stripIndents` + This is ${name}. - ${texts[Math.floor(Math.random() * texts.length)].replace(/{{name}}/gi, name)} + ${texts[Math.floor(Math.random() * texts.length)].replace(/{{name}}/gi, name)} - ${name} is smart. - Be like ${name}. - `; - ctx.fillText(text, 31, 80); - return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'be-like-bill.png' }] }); - } catch (err) { - return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); - } + ${name} is smart. + Be like ${name}. + `; + ctx.fillText(text, 31, 80); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'be-like-bill.png' }] }); } }; diff --git a/package.json b/package.json index 1444bb7e..6134162e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "46.1.0", + "version": "46.1.1", "description": "Your personal server companion.", "main": "Shard.js", "scripts": {