twitch-byte-bot / bot /access_control.py
JuanCS-Dev's picture
Upload folder using huggingface_hub
127bfda verified
Raw History Blame Contribute Delete
399 Bytes
from typing import Any
def is_owner(user_id: str, owner_id: str) -> bool:
return str(user_id) == str(owner_id)
def is_moderator(author: Any) -> bool:
return bool(getattr(author, "is_mod", False)) or bool(getattr(author, "is_moderator", False))
def is_trusted_curator(author: Any, owner_id: str) -> bool:
return is_owner(getattr(author, "id", ""), owner_id) or is_moderator(author)