mirror of https://github.com/stijndcl/didier
Unescape HTML, make announcement task run every 10 min instead of every 30
parent
4477ec6c0b
commit
1979703194
|
@ -240,7 +240,7 @@ class Tasks(commands.Cog):
|
||||||
async def beforeUpdateMatchweek(self):
|
async def beforeUpdateMatchweek(self):
|
||||||
await self.client.wait_until_ready()
|
await self.client.wait_until_ready()
|
||||||
|
|
||||||
@tasks.loop(minutes=30.0)
|
@tasks.loop(minutes=10.0)
|
||||||
async def uforaAnnouncements(self):
|
async def uforaAnnouncements(self):
|
||||||
"""
|
"""
|
||||||
Task that checks for new Ufora announcements every few minutes
|
Task that checks for new Ufora announcements every few minutes
|
||||||
|
|
|
@ -2,6 +2,7 @@ from datetime import datetime, timedelta
|
||||||
from discord import Embed, Colour
|
from discord import Embed, Colour
|
||||||
from functions.stringFormatters import leadingZero as lz
|
from functions.stringFormatters import leadingZero as lz
|
||||||
from functions.timeFormatters import intToWeekday
|
from functions.timeFormatters import intToWeekday
|
||||||
|
from html import unescape
|
||||||
import pytz
|
import pytz
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
@ -78,7 +79,7 @@ class UforaNotification:
|
||||||
text = text.replace(key, value)
|
text = text.replace(key, value)
|
||||||
|
|
||||||
# Remove HTML tags
|
# Remove HTML tags
|
||||||
return re.sub(r"<[^>]*>", "", text)
|
return unescape(re.sub(r"<[^>]*>", "", text))
|
||||||
|
|
||||||
def _get_published(self):
|
def _get_published(self):
|
||||||
time_string = "%a, %d %b %Y %H:%M:%S %Z"
|
time_string = "%a, %d %b %Y %H:%M:%S %Z"
|
||||||
|
|
Loading…
Reference in New Issue