@@ -346,24 +346,24 @@ def forward_message(
346346
347347
348348def copy_message (token , chat_id , from_chat_id , message_id , caption = None , parse_mode = None , caption_entities = None ,
349- reply_to_message_id = None , allow_sending_without_reply = None , reply_markup = None ,
350- disable_notification = None , timeout = None ):
349+ disable_notification = None , reply_to_message_id = None , allow_sending_without_reply = None ,
350+ reply_markup = None , timeout = None ):
351351 method_url = r'copyMessage'
352352 payload = {'chat_id' : chat_id , 'from_chat_id' : from_chat_id , 'message_id' : message_id }
353353 if caption is not None :
354354 payload ['caption' ] = caption
355- if parse_mode is not None :
355+ if parse_mode :
356356 payload ['parse_mode' ] = parse_mode
357357 if caption_entities is not None :
358358 payload ['caption_entities' ] = _convert_entites (caption_entities )
359- if reply_to_message_id is not None :
359+ if disable_notification is not None :
360+ payload ['disable_notification' ] = disable_notification
361+ if reply_to_message_id :
360362 payload ['reply_to_message_id' ] = reply_to_message_id
361363 if reply_markup is not None :
362364 payload ['reply_markup' ] = _convert_markup (reply_markup )
363365 if allow_sending_without_reply is not None :
364366 payload ['allow_sending_without_reply' ] = allow_sending_without_reply
365- if disable_notification is not None :
366- payload ['disable_notification' ] = disable_notification
367367 if timeout :
368368 payload ['connect-timeout' ] = timeout
369369 return _make_request (token , method_url , params = payload )
@@ -1337,9 +1337,14 @@ def _convert_markup(markup):
13371337
13381338
13391339def _convert_entites (entites ):
1340- if isinstance (entites [0 ], types .JsonSerializable ):
1340+ if entites is None :
1341+ return None
1342+ elif len (entites ) == 0 :
1343+ return []
1344+ elif isinstance (entites [0 ], types .JsonSerializable ):
13411345 return [entity .to_json () for entity in entites ]
1342- return entites
1346+ else :
1347+ return entites
13431348
13441349
13451350def convert_input_media (media ):
0 commit comments