Try filtering scheduled events
All checks were successful
Deploy staging on push / pre-build (push) Successful in 2s
Deploy staging on push / build-bot (push) Successful in 3m0s
Deploy staging on push / build-web (push) Successful in 2m7s
Deploy staging on push / deploy (push) Successful in 24s

This commit is contained in:
Sven Heidemann 2023-12-13 11:25:51 +01:00
parent 53c6bf4208
commit 36998470e8

View File

@ -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")