diff --git a/src/config.py b/src/config.py index d6ac12d..9e43a5f 100644 --- a/src/config.py +++ b/src/config.py @@ -38,7 +38,7 @@ def _get_env_variable(name: str, default: str | None = None) -> str | Any: BASE_DIR: str = os.path.dirname(os.path.abspath(__file__)) -SLACK_MEETINGS_KEYWORD: str = _get_env_variable("SLACK_MEETINGS_KEYWORD", "meetings") +SLACK_MEETINGS_KEYWORD: str = _get_env_variable("SLACK_MEETINGS_KEYWORD", "meeting") SLACK_NONTECHNICAL_SEMINAR_KEYWORD: str = _get_env_variable("SLACK_NONTECHNICAL_SEMINAR_KEYWORD", "non-technical") SLACK_TECHNICAL_SEMINAR_KEYWORD: str = _get_env_variable("SLACK_TECHNICAL_SEMINAR_KEYWORD", "technical") diff --git a/src/core/announcement_queue.py b/src/core/announcement_queue.py index e874707..3166f3d 100644 --- a/src/core/announcement_queue.py +++ b/src/core/announcement_queue.py @@ -32,6 +32,8 @@ TEN_MINUTES = 60 * 10 MINUTES_BEFORE_EVENT_PING = 15 +logger.info(SLACK_MEETINGS_KEYWORD) +logger.info(SLACK_TECHNICAL_SEMINAR_KEYWORD) async def create_announcement_worker( event_uid: str, event_recurrence_id: str, text: str, event_time: datetime @@ -47,6 +49,7 @@ async def create_announcement_worker( """ key: str = f"{event_uid}:{event_recurrence_id}" # we should use redis instead + logger.info(key) current_time: datetime = datetime.now(ZoneInfo(CALENDAR_TIMEZONE)) if current_time < (event_time - timedelta(minutes=MINUTES_BEFORE_EVENT_PING)): wait_time = ( @@ -133,19 +136,20 @@ def check_for_announcement(event: dict[str, Any], time: datetime) -> None: loc = event.get("LOCATION", None) description = description.lower().strip() + if SLACK_NONTECHNICAL_SEMINAR_KEYWORD.lower() in description: if loc: queue_announcement( uid, rec_id, - f" The Technical Seminar {title} will be happening in the {loc} in {MINUTES_BEFORE_EVENT_PING} minutes!", + f" The Non-Technical Seminar {title} will be happening in the {loc} in {MINUTES_BEFORE_EVENT_PING} minutes!", time, ) else: queue_announcement( uid, rec_id, - f" The Technical Seminar {title} will be happening in {MINUTES_BEFORE_EVENT_PING} minutes!", + f" The Non-Technical Seminar {title} will be happening in {MINUTES_BEFORE_EVENT_PING} minutes!", time, ) elif SLACK_TECHNICAL_SEMINAR_KEYWORD.lower() in description: @@ -153,14 +157,14 @@ def check_for_announcement(event: dict[str, Any], time: datetime) -> None: queue_announcement( uid, rec_id, - f" The Non-Technical Seminar {title} will be happening in the {loc} in {MINUTES_BEFORE_EVENT_PING} minutes!", + f" The Technical Seminar {title} will be happening in the {loc} in {MINUTES_BEFORE_EVENT_PING} minutes!", time, ) else: queue_announcement( uid, rec_id, - f" The Non-Technical Seminar {title} will be happening in {MINUTES_BEFORE_EVENT_PING} minutes!", + f" The Technical Seminar {title} will be happening in {MINUTES_BEFORE_EVENT_PING} minutes!", time, ) elif SLACK_MEETINGS_KEYWORD.lower() in description: