From ba50f2c0b8c8e4df19455a79bc79e15691bcd7e1 Mon Sep 17 00:00:00 2001 From: Vufer Date: Sun, 10 Nov 2024 01:34:08 +0300 Subject: [PATCH] =?UTF-8?q?=D1=82=D0=B5=D1=81=D1=82=20=D0=BA=D1=83=D0=BB?= =?UTF-8?q?=D0=B4=D0=B0=D1=83=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 29bdc06..25ea7b5 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,7 @@ const MAX_CALLS_PER_DAY = process.env.MAX_CALLS_PER_DAY || 10; // Максима const USAGE_RESET_TIME = 24 * 60 * 60 * 1000; // Время сброса (24 часа) const commandCooldowns = {}; // Хранит временные метки вызовов команд для каждого чата -const COOLDOWN_TIME = 10 * 60 * 1000; // 10 минут в миллисекундах +const COOLDOWN_TIME = 1 * 60 * 1000; // 10 минут в миллисекундах const userUsage = {}; // Для хранения информации о использовании команд пользователями const BASE_PROMPT = `You are an advanced text analyzer that assesses messages based on several criteria. You will receive a string of text as input, and you will return the result in JSON format with the specified fields. \n @@ -386,10 +386,11 @@ bot.onText(/токстоп/, async (msg) => { await bot.deleteMessage(msg.chat.id, msg.message_id); } catch (error) {} if (statCooldown(msg.chat.id)) { - await sendTemporaryMessage(msg.chat.id, 'Слишком частые запросы. Подождите некоторое время.', 1000); + console.log('cooldown for stat') + await sendTemporaryMessage(msg.chat.id, 'Слишком частые запросы. Подождите некоторое время.', 5000); return } - + console.log('not cooldown for stat') const chatId = msg.chat.id; const topUsers = getTopUsersByAverage(); // Получаем топ пользователей по среднему баллу @@ -413,7 +414,7 @@ bot.onText(/токсзапросы/, async (msg) => { await bot.deleteMessage(msg.chat.id, msg.message_id); } catch (error) {} if (statCooldown(msg.chat.id)) { - await sendTemporaryMessage(msg.chat.id, 'Слишком частые запросы. Подождите некоторое время.', 1000); + await sendTemporaryMessage(msg.chat.id, 'Слишком частые запросы. Подождите некоторое время.', 5000); return }