fail gracefully when trying to delete /price command resposne messages
This commit is contained in:
parent
0df85d831e
commit
b52d67076a
12
bot.py
12
bot.py
@ -668,10 +668,14 @@ class TelegramMonitorBot:
|
|||||||
and self.last_message_out.get('type') == 'price'
|
and self.last_message_out.get('type') == 'price'
|
||||||
and self.last_message_out['message'].message_id
|
and self.last_message_out['message'].message_id
|
||||||
):
|
):
|
||||||
bot.delete_message(
|
try:
|
||||||
chat_id,
|
bot.delete_message(
|
||||||
self.last_message_out['message'].message_id
|
chat_id,
|
||||||
)
|
self.last_message_out['message'].message_id
|
||||||
|
)
|
||||||
|
except Exception as err:
|
||||||
|
print('Unable to delete previous price message: ', err)
|
||||||
|
print(traceback.format_exc())
|
||||||
|
|
||||||
self.last_message_out = {
|
self.last_message_out = {
|
||||||
'type': 'price',
|
'type': 'price',
|
||||||
|
Loading…
Reference in New Issue
Block a user