From bbe3ee1670409ff5b04dfdddab07fc48637f2fc9 Mon Sep 17 00:00:00 2001 From: huker667 Date: Wed, 16 Sep 2026 01:16:39 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BC=D0=B0=D0=BA=20=D1=81=20=D0=B3=D1=80?= =?UTF-8?q?=D1=83=D0=BF=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- callbacks.py | 5 +++-- commands.py | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/callbacks.py b/callbacks.py index 8e40ed9..2fff8cc 100644 --- a/callbacks.py +++ b/callbacks.py @@ -1046,10 +1046,11 @@ async def group_set_callback(callback: CallbackQuery): elif key in ["lurk_chance", "lurk_reply_chance"]: g_config = get_group_config(group_id) new_val = g_config[key] + int(val) + max_val = 30 if key == "lurk_chance" else 10 if new_val < 0: new_val = 0 - if new_val > 100: - new_val = 100 + if new_val > max_val: + new_val = max_val set_group_setting(group_id, **{key: new_val}) await group_settings_handler(callback, dataalo=f"group%{group_id}") diff --git a/commands.py b/commands.py index 8559abf..0fc9e42 100644 --- a/commands.py +++ b/commands.py @@ -629,7 +629,7 @@ async def group_settings_handler(event: Union[Message, CallbackQuery], dataalo=" ), InlineKeyboardButton( text="−", - callback_data=f"gset%{group_id}%{user_id}%lurk_chance%-2" + callback_data=f"gset%{group_id}%{user_id}%lurk_chance%-5" ), InlineKeyboardButton( text=f"глядит {g_config['lurk_chance']}%", @@ -637,13 +637,13 @@ async def group_settings_handler(event: Union[Message, CallbackQuery], dataalo=" ), InlineKeyboardButton( text="+", - callback_data=f"gset%{group_id}%{user_id}%lurk_chance%+2" + callback_data=f"gset%{group_id}%{user_id}%lurk_chance%+5" ), ], [ InlineKeyboardButton( text="−", - callback_data=f"gset%{group_id}%{user_id}%lurk_reply_chance%-1" + callback_data=f"gset%{group_id}%{user_id}%lurk_reply_chance%-2" ), InlineKeyboardButton( text=f"пишет {g_config['lurk_reply_chance']}%", @@ -651,7 +651,7 @@ async def group_settings_handler(event: Union[Message, CallbackQuery], dataalo=" ), InlineKeyboardButton( text="+", - callback_data=f"gset%{group_id}%{user_id}%lurk_reply_chance%+1" + callback_data=f"gset%{group_id}%{user_id}%lurk_reply_chance%+2" ), ], ]