mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
commit
e7b4e95fbc
@ -181,7 +181,8 @@ class TeleBot:
|
||||
result = apihelper.get_user_profile_photos(self.token, user_id, offset, limit)
|
||||
return types.UserProfilePhotos.de_json(result)
|
||||
|
||||
def send_message(self, chat_id, text, disable_web_page_preview=None, reply_to_message_id=None, reply_markup=None):
|
||||
def send_message(self, chat_id, text, disable_web_page_preview=None, reply_to_message_id=None, reply_markup=None,
|
||||
parse_mode=None):
|
||||
"""
|
||||
Use this method to send text messages.
|
||||
|
||||
@ -193,11 +194,12 @@ class TeleBot:
|
||||
:param disable_web_page_preview:
|
||||
:param reply_to_message_id:
|
||||
:param reply_markup:
|
||||
:param parse_mode:
|
||||
:return: API reply.
|
||||
"""
|
||||
return types.Message.de_json(
|
||||
apihelper.send_message(self.token, chat_id, text, disable_web_page_preview, reply_to_message_id,
|
||||
reply_markup))
|
||||
reply_markup, parse_mode))
|
||||
|
||||
def forward_message(self, chat_id, from_chat_id, message_id):
|
||||
"""
|
||||
|
@ -62,7 +62,8 @@ def get_me(token):
|
||||
return _make_request(token, method_url)
|
||||
|
||||
|
||||
def send_message(token, chat_id, text, disable_web_page_preview=None, reply_to_message_id=None, reply_markup=None):
|
||||
def send_message(token, chat_id, text, disable_web_page_preview=None, reply_to_message_id=None, reply_markup=None,
|
||||
parse_mode=None):
|
||||
"""
|
||||
Use this method to send text messages. On success, the sent Message is returned.
|
||||
:param token:
|
||||
@ -81,6 +82,8 @@ def send_message(token, chat_id, text, disable_web_page_preview=None, reply_to_m
|
||||
payload['reply_to_message_id'] = reply_to_message_id
|
||||
if reply_markup:
|
||||
payload['reply_markup'] = _convert_markup(reply_markup)
|
||||
if parse_mode:
|
||||
payload['parse_mode'] = parse_mode
|
||||
return _make_request(token, method_url, params=payload, method='post')
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user