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