simplify edit message error handling

This commit is contained in:
ned
2022-12-11 17:29:03 +01:00
parent 56beac7465
commit 010022b0f6

View File

@@ -95,12 +95,6 @@ class ChatGPT3TelegramBot:
try:
if initial_message is not None and chunk_text != initial_message.text:
await initial_message.edit_text(chunk_text)
except RetryAfter as e:
logging.info(f'Rate limit exceeded, retrying in {e.retry_after} seconds')
await asyncio.sleep(e.retry_after)
except BadRequest:
# Failed to edit message (new=current), ignoring...
pass
except Exception as e:
logging.info(f'Error while editing the message: {str(e)}')