Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- updates.hear(/^(?:баланс3)/i, async (message, bot) => {
- let ctx = message
- ctx.send(`ПРЕДУПРЕЖДЕНИЕ: чтобы канвас работал, вы должны написать хоть одно сообщение в лс группы.`)
- const { createCanvas, loadImage } = require('canvas');
- const canvas = createCanvas(800, 400);
- const ctxx = canvas.getContext('2d');
- const use_id = message.user.id;
- const [ava_info] = await vk.api.users.get({ user_id: use_id, fields: "photo_400" });
- const [user_info] = await vk.api.users.get({ user_id: use_id });
- const phone = await loadImage('./home/bot_alisa/canvas/grad.png')
- ctxx.fillStyle = "#000000";
- const mychit = await loadImage(ava_info.photo_400);
- ctxx.drawImage(mychit, 0, 0);
- ctxx.drawImage(phone, 0, 0, 800, 400);
- ctxx.font = '25px Impact';
- ctxx.fillText(`ID: ${utils.spaces(message.user.uid)}`, 250, 70);
- ctxx.fillText(`Баланс: ${utils.spaces(message.user.balance)} $`, 250, 118);
- ctxx.fillText(`Дата регистрации: ${unixStamp(message.user.regDate)} `, 254, 270);
- //ctxx.textAlign = "right";
- ctxx.font = '22px Impact';
- ctxx.fillText(`${user_info.first_name} ${user_info.last_name} :`, 370, 27);
- return ctx.sendPhoto({
- value: canvas.toBuffer(),
- options:{
- filename: 'cit.png'
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement