Eggs Get Laid Command, fixes

This commit is contained in:
Daniel Odendahl Jr
2018-09-19 00:24:42 +00:00
parent 60238cbc43
commit 007cd18dea
9 changed files with 56 additions and 32 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ module.exports = class BeLikeBillCommand extends Command {
const ctx = canvas.getContext('2d');
ctx.drawImage(base, 0, 0);
ctx.font = '23px Noto';
const text = wrapText(ctx, texts[Math.floor(Math.random() * texts.length)].replace(/{{name}}/gi, name), 600 - 31);
const text = await wrapText(ctx, texts[Math.floor(Math.random() * texts.length)].replace(/{{name}}/gi, name), 569);
ctx.fillText(stripIndents`
This is ${name}.
+5 -4
View File
@@ -26,21 +26,21 @@ module.exports = class GruPlanCommand extends Command {
label: 'step 1',
prompt: 'What should the first step of Gru\'s plan be?',
type: 'string',
max: 500
max: 150
},
{
key: 'step2',
label: 'step 2',
prompt: 'What should the second step of Gru\'s plan be?',
type: 'string',
max: 500
max: 150
},
{
key: 'step3',
label: 'step 3',
prompt: 'What should the third step of Gru\'s plan be?',
type: 'string',
max: 500
max: 150
}
]
});
@@ -63,7 +63,8 @@ module.exports = class GruPlanCommand extends Command {
fontSize -= 1;
ctx.font = `${fontSize}px Noto`;
}
ctx.fillText(wrapText(ctx, step, 252).join('\n'), x, y);
const lines = await wrapText(ctx, step, 252);
ctx.fillText(lines.join('\n'), x, y);
i++;
}
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'gru-plan.png' }] });
+2 -1
View File
@@ -52,7 +52,8 @@ module.exports = class IllegalCommand extends Command {
fontSize -= 1;
ctx.font = `${fontSize}px Noto`;
}
ctx.fillText(wrapText(ctx, illegalText, 200).join('\n'), 750, 290);
const lines = await wrapText(ctx, illegalText, 200);
ctx.fillText(lines.join('\n'), 750, 290);
ctx.rotate(-7 * (Math.PI / 180));
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'illegal.png' }] });
}
+1 -1
View File
@@ -60,7 +60,7 @@ module.exports = class NikeAdCommand extends Command {
ctx.font = `${fontSize}px Noto`;
ctx.fillStyle = 'white';
ctx.textAlign = 'center';
const lines = wrapText(ctx, `Believe in ${something}. Even if it means ${sacrifice}.`, data.width - 20);
const lines = await wrapText(ctx, `Believe in ${something}. Even if it means ${sacrifice}.`, data.width - 20);
const initial = data.height / 2;
for (let i = 0; i < lines.length; i++) {
const textHeight = initial + (i * fontSize) + (i * 10);