From 36998470e820d59cda2a7155e04f37b360d70844 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 13 Dec 2023 11:25:51 +0100 Subject: [PATCH] Try filtering scheduled events --- bot/src/modules/base/service/event_service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/src/modules/base/service/event_service.py b/bot/src/modules/base/service/event_service.py index 51298b3c..106325c0 100644 --- a/bot/src/modules/base/service/event_service.py +++ b/bot/src/modules/base/service/event_service.py @@ -9,7 +9,7 @@ from cpl_core.database.context import DatabaseContextABC from cpl_core.logging import LoggerABC from cpl_discord.container import Guild from cpl_query.extension import List -from discord import PrivacyLevel +from discord import PrivacyLevel, EventStatus from discord.scheduled_event import ScheduledEvent as DiscordEvent from bot_data.abc.scheduled_event_repository_abc import ScheduledEventRepositoryABC @@ -106,6 +106,7 @@ class EventService: lambda x: x.name == scheduled_event.name and x.description == scheduled_event.description and x.entity_type == scheduled_event.entity_type + and x.status == EventStatus.scheduled ) if from_guild.count() != 0: self._logger.debug(__name__, f"Event {scheduled_event.name} already exists on discord server")