feat: Initial project structure

- Creates the initial project structure for the Talía bot, including the `app` and `app/modules` directories.
- Adds placeholder files for the core application logic, modules, and configuration.
- Includes a `Dockerfile` and `docker-compose.yml` for containerization.
- Adds a `requirements.txt` file with the necessary dependencies.
- Creates a `tasks.md` file to track development progress.
This commit is contained in:
google-labs-jules[bot]
2025-12-15 18:45:37 +00:00
parent be51ea1c92
commit 95f51d42a2
19 changed files with 292 additions and 0 deletions

34
app/permissions.py Normal file
View File

@@ -0,0 +1,34 @@
# app/permissions.py
from config import OWNER_CHAT_ID, ADMIN_CHAT_IDS, TEAM_CHAT_IDS
def get_user_role(chat_id):
"""
Determines the role of a user based on their chat ID.
"""
chat_id_str = str(chat_id)
if chat_id_str == OWNER_CHAT_ID:
return "owner"
if chat_id_str in ADMIN_CHAT_IDS:
return "admin"
if chat_id_str in TEAM_CHAT_IDS:
return "team"
return "client"
def is_owner(chat_id):
"""
Checks if a user is the owner.
"""
return get_user_role(chat_id) == "owner"
def is_admin(chat_id):
"""
Checks if a user is an admin.
"""
return get_user_role(chat_id) in ["owner", "admin"]
def is_team_member(chat_id):
"""
Checks if a user is a team member.
"""
return get_user_role(chat_id) in ["owner", "admin", "team"]