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 }