From 4f4c0891d9c6da96e212036c03d220e325e41598 Mon Sep 17 00:00:00 2001 From: Kwisatz Haderach <38349702+Otxoto@users.noreply.github.com> Date: Tue, 23 Jun 2020 20:10:12 +0200 Subject: [PATCH] Added thumb support to send_audio --- telebot/apihelper.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/telebot/apihelper.py b/telebot/apihelper.py index 8a6ae75..93ba91a 100644 --- a/telebot/apihelper.py +++ b/telebot/apihelper.py @@ -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, - 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' payload = {'chat_id': chat_id} files = None @@ -567,6 +567,11 @@ def send_audio(token, chat_id, audio, caption=None, duration=None, performer=Non payload['disable_notification'] = disable_notification if 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')