Some changes to index and admin behavior

This commit is contained in:
Profitroll 2022-08-11 10:14:37 +02:00
parent 4075ddf4a3
commit d1f2401f51
2 changed files with 16 additions and 9 deletions

View File

@ -1,3 +1,4 @@
{
"sent": []
"sent": [],
"captions": {}
}

22
main.py
View File

@ -227,12 +227,6 @@ def get_submission(_, msg):
buttons = [
[
InlineKeyboardButton(text=locale("sub_yes", "button", locale=configGet("locale")), callback_data=f"sub_yes_{msg.from_user.id}_{msg.id}")
],
[
InlineKeyboardButton(text=locale("sub_block", "button", locale=configGet("locale")), callback_data=f"sub_block_{msg.from_user.id}")
],
[
InlineKeyboardButton(text=locale("sub_unblock", "button", locale=configGet("locale")), callback_data=f"sub_unblock_{msg.from_user.id}")
]
]
@ -262,8 +256,20 @@ def get_submission(_, msg):
caption += f" ({msg.from_user.phone_number})"
msg.copy(configGet("admin", "reports"), caption=caption, reply_markup=InlineKeyboardMarkup(buttons))
msg.reply_text(locale("sub_sent", "message", locale=user_locale), quote=True)
subLimit(msg.from_user)
if msg.from_user.id != configGet("admin", "reports"):
buttons += [
[
InlineKeyboardButton(text=locale("sub_block", "button", locale=configGet("locale")), callback_data=f"sub_block_{msg.from_user.id}")
],
[
InlineKeyboardButton(text=locale("sub_unblock", "button", locale=configGet("locale")), callback_data=f"sub_unblock_{msg.from_user.id}")
]
]
msg.reply_text(locale("sub_sent", "message", locale=user_locale), quote=True)
subLimit(msg.from_user)
else:
msg.reply_text(locale("sub_cooldown", "message", locale=user_locale).format(str(configGet("timeout", "submission"))))