Advertisement
Guest User

1233

a guest
Jul 23rd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. updates.hear(/^(?:баланс3)/i, async (message, bot) => {
  2.  
  3. let ctx = message
  4.  
  5. ctx.send(`ПРЕДУПРЕЖДЕНИЕ: чтобы канвас работал, вы должны написать хоть одно сообщение в лс группы.`)
  6.  
  7. const { createCanvas, loadImage } = require('canvas');
  8.  
  9. const canvas = createCanvas(800, 400);
  10. const ctxx = canvas.getContext('2d');
  11.  
  12. const use_id = message.user.id;
  13. const [ava_info] = await vk.api.users.get({ user_id: use_id, fields: "photo_400" });
  14. const [user_info] = await vk.api.users.get({ user_id: use_id });
  15. const phone = await loadImage('./home/bot_alisa/canvas/grad.png')
  16. ctxx.fillStyle = "#000000";
  17.  
  18. const mychit = await loadImage(ava_info.photo_400);
  19. ctxx.drawImage(mychit, 0, 0);
  20. ctxx.drawImage(phone, 0, 0, 800, 400);
  21.  
  22. ctxx.font = '25px Impact';
  23. ctxx.fillText(`ID: ${utils.spaces(message.user.uid)}`, 250, 70);
  24. ctxx.fillText(`Баланс: ${utils.spaces(message.user.balance)} $`, 250, 118);
  25. ctxx.fillText(`Дата регистрации: ${unixStamp(message.user.regDate)} `, 254, 270);
  26.  
  27. //ctxx.textAlign = "right";
  28. ctxx.font = '22px Impact';
  29. ctxx.fillText(`${user_info.first_name} ${user_info.last_name} :`, 370, 27);
  30.  
  31. return ctx.sendPhoto({
  32. value: canvas.toBuffer(),
  33. options:{
  34. filename: 'cit.png'
  35. }
  36. });
  37. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement