SHARE
TWEET

Untitled

a guest Feb 17th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top