This commit is contained in:
Dragon Fire
2024-04-26 00:30:33 -04:00
parent aa78cd91c2
commit b44e0ece1b
3 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -27,12 +27,12 @@ module.exports = class FontCommand extends Command {
});
}
async run(msg, { font, text }) {
const image = await this.generateImage(font, text);
run(msg, { font, text }) {
const image = this.generateImage(font, text);
return msg.say({ files: [{ attachment: image, name: `${font.filenameNoExt}.png` }] });
}
async generateImage(font, text) {
generateImage(font, text) {
const canvasPre = createCanvas(1, 1);
const ctxPre = canvasPre.getContext('2d');
ctxPre.font = this.client.fonts.get(font.filename).toCanvasString(50);
@@ -39,7 +39,7 @@ module.exports = class JeopardyQuestionCommand extends Command {
});
}
async run(msg, { text }) {
run(msg, { text }) {
const canvas = createCanvas(1280, 720);
const ctx = canvas.getContext('2d');
ctx.fillStyle = '#030e78';