1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Merge branch 'master' into patch-1

This commit is contained in:
Badiboy
2020-01-03 16:45:43 +03:00
committed by GitHub
5 changed files with 15 additions and 10 deletions

View File

@ -45,7 +45,7 @@ def _make_request(token, method_name, method='get', params=None, files=None):
request_url = "https://api.telegram.org/bot{0}/{1}".format(token, method_name)
else:
request_url = API_URL.format(token, method_name)
logger.debug("Request: method={0} url={1} params={2} files={3}".format(method, request_url, params, files))
read_timeout = READ_TIMEOUT
connect_timeout = CONNECT_TIMEOUT
@ -124,7 +124,7 @@ def download_file(token, file_path):
def send_message(token, chat_id, text, disable_web_page_preview=None, reply_to_message_id=None, reply_markup=None,
parse_mode=None, disable_notification=None):
parse_mode=None, disable_notification=None, timeout=None):
"""
Use this method to send text messages. On success, the sent Message is returned.
:param token:
@ -149,6 +149,8 @@ def send_message(token, chat_id, text, disable_web_page_preview=None, reply_to_m
payload['parse_mode'] = parse_mode
if disable_notification:
payload['disable_notification'] = disable_notification
if timeout:
payload['connect-timeout'] = timeout
return _make_request(token, method_url, params=payload, method='post')