Queer European MD passionate about IT
소스 검색

Avoid second try, as it is useless

If first try fails, why should a second try succeed?
Davte 5 년 전
부모
커밋
4036971302
1개의 변경된 파일1개의 추가작업 그리고 18개의 파일을 삭제
  1. 1 18
      davtelepot/bot.py

+ 1 - 18
davtelepot/bot.py

@@ -745,8 +745,7 @@ class Bot(TelegramBot, ObjectWithDatabase):
                          update=dict(),
                          reply_to_update=False,
                          send_default_keyboard=True,
-                         use_stored_file_id=True,
-                         is_second_try=False):
+                         use_stored_file_id=True):
         """Send photos.
 
         This method wraps lower-level `TelegramBot.sendPhoto` method.
@@ -829,22 +828,6 @@ class Bot(TelegramBot, ObjectWithDatabase):
                         ),
                         ['path']
                     )
-                if not is_second_try:
-                    logging.info("Trying again (only once)...")
-                    sent_update = await self.send_photo(
-                        chat_id=chat_id,
-                        photo=photo,
-                        caption=caption,
-                        parse_mode=parse_mode,
-                        disable_notification=disable_notification,
-                        reply_to_message_id=reply_to_message_id,
-                        reply_markup=reply_markup,
-                        update=update,
-                        reply_to_update=reply_to_update,
-                        send_default_keyboard=send_default_keyboard,
-                        use_stored_file_id=use_stored_file_id,
-                        is_second_try=True
-                    )
         if (
             type(sent_update) is dict
             and 'photo' in sent_update