From eb40d7e33b253ff62cf0987146d4e104f200d23b Mon Sep 17 00:00:00 2001 From: "Dr.Caduceus" Date: Tue, 7 Nov 2023 14:53:08 +0530 Subject: [PATCH] Bump to v1.2 --- bot/modules/decorators.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/modules/decorators.py b/bot/modules/decorators.py index 0a7d17f..3c24daa 100644 --- a/bot/modules/decorators.py +++ b/bot/modules/decorators.py @@ -8,9 +8,9 @@ def verify_user(func: Callable): @wraps(func) async def decorator(client: Client, update: Union[Message, CallbackQuery]): - user_id = str(update.from_user.id) + chat_id = str(update.from_user.id if update.from_user else update.chat.id) - if not Telegram.ALLOWED_USER_IDS or user_id in Telegram.ALLOWED_USER_IDS: + if not Telegram.ALLOWED_USER_IDS or chat_id in Telegram.ALLOWED_USER_IDS: return await func(client, update) - return decorator \ No newline at end of file + return decorator