mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
canvas succ
This commit is contained in:
@@ -23,7 +23,8 @@ module.exports = class DemotivationalPosterCommand extends Command {
|
||||
{
|
||||
key: 'title',
|
||||
prompt: 'What should the title of the poster be?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
parse: title => title.toUpperCase()
|
||||
},
|
||||
{
|
||||
key: 'text',
|
||||
@@ -60,7 +61,7 @@ module.exports = class DemotivationalPosterCommand extends Command {
|
||||
ctx.fillText(title, 375, 518);
|
||||
ctx.font = '27px Noto';
|
||||
ctx.fillStyle = 'white';
|
||||
ctx.fillText(text, 375, 570);
|
||||
ctx.fillText(text, 375, 565);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'demotivational-poster.png' }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
|
||||
Reference in New Issue
Block a user