мак с група
This commit is contained in:
1 parent
b73f17c762
commit
bbe3ee1670
2 files changed
+7
-6
No files matched your search
+3
-2
@@ -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}")
|
||||
|
||||
+4
-4
@@ -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"
|
||||
),
|
||||
],
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user