diff --git a/talia_bot/config.py b/talia_bot/config.py index 65138c1..0e15b72 100644 --- a/talia_bot/config.py +++ b/talia_bot/config.py @@ -18,7 +18,8 @@ ADMIN_ID = os.getenv("TELEGRAM_OWNER_CHAT_ID") # Renamed for consistency in the GOOGLE_SERVICE_ACCOUNT_FILE = os.getenv("GOOGLE_SERVICE_ACCOUNT_FILE") if GOOGLE_SERVICE_ACCOUNT_FILE and not os.path.isabs(GOOGLE_SERVICE_ACCOUNT_FILE): GOOGLE_SERVICE_ACCOUNT_FILE = str(Path(__file__).parent.parent / GOOGLE_SERVICE_ACCOUNT_FILE) -CALENDAR_ID = os.getenv("GOOGLE_CALENDAR_ID") +WORK_GOOGLE_CALENDAR_ID = os.getenv("WORK_GOOGLE_CALENDAR_ID") +PERSONAL_GOOGLE_CALENDAR_ID = os.getenv("PERSONAL_GOOGLE_CALENDAR_ID") # --- Webhooks (n8n) --- N8N_WEBHOOK_URL = os.getenv("N8N_WEBHOOK_URL") diff --git a/talia_bot/modules/calendar.py b/talia_bot/modules/calendar.py index c771d87..021c12c 100644 --- a/talia_bot/modules/calendar.py +++ b/talia_bot/modules/calendar.py @@ -7,7 +7,7 @@ import logging from google.oauth2 import service_account from googleapiclient.discovery import build from googleapiclient.errors import HttpError -from talia_bot.config import GOOGLE_SERVICE_ACCOUNT_FILE, CALENDAR_ID +from talia_bot.config import GOOGLE_SERVICE_ACCOUNT_FILE, WORK_GOOGLE_CALENDAR_ID logger = logging.getLogger(__name__) @@ -24,7 +24,7 @@ service = build("calendar", "v3", credentials=creds) def get_available_slots( - start_time, end_time, duration_minutes=30, calendar_id=CALENDAR_ID + start_time, end_time, duration_minutes=30, calendar_id=WORK_GOOGLE_CALENDAR_ID ): """ Busca espacios disponibles en el calendario dentro de un rango de tiempo. @@ -84,7 +84,7 @@ def get_available_slots( return [] -def create_event(summary, start_time, end_time, attendees, calendar_id=CALENDAR_ID): +def create_event(summary, start_time, end_time, attendees, calendar_id=WORK_GOOGLE_CALENDAR_ID): """ Crea un nuevo evento (cita) en el calendario. @@ -118,7 +118,7 @@ def create_event(summary, start_time, end_time, attendees, calendar_id=CALENDAR_ return None -def get_events(start_time, end_time, calendar_id=CALENDAR_ID): +def get_events(start_time, end_time, calendar_id=WORK_GOOGLE_CALENDAR_ID): """ Obtiene la lista de eventos entre dos momentos. """