From 35f99c849f5e9ba9a0e89ce20cff106c13aa92b4 Mon Sep 17 00:00:00 2001 From: lzzy12 Date: Tue, 15 Oct 2019 21:41:04 +0530 Subject: [PATCH] Handle an crash when user deletes the bot message manually Signed-off-by: lzzy12 --- bot/modules/mirror.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/modules/mirror.py b/bot/modules/mirror.py index 0f45241..9fe9ed1 100644 --- a/bot/modules/mirror.py +++ b/bot/modules/mirror.py @@ -141,7 +141,10 @@ def _mirror(update, context, isTar=False): index = update.effective_chat.id with status_reply_dict_lock: if index in status_reply_dict.keys(): - deleteMessage(context, status_reply_dict[index]) + try: + deleteMessage(context, status_reply_dict[index]) + except BadRequest: + pass status_reply_dict[index] = reply_msg listener = MirrorListener(context, update, reply_msg, isTar) aria = download_tools.DownloadHelper(listener)