From 2724713988fb6c7715912baf25cd2100c13a1396 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 6 Aug 2021 02:43:17 +0200 Subject: [PATCH] fix handle error --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index a12c011..b900003 100644 --- a/main.py +++ b/main.py @@ -99,8 +99,8 @@ class Listener(StreamListener): self.api.update_status(status = choice(answer), in_reply_to_status_id = status._json["id"], auto_populate_reply_metadata = True) print(f"{status._json['user']['screen_name']} s'est fait {answer[0]} !") except Exception as error: - if error[0]["code"] == 385: - error[0]['message'] = "Tweet supprimé ou auteur en privé/bloqué." + if error.message[0]["code"] == 385: + error.message[0]['message'] = "Tweet supprimé ou auteur en privé/bloqué." print(f"{errorMessage[:-2]} ({error[0]['code']}) ! {error[0]['message']}") else: if keys["VERBOSE"]: