From 4036971302a20172cfefd193d011edde9ec3aa01 Mon Sep 17 00:00:00 2001 From: Davte Date: Wed, 3 Jul 2019 19:13:53 +0200 Subject: [PATCH] Avoid second try, as it is useless If first try fails, why should a second try succeed? --- davtelepot/bot.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/davtelepot/bot.py b/davtelepot/bot.py index d1604d1..6bd7f9f 100644 --- a/davtelepot/bot.py +++ b/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