From 1979703194e604fa265b8aa83e298cfdc92495c7 Mon Sep 17 00:00:00 2001 From: Stijn De Clercq Date: Fri, 12 Mar 2021 10:05:19 +0100 Subject: [PATCH] Unescape HTML, make announcement task run every 10 min instead of every 30 --- cogs/tasks.py | 2 +- data/embeds/ufora.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cogs/tasks.py b/cogs/tasks.py index b44bcac..8c38397 100644 --- a/cogs/tasks.py +++ b/cogs/tasks.py @@ -240,7 +240,7 @@ class Tasks(commands.Cog): async def beforeUpdateMatchweek(self): await self.client.wait_until_ready() - @tasks.loop(minutes=30.0) + @tasks.loop(minutes=10.0) async def uforaAnnouncements(self): """ Task that checks for new Ufora announcements every few minutes diff --git a/data/embeds/ufora.py b/data/embeds/ufora.py index 475110b..2f2dbe3 100644 --- a/data/embeds/ufora.py +++ b/data/embeds/ufora.py @@ -2,6 +2,7 @@ from datetime import datetime, timedelta from discord import Embed, Colour from functions.stringFormatters import leadingZero as lz from functions.timeFormatters import intToWeekday +from html import unescape import pytz import re @@ -78,7 +79,7 @@ class UforaNotification: text = text.replace(key, value) # Remove HTML tags - return re.sub(r"<[^>]*>", "", text) + return unescape(re.sub(r"<[^>]*>", "", text)) def _get_published(self): time_string = "%a, %d %b %Y %H:%M:%S %Z"