Prefix Command, new uses alias, changemymind quality

This commit is contained in:
Dragon Fire
2020-11-29 09:28:02 -05:00
parent 3fd607086f
commit 9ba788345f
6 changed files with 33 additions and 9 deletions
+7 -7
View File
@@ -50,16 +50,16 @@ module.exports = class ChangeMyMindCommand extends Command {
const ctx = canvas.getContext('2d');
ctx.textBaseline = 'top';
ctx.drawImage(base, 0, 0);
ctx.rotate(-6 * (Math.PI / 180));
ctx.font = '28px Noto';
let fontSize = 28;
while (ctx.measureText(text).width > 309) {
ctx.rotate(24 * (Math.PI / 180));
ctx.font = '35px Noto';
let fontSize = 35;
while (ctx.measureText(text).width > 506) {
fontSize--;
ctx.font = `${fontSize}px Noto`;
}
const lines = await wrapText(ctx, text, 206);
ctx.fillText(lines.join('\n'), 184, 253, 206);
ctx.rotate(6 * (Math.PI / 180));
const lines = await wrapText(ctx, text, 337);
ctx.fillText(lines.join('\n'), 142, 430, 337);
ctx.rotate(-24 * (Math.PI / 180));
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'change-my-mind.png' }] });
}
};