diff --git a/telebot/__init__.py b/telebot/__init__.py index 7e0bd0f..90a41ae 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -782,7 +782,7 @@ class TeleBot: disable_notification, timeout)) def send_video(self, chat_id, data, duration=None, caption=None, reply_to_message_id=None, reply_markup=None, - parse_mode=None, supports_streaming=None, disable_notification=None, timeout=None, thumb=None): + parse_mode=None, supports_streaming=None, disable_notification=None, timeout=None, thumb=None, width=None, height=None): """ Use this method to send video files, Telegram clients support mp4 videos. :param chat_id: Integer : Unique identifier for the message recipient — User or GroupChat id @@ -802,7 +802,7 @@ class TeleBot: return types.Message.de_json( apihelper.send_video(self.token, chat_id, data, duration, caption, reply_to_message_id, reply_markup, - parse_mode, supports_streaming, disable_notification, timeout, thumb)) + parse_mode, supports_streaming, disable_notification, timeout, thumb, width, height)) def send_animation(self, chat_id, animation, duration=None, caption=None, reply_to_message_id=None, reply_markup=None, parse_mode=None, disable_notification=None, timeout=None): diff --git a/telebot/apihelper.py b/telebot/apihelper.py index c4ab906..07ae8f8 100644 --- a/telebot/apihelper.py +++ b/telebot/apihelper.py @@ -435,7 +435,7 @@ def send_chat_action(token, chat_id, action, timeout=None): def send_video(token, chat_id, data, duration=None, caption=None, reply_to_message_id=None, reply_markup=None, - parse_mode=None, supports_streaming=None, disable_notification=None, timeout=None, thumb=None): + parse_mode=None, supports_streaming=None, disable_notification=None, timeout=None, thumb=None, width=None, height=None): method_url = r'sendVideo' payload = {'chat_id': chat_id} files = None @@ -464,6 +464,10 @@ def send_video(token, chat_id, data, duration=None, caption=None, reply_to_messa files['thumb'] = thumb else: payload['thumb'] = thumb + if width: + payload['width'] = width + if height: + payload['height'] = height return _make_request(token, method_url, params=payload, files=files, method='post')