mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 18:05:01 +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.drawImage(base, 0, 0);
|
||||||
ctx.font = '17px Minecraftia';
|
ctx.font = '17px Minecraftia';
|
||||||
ctx.fillStyle = '#ffff00';
|
ctx.fillStyle = '#ffff00';
|
||||||
ctx.fillText('Achievement Get!', 60, 35);
|
ctx.fillText('Achievement Get!', 60, 37);
|
||||||
let shorten;
|
let shorten;
|
||||||
if (ctx.measureText(text).width > 230) shorten = true;
|
if (ctx.measureText(text).width > 230) shorten = true;
|
||||||
while (ctx.measureText(text).width > 230) text = text.substr(0, text.length - 1);
|
while (ctx.measureText(text).width > 230) text = text.substr(0, text.length - 1);
|
||||||
ctx.fillStyle = '#ffffff';
|
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' }] });
|
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'achievement.png' }] });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user