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" ), ], ]