diff --git a/bot.py b/bot.py index 7169730..1627e93 100644 --- a/bot.py +++ b/bot.py @@ -1,6 +1,7 @@ import asyncio import logging import pickle +import re import textwrap from asyncio import sleep @@ -44,7 +45,7 @@ def process_event(event, template): description = description or "???" description = textwrap.shorten(description, width=512, placeholder="...") - return template.format( + output = template.format( title=event.name, date=date, location=location, @@ -53,6 +54,10 @@ def process_event(event, template): description=description ) + output = re.sub(r'(
)+', '
', output) + + return output + async def send_message(text): async with aiohttp.ClientSession() as session: