remove empty lines in messages
This commit is contained in:
parent
b523d3b547
commit
d8ff415bb1
1 changed files with 6 additions and 1 deletions
7
bot.py
7
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'(<br>)+', '<br>', output)
|
||||
|
||||
return output
|
||||
|
||||
|
||||
async def send_message(text):
|
||||
async with aiohttp.ClientSession() as session:
|
||||
|
|
Loading…
Reference in a new issue