Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
eternnoir committed Sep 9, 2015
2 parents 99f6829 + 85ffe99 commit e7b4e95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions telebot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ def get_user_profile_photos(self, user_id, offset=None, limit=None):
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.
Expand All @@ -193,11 +194,12 @@ def send_message(self, chat_id, text, disable_web_page_preview=None, reply_to_me
: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):
"""
Expand Down
5 changes: 4 additions & 1 deletion telebot/apihelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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')


Expand Down

0 comments on commit e7b4e95

Please sign in to comment.