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