mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 00:06:42 +02:00
That should do it
This commit is contained in:
@@ -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' }] });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user