remove empty lines in messages

This commit is contained in:
Tomáš Mládek 2021-02-27 09:52:47 +01:00
parent b523d3b547
commit d8ff415bb1

7
bot.py
View file

@ -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'(<br>)+', '<br>', output)
return output
async def send_message(text):
async with aiohttp.ClientSession() as session: