mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 00:06:42 +02:00
Stuff
This commit is contained in:
@@ -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!');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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' }] });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "46.1.0",
|
||||
"version": "46.1.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Shard.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user