Fixed event not being set as ended correctly

This commit is contained in:
2025-04-26 19:27:15 +02:00
parent 9981143f87
commit 3b8da61b47
2 changed files with 13 additions and 3 deletions

View File

@@ -63,7 +63,11 @@ class PycordBot(LibPycordBot):
async def _process_events_start(self) -> None:
# Get events to start
events: List[PycordEvent] = await self._get_events(
{"starts": datetime.now(tz=ZoneInfo("UTC")).replace(second=0, microsecond=0)}
{
"starts": datetime.now(tz=ZoneInfo("UTC")).replace(second=0, microsecond=0),
"is_cancelled": False,
"ended": None,
}
)
# Process each event
@@ -171,6 +175,8 @@ class PycordBot(LibPycordBot):
f"Event **{event.name}** has ended! Users can no longer submit their answers.",
)
await event.end(cache=self.cache)
@staticmethod
async def _get_events(query: Dict[str, Any]) -> List[PycordEvent]:
events: List[PycordEvent] = []