mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-14 00:08:06 +02:00
Fix
This commit is contained in:
@@ -41,7 +41,7 @@ module.exports = class CaptchaCommand extends Command {
|
||||
ctx.strokeText(text, 15, 26);
|
||||
await msg.reply(
|
||||
'**You have 15 seconds, what does the captcha say?**',
|
||||
{ files: [{ attachment: canvas.toBuffer(), name: 'captcha-quiz.png' }] }
|
||||
{ files: [{ attachment: canvas.toBuffer('image/png'), name: 'captcha-quiz.png' }] }
|
||||
);
|
||||
const msgs = await msg.channel.awaitMessages({
|
||||
filter: res => res.author.id === msg.author.id,
|
||||
|
||||
@@ -107,6 +107,6 @@ module.exports = class HorseRaceCommand extends Command {
|
||||
ctx.font = this.client.fonts.get('Paladins.otf').toCanvasString(15);
|
||||
ctx.fillText(horse.name, 251, 138 + (49 * i));
|
||||
}
|
||||
return { attachment: canvas.toBuffer(), name: 'leaderboard.png' };
|
||||
return { attachment: canvas.toBuffer('image/png'), name: 'leaderboard.png' };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -88,6 +88,6 @@ module.exports = class JeopardyCommand extends Command {
|
||||
ctx.fillStyle = 'white';
|
||||
ctx.fillText(lines[i], canvas.width / 2, height);
|
||||
}
|
||||
return canvas.toBuffer();
|
||||
return canvas.toBuffer('image/png');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -147,7 +147,7 @@ module.exports = class PokemonAdvantageCommand extends Command {
|
||||
ctx.fillText(pokemon1.name, 128, 250, 175);
|
||||
ctx.strokeText(pokemon2.name, 348, 250, 175);
|
||||
ctx.fillText(pokemon2.name, 348, 250, 175);
|
||||
return { attachment: canvas.toBuffer(), name };
|
||||
return { attachment: canvas.toBuffer('image/png'), name };
|
||||
}
|
||||
|
||||
calculateAdvantage(pkmn1, pkmn2) {
|
||||
|
||||
@@ -80,6 +80,6 @@ module.exports = class TypingTestCommand extends Command {
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.fillText(sentence, canvas.width / 2, canvas.height / 2);
|
||||
return canvas.toBuffer();
|
||||
return canvas.toBuffer('image/png');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -149,6 +149,6 @@ module.exports = class WhosThatPokemonCommand extends Command {
|
||||
ctx.fillStyle = '#3c5aa6';
|
||||
ctx.fillText(pokemon.name, 362, 158, 240);
|
||||
}
|
||||
return { attachment: canvas.toBuffer(), name };
|
||||
return { attachment: canvas.toBuffer('image/png'), name };
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user