Spaces:
Sleeping
Sleeping
Dr.Caduceus
commited on
Bump to v1.2
Browse files
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 |
-
|
| 12 |
|
| 13 |
-
if not Telegram.ALLOWED_USER_IDS or
|
| 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
|