Default to markdown parse mode on send_message

This is consistent with official clients and also provide
the expected result when replying to NewMessage events.
This commit is contained in:
Lonami Exo 2018-02-10 10:45:43 +01:00
parent 7d8d86c5f1
commit eca1e8ec87

View File

@ -570,7 +570,7 @@ class TelegramClient(TelegramBareClient):
if update.message.id == msg_id: if update.message.id == msg_id:
return update.message return update.message
def send_message(self, entity, message, reply_to=None, parse_mode=None, def send_message(self, entity, message, reply_to=None, parse_mode='md',
link_preview=True): link_preview=True):
""" """
Sends the given message to the specified entity (user/chat/channel). Sends the given message to the specified entity (user/chat/channel).
@ -587,8 +587,10 @@ class TelegramClient(TelegramBareClient):
it should be the ID of the message that it should reply to. it should be the ID of the message that it should reply to.
parse_mode (:obj:`str`, optional): parse_mode (:obj:`str`, optional):
Can be 'md' or 'markdown' for markdown-like parsing, in a similar Can be 'md' or 'markdown' for markdown-like parsing (default),
fashion how official clients work. or 'htm' or 'html' for HTML-like parsing. If ``None`` or any
other false-y value is provided, the message will be sent with
no formatting.
link_preview (:obj:`bool`, optional): link_preview (:obj:`bool`, optional):
Should the link preview be shown? Should the link preview be shown?