@@ -6273,8 +6273,9 @@ def delete_sticker_set(self, name:str) -> bool:
62736273 """
62746274 return apihelper .delete_sticker_set (self .token , name )
62756275
6276- def send_gift (self , gift_id : str , user_id : Optional [Union [str , int ]] = None , chat_id : Optional [Union [str , int ]] = None , text : Optional [str ]= None , text_parse_mode : Optional [str ]= None ,
6277- text_entities : Optional [List [types .MessageEntity ]]= None , pay_for_upgrade : Optional [bool ]= None ) -> bool :
6276+ def send_gift (self , user_id : Optional [Union [str , int ]] = None , gift_id : str = None , text : Optional [str ]= None , text_parse_mode : Optional [str ]= None ,
6277+ text_entities : Optional [List [types .MessageEntity ]]= None , pay_for_upgrade : Optional [bool ]= None ,
6278+ chat_id : Optional [Union [str , int ]] = None ) -> bool :
62786279 """
62796280 Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns True on success.
62806281
@@ -6308,6 +6309,9 @@ def send_gift(self, gift_id: str, user_id: Optional[Union[str, int]] = None, cha
63086309 if user_id is None and chat_id is None :
63096310 raise ValueError ("Either user_id or chat_id must be specified." )
63106311
6312+ if gift_id is None :
6313+ raise ValueError ("gift_id must be specified." )
6314+
63116315 return apihelper .send_gift (self .token , gift_id , text = text , text_parse_mode = text_parse_mode , text_entities = text_entities ,
63126316 pay_for_upgrade = pay_for_upgrade , chat_id = chat_id , user_id = user_id )
63136317
0 commit comments