Spaces:
Sleeping
Sleeping
Download bot/access_control.py from JuanCS-Dev/twitch-byte-bot: direct link, hf CLI and curl.
- Browser
- Download file 399 Bytes
-
https://huggingface.co/spaces/JuanCS-Dev/twitch-byte-bot/resolve/main/bot/access_control.py
- Command line
-
hf download hf://spaces/JuanCS-Dev/twitch-byte-bot/bot/access_control.py
-
curl -L -o access_control.py https://huggingface.co/spaces/JuanCS-Dev/twitch-byte-bot/resolve/main/bot/access_control.py
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) | |