Several improvements

This commit is contained in:
Sijmen Schoon 2016-11-12 02:33:51 +00:00
parent 3b1c26cb7d
commit 8bb396b44e

View File

@ -69,7 +69,6 @@ def sanitize_html(string):
:param string: The HTML string to sanitized.
:return: The sanitized HTML string.
"""
string = string.replace('\n', '')
string = string.replace('<br>', '\n').replace('<br/>', '\n') \
.replace('<br />', '\n')
soup = BeautifulSoup(string, 'html.parser')
@ -321,7 +320,7 @@ async def aiotg_message(chat, match):
try:
room_id = TELEGRAM_CHATS[str(chat.id)]
except KeyError:
print('Unknown telegram chat {}'.format(chat))
print('Unknown telegram chat {}: {}'.format(chat, chat.id))
return
user_id = USER_ID_FORMAT.format(chat.sender['id'])