This commit is contained in:
Dragon Fire
2024-05-03 10:28:55 -04:00
parent e92f705824
commit 6dbd29cb03
158 changed files with 158 additions and 159 deletions
+1 -1
View File
@@ -83,6 +83,6 @@ module.exports = class AceAttorneyCommand extends Command {
let text = wrapText(ctx, quote, 242);
text = text.length > 5 ? `${text.slice(0, 5).join('\n')}...` : text.join('\n');
fillTextWithBreaks(ctx, text, 7, 199);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: `ace-attorney-${character}.png` }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: `ace-attorney-${character}.png` }] });
}
};
+1 -1
View File
@@ -56,6 +56,6 @@ module.exports = class AchievementCommand extends Command {
ctx.fillText('Achievement Get!', 60, 40);
ctx.fillStyle = '#ffffff';
ctx.fillText(shortenText(ctx, text, 230), 60, 60);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'achievement.png' }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'achievement.png' }] });
}
};
+1 -1
View File
@@ -60,6 +60,6 @@ module.exports = class CautionCommand extends Command {
const height = topMost + ((fontSize + 20) * i);
ctx.fillText(lines[i], base.width / 2, height);
}
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'caution.png' }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'caution.png' }] });
}
};
+1 -1
View File
@@ -63,6 +63,6 @@ module.exports = class CertificateCommand extends Command {
ctx.fillText(reason, 518, 273);
ctx.fillText(name, 518, 419);
ctx.fillText(moment().format('MM/DD/YYYY'), 309, 503);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'certificate.png' }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'certificate.png' }] });
}
};
@@ -65,6 +65,6 @@ module.exports = class ChineseRestaurantCommand extends Command {
ctx.fillText(lines[2], base.width / 2, 315);
ctx.fillText(lines[3], base.width / 2, 342);
}
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'chinese-restaurant.png' }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'chinese-restaurant.png' }] });
}
};
+1 -1
View File
@@ -60,6 +60,6 @@ module.exports = class DangerCommand extends Command {
const height = topMost + ((fontSize + 20) * i);
ctx.fillText(lines[i], base.width / 2, height);
}
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'danger.png' }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'danger.png' }] });
}
};
+1 -1
View File
@@ -47,6 +47,6 @@ module.exports = class FontCommand extends Command {
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = 'black';
fillTextWithBreaks(ctx, lines.join('\n'), 25, 25);
return canvas.toBuffer();
return canvas.toBuffer('image/png');
}
};
+1 -1
View File
@@ -55,6 +55,6 @@ module.exports = class GandhiQuoteCommand extends Command {
const height = topMost + ((fontSize + 20) * i);
ctx.fillText(lines[i], 395, height);
}
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'gandhi-quote.png' }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'gandhi-quote.png' }] });
}
};
+1 -1
View File
@@ -65,6 +65,6 @@ module.exports = class HighwaySignCommand extends Command {
ctx.fillText(lines[2], 318, 128);
ctx.fillText(lines[3], 318, 147);
}
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'highway-sign.png' }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'highway-sign.png' }] });
}
};
+1 -1
View File
@@ -55,6 +55,6 @@ module.exports = class HollywoodStarCommand extends Command {
ctx.textAlign = 'center';
ctx.textBaseline = 'top';
ctx.fillText(name.toLowerCase(), 288, 140);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'hollywood-star.png' }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'hollywood-star.png' }] });
}
};
@@ -57,6 +57,6 @@ module.exports = class JeopardyQuestionCommand extends Command {
ctx.fillStyle = 'white';
ctx.fillText(lines[i], canvas.width / 2, height);
}
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'jeopardy-question.png' }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'jeopardy-question.png' }] });
}
};
+1 -1
View File
@@ -48,6 +48,6 @@ module.exports = class LicensePlateCommand extends Command {
ctx.textBaseline = 'middle';
ctx.font = this.client.fonts.get('LicensePlate.ttf').toCanvasString(180);
ctx.fillText(text.toUpperCase(), base.width / 2, base.height / 2, 700);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'license-plate.png' }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'license-plate.png' }] });
}
};
+1 -1
View File
@@ -50,6 +50,6 @@ module.exports = class SpeedLimitCommand extends Command {
ctx.font = this.client.fonts.get('HWYGWDE.ttf').toCanvasString(360);
ctx.fillStyle = 'black';
ctx.fillText(limit.toUpperCase(), 313, 356, 475);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'speed-limit.png' }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'speed-limit.png' }] });
}
};
@@ -85,6 +85,6 @@ module.exports = class SpongebobTimeCardCommand extends Command {
ctx.fillStyle = 'black';
ctx.fillText(lines[i], canvas.width / 2, height);
}
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'spongebob-time-card.png' }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'spongebob-time-card.png' }] });
}
};
+1 -1
View File
@@ -202,7 +202,7 @@ module.exports = class TweetCommand extends Command {
ctx.clip();
}
ctx.drawImage(avatar, 17, 84, 52, 52);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'tweet.png' }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'tweet.png' }] });
}
roundedPath(ctx, radius, x, y, imageWidth, imageHeight) {
+1 -1
View File
@@ -117,6 +117,6 @@ module.exports = class UndertaleCommand extends Command {
for (let i = 0; i < lines; i++) {
ctx.fillText(text[i], 174, 22 + (22 * i) + (22 * i) + (space * i));
}
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: `undertale-${character}.png` }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: `undertale-${character}.png` }] });
}
};
+1 -1
View File
@@ -64,6 +64,6 @@ module.exports = class ZeroDialogueCommand extends Command {
let text = wrapText(ctx, quote, 425);
text = text.length > 2 ? `${text.slice(0, 2).join('\n')}...` : text.join('\n');
fillTextWithBreaks(ctx, text, 8, 8);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'zero-dialogue.png' }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'zero-dialogue.png' }] });
}
};