From f795637848d5303800bae0490b98f6ee771a4085 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Tue, 7 Nov 2023 01:32:47 +0100 Subject: [PATCH] no need for guild --- divent/bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/divent/bot.py b/divent/bot.py index d7c2b3b..34571ba 100644 --- a/divent/bot.py +++ b/divent/bot.py @@ -231,7 +231,7 @@ async def subscribe(entity_id: str): return redirect(url_for(".login")) -def make_event(scheduled_event: GuildScheduledEvent, guild_id: int) -> Event: +def make_event(scheduled_event: GuildScheduledEvent) -> Event: event = Event() event.summary = scheduled_event.name @@ -240,7 +240,7 @@ def make_event(scheduled_event: GuildScheduledEvent, guild_id: int) -> Event: event.duration = timedelta(hours=2) event.uid = str(scheduled_event.id) event.description = scheduled_event.description - event.url = f"https://discord.com/events/{guild_id}/{scheduled_event.id}" + event.url = scheduled_event.url event.location = ( scheduled_event.entity_metadata.location if scheduled_event.entity_metadata @@ -276,7 +276,7 @@ async def ical(entity_id: str): ) for scheduled_event in guild.scheduled_events: - event = make_event(scheduled_event, guild.id) + event = make_event(scheduled_event) calendar.events.append(event) return calendar.serialize() @@ -301,7 +301,7 @@ async def ical(entity_id: str): member.id for member in await scheduled_event.fetch_users().flatten() ]: - event = make_event(scheduled_event, guild.id) + event = make_event(scheduled_event) calendar.events.append(event) return calendar.serialize()