const { Telegraf, Scenes, session, Stage, Markup } = require('telegraf') const { weaponshop, slots, rarecars, simplecars, houses, cars, phones, weapons, equipment, UserModel, WorldModel, JobModel, PropertyModel, BusinessModel, ReportModel, BlockModel, PromocodeModel, mainChat, adminList, expToUp, topSym } = require('/workspace/degradin/Dev/Telegram/CampFire Play/config') const { spaces, spacesWithMarkdown, escape, generatePromo, generateVoucher, getCurrentTime, getSlot, giveExp, matPriceUpdate, rand, random, setCooldown, weaponShopUpdate, stats } = require('/workspace/degradin/Dev/Telegram/CampFire Play/utils') module.exports = async (ctx) => { // Получаем контекст canvas const canvas = ctx.update.callback_query.message.photo[0].file_id; const ctx = new Canvas(cardWidth, cardHeight); // Увеличиваем координаты верхнего слоя topLayerX += 10; topLayerY += 10; // Отправляем обновленную карточку ctx.replyWithPhoto({ source: canvas.toBuffer() }, Markup.inlineKeyboard([ Markup.callbackButton('Стереть', 'erase'), ]).extra()); // Проверяем, достиг ли верхний слой края карточки if (topLayerX + cardWidth > cardWidth) { // Отправляем сообщение с выигрышем ctx.reply('Поздравляю, вы выиграли!'); } }