That should do it

This commit is contained in:
Daniel Odendahl Jr
2017-10-15 15:42:21 +00:00
parent 118242f6eb
commit dec4b5b7e9
+2 -2
View File
@@ -33,12 +33,12 @@ module.exports = class AchievementCommand extends Command {
ctx.drawImage(base, 0, 0);
ctx.font = '17px Minecraftia';
ctx.fillStyle = '#ffff00';
ctx.fillText('Achievement Get!', 60, 35);
ctx.fillText('Achievement Get!', 60, 37);
let shorten;
if (ctx.measureText(text).width > 230) shorten = true;
while (ctx.measureText(text).width > 230) text = text.substr(0, text.length - 1);
ctx.fillStyle = '#ffffff';
ctx.fillText(shorten ? `${text}...` : text, 60, 58);
ctx.fillText(shorten ? `${text}...` : text, 60, 60);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'achievement.png' }] });
}
};