diff --git a/telethon_examples/assistant.py b/telethon_examples/assistant.py index 7dcde266..6fba1eff 100644 --- a/telethon_examples/assistant.py +++ b/telethon_examples/assistant.py @@ -8,6 +8,7 @@ import time import urllib.parse from telethon import TelegramClient, events, custom +from telethon.extensions import markdown logging.basicConfig(level=logging.WARNING) logging.getLogger('asyncio').setLevel(logging.ERROR) @@ -325,7 +326,8 @@ async def handler(event): m = re.match('(client|msg).(.+)', query) if m: text = get_docs_message(m.group(1), m.group(2)) - result = builder.article(text, text=text) + query = markdown.parse(text)[0] + result = builder.article(query, text=text) else: m = re.match('ref.(.+)', query) if m: diff --git a/telethon_generator/data/error_descriptions b/telethon_generator/data/error_descriptions index 84cbe497..9c676ab4 100644 --- a/telethon_generator/data/error_descriptions +++ b/telethon_generator/data/error_descriptions @@ -73,3 +73,4 @@ REPLY_MARKUP_TOO_LONG=The data embedded in the reply markup buttons was too much SHORTNAME_OCCUPY_FAILED=An error occurred when trying to register the short-name used for the sticker pack. Try a different name PACK_SHORT_NAME_INVALID=Invalid sticker pack name. It must begin with a letter, can't contain consecutive underscores and must end in "_by_". PHOTO_SAVE_FILE_INVALID=The photo you tried to send cannot be saved by Telegram. A reason may be that it exceeds 10MB. Try resizing it locally +AUTH_KEY_DUPLICATED=The authorization key (session file) was used under two different IP addresses simultaneously, and can no longer be used. Use the same session exclusively, or use different sessions