X Tutup
Skip to content

Commit 9b84a55

Browse files
committed
Fix width+height in sendVideo + game in Message
First errors found by the official test thingy
1 parent 3ca6f6a commit 9b84a55

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

telegram/bot.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,8 @@ def send_video(self,
558558
reply_to_message_id=None,
559559
reply_markup=None,
560560
timeout=20.,
561+
width=None,
562+
height=None,
561563
**kwargs):
562564
"""Use this method to send video files, Telegram clients support mp4
563565
videos (other formats may be sent as telegram.Document).
@@ -568,6 +570,8 @@ def send_video(self,
568570
already on the Telegram servers, or upload a new video file using
569571
multipart/form-data.
570572
duration (Optional[int]): Duration of sent video in seconds.
573+
width (Optional[int)): Video width.
574+
height (Optional[int]): Video height.
571575
caption (Optional[str]): Video caption (may also be used when resending videos by
572576
file_id).
573577
disable_notification (Optional[bool]): Sends the message silently. iOS users will not
@@ -594,6 +598,10 @@ def send_video(self,
594598
data['duration'] = duration
595599
if caption:
596600
data['caption'] = caption
601+
if width:
602+
data['width'] = width
603+
if height:
604+
data['height'] = height
597605

598606
return self._message_wrapper(
599607
url,
@@ -606,6 +614,8 @@ def send_video(self,
606614
reply_to_message_id=reply_to_message_id,
607615
reply_markup=reply_markup,
608616
timeout=timeout,
617+
width=width,
618+
height=height,
609619
**kwargs)
610620

611621
@log

telegram/message.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ def __init__(self,
147147
successful_payment=None,
148148
bot=None,
149149
video_note=None,
150+
game=None,
150151
**kwargs):
151152
# Required
152153
self.message_id = int(message_id)
@@ -162,7 +163,7 @@ def __init__(self,
162163
self.text = text
163164
self.entities = entities or list()
164165
self.audio = audio
165-
self.game = kwargs.get('game')
166+
self.game = game
166167
self.document = document
167168
self.photo = photo
168169
self.sticker = sticker

0 commit comments

Comments
 (0)
X Tutup