Dr.Caduceus commited on
Commit
eb40d7e
·
unverified ·
1 Parent(s): e852210

Bump to v1.2

Browse files
Files changed (1) hide show
  1. bot/modules/decorators.py +3 -3
bot/modules/decorators.py CHANGED
@@ -8,9 +8,9 @@ def verify_user(func: Callable):
8
 
9
  @wraps(func)
10
  async def decorator(client: Client, update: Union[Message, CallbackQuery]):
11
- user_id = str(update.from_user.id)
12
 
13
- if not Telegram.ALLOWED_USER_IDS or user_id in Telegram.ALLOWED_USER_IDS:
14
  return await func(client, update)
15
 
16
- return decorator
 
8
 
9
  @wraps(func)
10
  async def decorator(client: Client, update: Union[Message, CallbackQuery]):
11
+ chat_id = str(update.from_user.id if update.from_user else update.chat.id)
12
 
13
+ if not Telegram.ALLOWED_USER_IDS or chat_id in Telegram.ALLOWED_USER_IDS:
14
  return await func(client, update)
15
 
16
+ return decorator