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';
+2 -2
View File
@@ -40,7 +40,7 @@ module.exports = class JeopardyCommand extends Command {
async run(msg) {
const question = await this.fetchQuestion();
const clueCard = await this.generateClueCard(question.question.replace(/<\/?i>/gi, ''));
const clueCard = this.generateClueCard(question.question.replace(/<\/?i>/gi, ''));
const connection = msg.guild ? this.client.dispatchers.get(msg.guild.id) : null;
let playing = false;
if (msg.guild && connection && connection.canPlay) {
@@ -70,7 +70,7 @@ module.exports = class JeopardyCommand extends Command {
return body;
}
async generateClueCard(question) {
generateClueCard(question) {
const canvas = createCanvas(1280, 720);
const ctx = canvas.getContext('2d');
ctx.fillStyle = '#030e78';