Skip to content

Commit

Permalink
unescaped events
Browse files Browse the repository at this point in the history
  • Loading branch information
Mole1424 committed Oct 12, 2023
1 parent 48998c7 commit 4773688
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cogs/commands/event_sync.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import datetime
import io
from html import unescape

import discord
from discord.ext import commands
Expand Down Expand Up @@ -47,6 +48,7 @@ async def event(self, ctx: Context, days: int = 7, logging: bool = False):
for ev in cal.walk():
if ev.name != "VEVENT":
continue

t = (
ev.decoded("dtstart")
.replace(tzinfo=None)
Expand Down Expand Up @@ -105,9 +107,9 @@ async def update_event(self, ctx, ev, links, dc_events):
@staticmethod
def ical_event_to_dc_args(ev):
"""Construct args for discord event from the ical event"""
desc = f"{ev.get('description')}\n\nSee more at {ev.get('url')}"
desc = unescape(f"{ev.get('description')}\n\nSee more at {ev.get('url')}")
return {
"name": str(ev.get("summary")),
"name": unescape(str(ev.get("summary"))),
"description": desc,
"start_time": ev.decoded("dtstart"),
"end_time": ev.decoded("dtend"),
Expand Down

0 comments on commit 4773688

Please sign in to comment.