@@ -973,11 +973,11 @@ def create_chat_invite_link(token, chat_id, expire_date, member_limit):
973973 }
974974
975975 if expire_date is not None :
976- payload ['expire_date' ] = expire_date
977976 if isinstance (payload ['expire_date' ], datetime ):
978977 payload ['expire_date' ] = payload ['expire_date' ].timestamp ()
979-
980- if member_limit is not None :
978+ else :
979+ payload ['expire_date' ] = expire_date
980+ if member_limit :
981981 payload ['member_limit' ] = member_limit
982982
983983 return _make_request (token , method_url , params = payload , method = 'post' )
@@ -991,9 +991,10 @@ def edit_chat_invite_link(token, chat_id, invite_link, expire_date, member_limit
991991 }
992992
993993 if expire_date is not None :
994- payload ['expire_date' ] = expire_date
995994 if isinstance (payload ['expire_date' ], datetime ):
996995 payload ['expire_date' ] = payload ['expire_date' ].timestamp ()
996+ else :
997+ payload ['expire_date' ] = expire_date
997998
998999 if member_limit is not None :
9991000 payload ['member_limit' ] = member_limit
@@ -1258,7 +1259,7 @@ def get_game_high_scores(token, user_id, chat_id=None, message_id=None, inline_m
12581259
12591260def send_invoice (
12601261 token , chat_id , title , description , invoice_payload , provider_token , currency , prices ,
1261- start_parameter , photo_url = None , photo_size = None , photo_width = None , photo_height = None ,
1262+ start_parameter = None , photo_url = None , photo_size = None , photo_width = None , photo_height = None ,
12621263 need_name = None , need_phone_number = None , need_email = None , need_shipping_address = None ,
12631264 send_phone_number_to_provider = None , send_email_to_provider = None , is_flexible = None ,
12641265 disable_notification = None , reply_to_message_id = None , reply_markup = None , provider_data = None ,
@@ -1298,8 +1299,10 @@ def send_invoice(
12981299 """
12991300 method_url = r'sendInvoice'
13001301 payload = {'chat_id' : chat_id , 'title' : title , 'description' : description , 'payload' : invoice_payload ,
1301- 'provider_token' : provider_token , 'start_parameter' : start_parameter , ' currency' : currency ,
1302+ 'provider_token' : provider_token , 'currency' : currency ,
13021303 'prices' : _convert_list_json_serializable (prices )}
1304+ if start_parameter :
1305+ payload ['start_parameter' ] = start_parameter
13031306 if photo_url :
13041307 payload ['photo_url' ] = photo_url
13051308 if photo_size :
0 commit comments