diff --git a/tg_bot/modules/warns.py b/tg_bot/modules/warns.py index 0f95be425..6bc68c924 100644 --- a/tg_bot/modules/warns.py +++ b/tg_bot/modules/warns.py @@ -93,7 +93,6 @@ def warn(user: User, chat: Chat, reason: str, message: Message, warner: User = N @run_async -@user_admin_no_reply @bot_admin @loggable def button(bot: Bot, update: Update) -> str: @@ -103,6 +102,9 @@ def button(bot: Bot, update: Update) -> str: if match: user_id = match.group(1) chat = update.effective_chat # type: Optional[Chat] + if not is_user_admin(chat, int(user.id)): + query.answer(text="You are not authorized to remove this warn! Only administrators may remove warns.", show_alert=True) + return "" res = sql.remove_warn(user_id, chat.id) if res: update.effective_message.edit_text(