Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. const { Canvas } = require('canvas-constructor');
  2. const fsn = require('fs-nextra');
  3.  
  4. module.exports.run = async (client, message, args) => {
  5. async function createCanvas() {
  6. const image = await fsn.readFile('./original/.png');
  7.  
  8. return new Canvas(300, 400)
  9. .addImage(image, 0, 0, 300, 400)
  10. .setColor('#FFAE23')
  11. .setTextFont('28px Impact')
  12. .setTextAlign('center')
  13. .addText('Kitten!', 150, 370)
  14. .toBufferAsync();
  15. message.channel.send({ file: { attachment: await createCanvas(), name: 'original.png' } })
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement