Spaces:
No application file
No application file
File size: 387 Bytes
87c19c8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | # PATH: bot/core/auth.py
from hydrogram.types import Message
from bot.config import Telegram
from bot.integrations.cf_worker2 import is_allowed
def is_owner_id(uid: int | None) -> bool:
return bool(uid and uid == Telegram.OWNER_ID)
async def require_allowed(uid: int) -> bool:
# owner always allowed
if is_owner_id(uid):
return True
return await is_allowed(uid) |