@@ -687,9 +687,9 @@ def send_video_note(self,
687687
688688 Args:
689689 chat_id (int|str): Unique identifier for the message recipient - Chat id.
690- voice : Video note to send. Pass a file_id as String to send a video note that exists
691- on the Telegram servers (recommended) or upload a new video. Sending video notes
692- by a URL is currently unsupported
690+ video_note (InputFile|str) : Video note to send. Pass a file_id as String to send a
691+ video note that exists on the Telegram servers (recommended) or upload a new video.
692+ Sending video notes by a URL is currently unsupported
693693 duration (Optional[int]): Duration of sent audio in seconds.
694694 length (Optional[int]): Video width and height
695695 disable_notification (Optional[bool]): Sends the message silently. iOS users will not
@@ -713,9 +713,9 @@ def send_video_note(self,
713713
714714 data = {'chat_id' : chat_id , 'video_note' : video_note }
715715
716- if duration :
716+ if duration is not None :
717717 data ['duration' ] = duration
718- if length :
718+ if length is not None :
719719 data ['length' ] = length
720720
721721 return self ._message_wrapper (
@@ -1906,23 +1906,23 @@ def send_invoice(self,
19061906 'prices' : [p .to_dict () for p in prices ]
19071907 }
19081908
1909- if photo_url :
1909+ if photo_url is not None :
19101910 data ['photo_url' ] = photo_url
1911- if photo_size :
1911+ if photo_size is not None :
19121912 data ['photo_size' ] = photo_size
1913- if photo_width :
1913+ if photo_width is not None :
19141914 data ['photo_width' ] = photo_width
1915- if photo_height :
1915+ if photo_height is not None :
19161916 data ['photo_height' ] = photo_height
1917- if need_name :
1917+ if need_name is not None :
19181918 data ['need_name' ] = need_name
1919- if need_phone_number :
1919+ if need_phone_number is not None :
19201920 data ['need_phone_number' ] = need_phone_number
19211921 if need_email :
19221922 data ['need_email' ] = need_email
1923- if need_shipping_address :
1923+ if need_shipping_address is not None :
19241924 data ['need_shipping_address' ] = need_shipping_address
1925- if is_flexible :
1925+ if is_flexible is not None :
19261926 data ['is_flexible' ] = is_flexible
19271927
19281928 return url , data
@@ -1944,12 +1944,12 @@ def answer_shipping_query(self,
19441944 ok (bool): Specify True if delivery to the specified address is possible and False if
19451945 there are any problems (for example, if delivery to the specified address
19461946 is not possible)
1947- shipping_options (List[:class:`telegram.ShippingOption`]): Required if ok is True. A
1948- list of available shipping options.
1949- error_message (str): Required if ok is False. Error message in human readable form
1950- that explains why it is impossible to complete the order (e.g. "Sorry, delivery
1951- to your desired address is unavailable'). Telegram will display this message
1952- to the user.
1947+ shipping_options (Optional[ List[:class:`telegram.ShippingOption`]] ): Required if ok is
1948+ True. A list of available shipping options.
1949+ error_message (Optional[ str] ): Required if ok is False. Error message in human readable
1950+ form that explains why it is impossible to complete the order (e.g. "Sorry,
1951+ delivery to your desired address is unavailable'). Telegram will display this
1952+ message to the user.
19531953 **kwargs (dict): Arbitrary keyword arguments.
19541954
19551955 Returns:
@@ -1976,7 +1976,7 @@ def answer_shipping_query(self,
19761976
19771977 if ok is True :
19781978 data ['shipping_options' ] = shipping_options
1979- if error_message :
1979+ if error_message is not None :
19801980 data ['error_message' ] = error_message
19811981
19821982 result = self ._request .post (url_ , data , timeout = timeout )
@@ -1994,11 +1994,11 @@ def answer_pre_checkout_query(self, pre_checkout_query_id, ok,
19941994 pre_checkout_query_id (str): Unique identifier for the query to be answered
19951995 ok (bool): Specify True if everything is alright (goods are available, etc.) and the
19961996 bot is ready to proceed with the order. Use False if there are any problems.
1997- error_message (str): Required if ok is False. Error message in human readable form that
1998- explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody
1999- just bought the last of our amazing black T-shirts while you were busy filling out
2000- your payment details. Please choose a different color or garment!"). Telegram will
2001- display this message to the user.
1997+ error_message (Optional[ str] ): Required if ok is False. Error message in human readable
1998+ form that explains the reason for failure to proceed with the checkout (e.g.
1999+ "Sorry, somebody just bought the last of our amazing black T-shirts while you were
2000+ busy filling out your payment details. Please choose a different color or
2001+ garment!"). Telegram will display this message to the user.
20022002 **kwargs (dict): Arbitrary keyword arguments.
20032003
20042004 Returns:
@@ -2020,7 +2020,7 @@ def answer_pre_checkout_query(self, pre_checkout_query_id, ok,
20202020
20212021 data = {'pre_checkout_query_id' : pre_checkout_query_id , 'ok' : ok }
20222022
2023- if error_message :
2023+ if error_message is not None :
20242024 data ['error_message' ] = error_message
20252025
20262026 result = self ._request .post (url_ , data , timeout = timeout )
0 commit comments