Advertisement
n3k4a

Untitled

Mar 26th, 2019
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1.  
  2. client.on("message", message => {
  3. if (message.author.bot) return;
  4. if(!message.channel.guild) return;
  5. let args = message.content.split(' ').slice(1).join(' ');
  6. if(message.content.split(' ')[0] == prefix + 'pbc') {
  7. if (!args[1]) {
  8. message.channel.send(":white_check_mark: ***pbc <message>***");
  9. return;
  10. }
  11. message.guild.members.forEach(member => {
  12. if(!message.member.hasPermission('ADMINISTRATOR')) return;
  13. message.react("✅");
  14. const w = ['./1.png',
  15. './2.png',
  16. './3.png',
  17. './4.png',
  18. './5.png',
  19. './6.png',
  20. './7.png',];
  21. let Image = Canvas.Image,
  22. canvas = new Canvas(400, 200),
  23. ctx = canvas.getContext('2d');
  24. ctx.patternQuality = 'bilinear';
  25. ctx.filter = 'bilinear';
  26. ctx.antialias = 'subpixel';
  27. ctx.shadowColor = 'rgba(0, 0, 0, 0.4)';
  28. ctx.shadowOffsetY = 2;
  29. ctx.shadowBlur = 2;
  30. fs.readFile(`${w[Math.floor(Math.random() * w.length)]}`, function (err, Background) {
  31. if (err) return console.log(err);
  32. let BG = Canvas.Image;
  33. let ground = new Image;
  34. ground.src = Background;
  35. ctx.drawImage(ground, 0, 0, 400, 200);
  36.  
  37. });
  38. let url = member.user.displayAvatarURL.endsWith(".webp") ? member.user.displayAvatarURL.slice(5, -20) + ".png" : member.user.displayAvatarURL;
  39. jimp.read(url, (err, ava) => {
  40. if (err) return console.log(err);
  41. ava.getBuffer(jimp.MIME_PNG, (err, buf) => {
  42. if (err) return console.log(err);
  43.  
  44. ctx.font = '17px Arial';
  45. ctx.fontSize = '13px';
  46. ctx.fillStyle = "#FFFFFF";
  47. ctx.textAlign = "center";
  48. ctx.fillText(`${args} ` , 200, 100);
  49. member.sendFile(canvas.toBuffer());
  50. });
  51. });
  52. });
  53. }
  54. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement