From b7db1ecd558d7f938ccc24a83a6581148fcdfbf7 Mon Sep 17 00:00:00 2001 From: Degradin Date: Sat, 18 Jan 2025 01:37:29 +0300 Subject: [PATCH] stash --- bot.js | 31 +++++ json/logs.json | 316 ++++++++++++++++++++++++++++++++++++++++++++++ public/daily.html | 94 ++++++++++++++ public/index.html | 262 +++++++++++++++++++++++++++++++++++++- 4 files changed, 700 insertions(+), 3 deletions(-) create mode 100644 public/daily.html diff --git a/bot.js b/bot.js index 10be812..c60e93c 100644 --- a/bot.js +++ b/bot.js @@ -495,6 +495,33 @@ bot.command('daily_bonus', async (ctx) => { } }); +bot.command('daily', async (ctx) => { + try { + // Получаем данные пользователя + const user = await UserModel.findByPk(ctx.from.id); + + // Создаем клавиатуру с кнопкой перехода в мини-приложение + const keyboard = { + inline_keyboard: [ + [ + { + text: '🎁 Ежедневный бонус', + web_app: { url: 'https://web-bot.campfiregg.ru/daily' } // Замените на URL мини-приложения + } + ] + ] + }; + + // Отправляем сообщение с кнопкой + await ctx.reply('👋 Добро пожаловать в раздел ежедневных наград! Нажмите на кнопку ниже, чтобы открыть календарь и получить сегодняшнюю награду.', { + reply_markup: keyboard + }); + } catch (error) { + console.error('Ошибка при открытии ежедневного бонуса:', error); + return ctx.reply('Произошла ошибка. Попробуйте снова.'); + } +}); + /////////////////////////////////////Enterprise Update 20.12.2024////////////////////////////////////////////////// @@ -912,6 +939,10 @@ bot.action(/upgrade_(\d+)/, async (ctx) => { return await ctx.telegram.answerCbQuery(ctx.callbackQuery.id, `У вас недостаточно средств для прокачки предприятия. Необходимо ${upgradeCost} руб.`) } + if(enterprise.level >= 5) { + return await ctx.reply('Предприятие уже достигло максимального уровня.') + } + // Прокачка: повышение уровня и эффективности await enterprise.update({ level: enterprise.level + 1, diff --git a/json/logs.json b/json/logs.json index e0e8e37..cc83e11 100644 --- a/json/logs.json +++ b/json/logs.json @@ -31992,6 +31992,7 @@ } } { +<<<<<<< Updated upstream "timestamp": "2025-01-16T23:43:39.004Z", "user": { "id": 275416286, @@ -32031,6 +32032,9 @@ } { "timestamp": "2025-01-17T03:54:45.300Z", +======= + "timestamp": "2025-01-17T20:33:22.008Z", +>>>>>>> Stashed changes "user": { "id": 805814188, "username": "Mana_Terroristo", @@ -32048,6 +32052,7 @@ } } { +<<<<<<< Updated upstream "timestamp": "2025-01-17T03:54:55.564Z", "user": { "id": 805814188, @@ -32085,6 +32090,9 @@ } { "timestamp": "2025-01-17T03:55:00.195Z", +======= + "timestamp": "2025-01-17T20:33:22.790Z", +>>>>>>> Stashed changes "user": { "id": 805814188, "username": "Mana_Terroristo", @@ -32099,6 +32107,7 @@ "extraData": { "baseChance": 20, "chance": 38, +<<<<<<< Updated upstream "randomRoll": 37, "moneyIn": 112505 } @@ -32782,6 +32791,14 @@ } { "timestamp": "2025-01-17T09:57:28.198Z", +======= + "randomRoll": 5, + "moneyIn": 108150 + } +} +{ + "timestamp": "2025-01-17T20:33:25.779Z", +>>>>>>> Stashed changes "user": { "id": 805814188, "username": "Mana_Terroristo", @@ -32799,7 +32816,11 @@ } } { +<<<<<<< Updated upstream "timestamp": "2025-01-17T09:57:33.175Z", +======= + "timestamp": "2025-01-17T20:33:29.411Z", +>>>>>>> Stashed changes "user": { "id": 805814188, "username": "Mana_Terroristo", @@ -32817,7 +32838,11 @@ } } { +<<<<<<< Updated upstream "timestamp": "2025-01-17T09:57:36.659Z", +======= + "timestamp": "2025-01-17T20:33:32.641Z", +>>>>>>> Stashed changes "user": { "id": 805814188, "username": "Mana_Terroristo", @@ -32835,7 +32860,31 @@ } } { +<<<<<<< Updated upstream "timestamp": "2025-01-17T09:57:42.627Z", +======= + "timestamp": "2025-01-17T20:33:36.390Z", + "user": { + "id": 805814188, + "username": "Mana_Terroristo", + "first_name": "Егор", + "last_name": "" + }, + "chat": { + "id": 805814188, + "type": "private" + }, + "action": "Карманная кража (Сумка)", + "extraData": { + "baseChance": 20, + "chance": 38, + "randomRoll": 19, + "moneyIn": 12660 + } +} +{ + "timestamp": "2025-01-17T20:33:40.840Z", +>>>>>>> Stashed changes "user": { "id": 805814188, "username": "Mana_Terroristo", @@ -32853,6 +32902,7 @@ } } { +<<<<<<< Updated upstream "timestamp": "2025-01-17T09:57:43.467Z", "user": { "id": 805814188, @@ -32874,6 +32924,9 @@ } { "timestamp": "2025-01-17T09:57:46.490Z", +======= + "timestamp": "2025-01-17T20:33:45.406Z", +>>>>>>> Stashed changes "user": { "id": 805814188, "username": "Mana_Terroristo", @@ -32891,7 +32944,31 @@ } } { +<<<<<<< Updated upstream "timestamp": "2025-01-17T09:57:50.543Z", +======= + "timestamp": "2025-01-17T20:33:46.979Z", + "user": { + "id": 805814188, + "username": "Mana_Terroristo", + "first_name": "Егор", + "last_name": "" + }, + "chat": { + "id": 805814188, + "type": "private" + }, + "action": "Карманная кража (Сумка)", + "extraData": { + "baseChance": 20, + "chance": 38, + "randomRoll": 11, + "moneyIn": 14466 + } +} +{ + "timestamp": "2025-01-17T20:34:09.846Z", +>>>>>>> Stashed changes "user": { "id": 805814188, "username": "Mana_Terroristo", @@ -32905,11 +32982,19 @@ "action": "Карманная кража (Start)", "extraData": { "cdBefore": 1697887440, +<<<<<<< Updated upstream "stamina": 30 } } { "timestamp": "2025-01-17T09:57:56.423Z", +======= + "stamina": 33 + } +} +{ + "timestamp": "2025-01-17T20:34:13.842Z", +>>>>>>> Stashed changes "user": { "id": 805814188, "username": "Mana_Terroristo", @@ -32927,7 +33012,11 @@ } } { +<<<<<<< Updated upstream "timestamp": "2025-01-17T09:58:00.072Z", +======= + "timestamp": "2025-01-17T20:34:17.764Z", +>>>>>>> Stashed changes "user": { "id": 805814188, "username": "Mana_Terroristo", @@ -32945,7 +33034,11 @@ } } { +<<<<<<< Updated upstream "timestamp": "2025-01-17T09:58:05.212Z", +======= + "timestamp": "2025-01-17T20:34:21.384Z", +>>>>>>> Stashed changes "user": { "id": 805814188, "username": "Mana_Terroristo", @@ -32962,3 +33055,226 @@ "stamina": 3 } } +<<<<<<< Updated upstream +======= +{ + "timestamp": "2025-01-17T22:15:18.599Z", + "user": { + "id": 805814188, + "username": "Mana_Terroristo", + "first_name": "Егор", + "last_name": "" + }, + "chat": { + "id": 805814188, + "type": "private" + }, + "action": "Карманная кража (Start)", + "extraData": { + "cdBefore": 1697887440, + "stamina": 90 + } +} +{ + "timestamp": "2025-01-17T22:15:19.535Z", + "user": { + "id": 805814188, + "username": "Mana_Terroristo", + "first_name": "Егор", + "last_name": "" + }, + "chat": { + "id": 805814188, + "type": "private" + }, + "action": "Карманная кража (Сумка)", + "extraData": { + "baseChance": 20, + "chance": 38, + "randomRoll": 5, + "moneyIn": 30807 + } +} +{ + "timestamp": "2025-01-17T22:15:23.145Z", + "user": { + "id": 805814188, + "username": "Mana_Terroristo", + "first_name": "Егор", + "last_name": "" + }, + "chat": { + "id": 805814188, + "type": "private" + }, + "action": "Карманная кража (Start)", + "extraData": { + "cdBefore": 1697887440, + "stamina": 80 + } +} +{ + "timestamp": "2025-01-17T22:15:28.001Z", + "user": { + "id": 805814188, + "username": "Mana_Terroristo", + "first_name": "Егор", + "last_name": "" + }, + "chat": { + "id": 805814188, + "type": "private" + }, + "action": "Карманная кража (Start)", + "extraData": { + "cdBefore": 1697887440, + "stamina": 70 + } +} +{ + "timestamp": "2025-01-17T22:15:32.087Z", + "user": { + "id": 805814188, + "username": "Mana_Terroristo", + "first_name": "Егор", + "last_name": "" + }, + "chat": { + "id": 805814188, + "type": "private" + }, + "action": "Карманная кража (Start)", + "extraData": { + "cdBefore": 1697887440, + "stamina": 60 + } +} +{ + "timestamp": "2025-01-17T22:15:37.393Z", + "user": { + "id": 805814188, + "username": "Mana_Terroristo", + "first_name": "Егор", + "last_name": "" + }, + "chat": { + "id": 805814188, + "type": "private" + }, + "action": "Карманная кража (Start)", + "extraData": { + "cdBefore": 1697887440, + "stamina": 50 + } +} +{ + "timestamp": "2025-01-17T22:15:41.432Z", + "user": { + "id": 805814188, + "username": "Mana_Terroristo", + "first_name": "Егор", + "last_name": "" + }, + "chat": { + "id": 805814188, + "type": "private" + }, + "action": "Карманная кража (Start)", + "extraData": { + "cdBefore": 1697887440, + "stamina": 40 + } +} +{ + "timestamp": "2025-01-17T22:15:46.263Z", + "user": { + "id": 805814188, + "username": "Mana_Terroristo", + "first_name": "Егор", + "last_name": "" + }, + "chat": { + "id": 805814188, + "type": "private" + }, + "action": "Карманная кража (Start)", + "extraData": { + "cdBefore": 1697887440, + "stamina": 30 + } +} +{ + "timestamp": "2025-01-17T22:15:50.570Z", + "user": { + "id": 805814188, + "username": "Mana_Terroristo", + "first_name": "Егор", + "last_name": "" + }, + "chat": { + "id": 805814188, + "type": "private" + }, + "action": "Карманная кража (Start)", + "extraData": { + "cdBefore": 1697887440, + "stamina": 20 + } +} +{ + "timestamp": "2025-01-17T22:15:55.802Z", + "user": { + "id": 805814188, + "username": "Mana_Terroristo", + "first_name": "Егор", + "last_name": "" + }, + "chat": { + "id": 805814188, + "type": "private" + }, + "action": "Карманная кража (Start)", + "extraData": { + "cdBefore": 1697887440, + "stamina": 13 + } +} +{ + "timestamp": "2025-01-17T22:16:00.649Z", + "user": { + "id": 805814188, + "username": "Mana_Terroristo", + "first_name": "Егор", + "last_name": "" + }, + "chat": { + "id": 805814188, + "type": "private" + }, + "action": "Карманная кража (Start)", + "extraData": { + "cdBefore": 1697887440, + "stamina": 3 + } +} +{ + "timestamp": "2025-01-17T22:16:01.654Z", + "user": { + "id": 805814188, + "username": "Mana_Terroristo", + "first_name": "Егор", + "last_name": "" + }, + "chat": { + "id": 805814188, + "type": "private" + }, + "action": "Карманная кража (Сумка)", + "extraData": { + "baseChance": 20, + "chance": 38, + "randomRoll": 21, + "moneyIn": 21497 + } +} +>>>>>>> Stashed changes diff --git a/public/daily.html b/public/daily.html new file mode 100644 index 0000000..ae1ed7b --- /dev/null +++ b/public/daily.html @@ -0,0 +1,94 @@ + + + + + + Daily Bonus + + + +

Ежедневный бонус

+
+ + + diff --git a/public/index.html b/public/index.html index 8db9333..f7eb824 100644 --- a/public/index.html +++ b/public/index.html @@ -6,6 +6,7 @@ Меню игрока @@ -207,23 +431,39 @@
+<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes
0
+<<<<<<< Updated upstream

Профиль

+======= +

Профиль

+
+
+ +>>>>>>> Stashed changes
0
+<<<<<<< Updated upstream

Персонаж

+======= +

Персонаж

+
+>>>>>>> Stashed changes @@ -313,11 +553,23 @@ // Уровни профиля и персонажа document.getElementById("profile-level").textContent = user.profileLevel; document.getElementById("character-level").textContent = user.characterLevel; +<<<<<<< Updated upstream const profileProgress = document.getElementById("profile-progress"); const characterProgress = document.getElementById("character-progress"); profileProgress.style.strokeDashoffset = 251 - (251 * user.profileLevel / 100); characterProgress.style.strokeDashoffset = 251 - (251 * user.characterLevel / 100); +======= + + const profileProgress = document.getElementById("profile-progress"); + const characterProgress = document.getElementById("character-progress"); + profileProgress.style.strokeDashoffset = 251 - (251 * user.profileLevel / 100); + characterProgress.style.strokeDashoffset = 251 - (251 * user.characterLevel / 100); + + + // Уровень в кружке + document.getElementById("level-circle").textContent = user.profileLevel; +>>>>>>> Stashed changes // Установка прогресса HP и Стамины const hpProgress = (user.hp / user.maxHp) * 100; @@ -355,7 +607,11 @@ const progress = (ent.currentResources / ent.warehouseCapacity) * 100; const progressBar = document.createElement("div"); progressBar.classList.add("progress-bar"); +<<<<<<< Updated upstream progressBar.innerHTML = `
`; +======= + progressBar.innerHTML = `
${progress}%
`; +>>>>>>> Stashed changes div.appendChild(progressBar); enterprisesDiv.appendChild(div); });