Compare commits

..

4 Commits

Author SHA1 Message Date
af3084ad36 Fixed scheduled event end update #410
All checks were successful
Deploy staging on push / on-push-deploy_sh-edraft (push) Successful in 4m41s
Deploy dev on push / on-push-deploy_sh-edraft (push) Successful in 3m39s
2023-12-01 21:04:29 +01:00
285b8bdbe4 Fixed scheduled events #410
All checks were successful
Deploy staging on push / on-push-deploy_sh-edraft (push) Successful in 4m44s
2023-12-01 20:40:44 +01:00
e2da4f09ee Fixed command
All checks were successful
Deploy staging on push / on-push-deploy_sh-edraft (push) Successful in 4m50s
2023-12-01 20:02:42 +01:00
4ed99da689 Merge pull request 'dev' (#445) from dev into staging
All checks were successful
Deploy staging on push / on-push-deploy_sh-edraft (push) Successful in 3m32s
Reviewed-on: #445
2023-12-01 19:55:54 +01:00
3 changed files with 4 additions and 8 deletions

View File

@ -20,7 +20,7 @@ class ScheduledEventsCommand(DiscordCommandABC):
self._logger.trace(__name__, f"Loaded command service: {type(self).__name__}") self._logger.trace(__name__, f"Loaded command service: {type(self).__name__}")
@commands.group(name="scheduled-events") @commands.hybrid_group(name="scheduled-events")
@commands.guild_only() @commands.guild_only()
async def scheduled_events(self, ctx: Context): async def scheduled_events(self, ctx: Context):
pass pass

View File

@ -37,10 +37,10 @@ class BaseOnScheduledEventUpdateEvent(OnScheduledEventUpdateABC):
if before.status != after.status and ( if before.status != after.status and (
after.status.value == EventStatus.cancelled.value or after.status.value == EventStatus.completed.value after.status.value == EventStatus.cancelled.value or after.status.value == EventStatus.completed.value
): ):
await self._events.check_and_create_scheduled_events(before.guild)
event = self._events.get_active_event(after) event = self._events.get_active_event(after)
if event is None: if event is None:
return return
self._events.remove_event(event) self._events.remove_event(event)
await self._events.check_and_create_scheduled_events(before.guild)
self._logger.debug(__name__, f"Module {type(self)} stopped") self._logger.debug(__name__, f"Module {type(self)} stopped")

View File

@ -115,15 +115,11 @@ class EventService:
if scheduled_event.start_time is not None: if scheduled_event.start_time is not None:
scheduled_event.start_time = self._append_interval(scheduled_event.interval, scheduled_event.start_time) scheduled_event.start_time = self._append_interval(scheduled_event.interval, scheduled_event.start_time)
kwargs["start_time"] = scheduled_event.start_time.replace(tzinfo=ZoneInfo("Europe/Berlin"))
start_time = scheduled_event.start_time.replace(tzinfo=ZoneInfo("Europe/Berlin"))
kwargs["start_time"] = start_time
if scheduled_event.end_time is not None: if scheduled_event.end_time is not None:
scheduled_event.end_time = self._append_interval(scheduled_event.interval, scheduled_event.end_time) scheduled_event.end_time = self._append_interval(scheduled_event.interval, scheduled_event.end_time)
end_time = scheduled_event.end_time.replace(tzinfo=ZoneInfo("Europe/Berlin")) kwargs["end_time"] = scheduled_event.end_time.replace(tzinfo=ZoneInfo("Europe/Berlin"))
kwargs["end_time"] = end_time
kwargs["entity_type"] = scheduled_event.entity_type kwargs["entity_type"] = scheduled_event.entity_type
if scheduled_event.location is not None: if scheduled_event.location is not None: