mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 03:14:35 +02:00
SOS Message can only be 4 chars
This commit is contained in:
@@ -38,7 +38,7 @@ module.exports = class SosCommand extends Command {
|
||||
key: 'message',
|
||||
prompt: 'What should Esther spell out to signal for help?',
|
||||
type: 'string',
|
||||
max: 21
|
||||
max: 4
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -50,13 +50,12 @@ module.exports = class SosCommand extends Command {
|
||||
const canvas = createCanvas(base.width, base.height);
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.drawImage(base, 0, 0);
|
||||
ctx.font = '35px Noto';
|
||||
ctx.font = '90px Noto';
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.rotate(15 * (Math.PI / 180));
|
||||
const lines = await wrapText(ctx, message, 130);
|
||||
ctx.fillText(lines.join('\n'), 362, 522);
|
||||
ctx.fillText(message, 362, 522);
|
||||
ctx.rotate(-15 * (Math.PI / 180));
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'sos.png' }] });
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user