mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Added thumb support to send_audio
This commit is contained in:
parent
ab496f995e
commit
4f4c0891d9
@ -541,7 +541,7 @@ def send_video_note(token, chat_id, data, duration=None, length=None, reply_to_m
|
|||||||
|
|
||||||
|
|
||||||
def send_audio(token, chat_id, audio, caption=None, duration=None, performer=None, title=None, reply_to_message_id=None,
|
def send_audio(token, chat_id, audio, caption=None, duration=None, performer=None, title=None, reply_to_message_id=None,
|
||||||
reply_markup=None, parse_mode=None, disable_notification=None, timeout=None):
|
reply_markup=None, parse_mode=None, disable_notification=None, timeout=None, thumb=None):
|
||||||
method_url = r'sendAudio'
|
method_url = r'sendAudio'
|
||||||
payload = {'chat_id': chat_id}
|
payload = {'chat_id': chat_id}
|
||||||
files = None
|
files = None
|
||||||
@ -567,6 +567,11 @@ def send_audio(token, chat_id, audio, caption=None, duration=None, performer=Non
|
|||||||
payload['disable_notification'] = disable_notification
|
payload['disable_notification'] = disable_notification
|
||||||
if timeout:
|
if timeout:
|
||||||
payload['connect-timeout'] = timeout
|
payload['connect-timeout'] = timeout
|
||||||
|
if thumb:
|
||||||
|
if not util.is_string(thumb):
|
||||||
|
files['thumb'] = thumb
|
||||||
|
else:
|
||||||
|
payload['thumb'] = thumb
|
||||||
return _make_request(token, method_url, params=payload, files=files, method='post')
|
return _make_request(token, method_url, params=payload, files=files, method='post')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user