From 0b56f14aabf06b7492ac43db1d5ee343a4d54016 Mon Sep 17 00:00:00 2001 From: spla Date: Thu, 26 Jan 2023 13:11:36 +0100 Subject: [PATCH] =?UTF-8?q?Sol=C2=B7luciona=20l'incid=C3=A8ncia=20#1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mastobot.py | 3 ++- xatapi.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mastobot.py b/mastobot.py index 244a4c9..a50334c 100644 --- a/mastobot.py +++ b/mastobot.py @@ -16,6 +16,7 @@ def cleanhtml(raw_html): def unescape(s): s = s.replace("'", "'") + s = s.replace("'", "'") return s def replying(): @@ -105,7 +106,7 @@ if __name__ == '__main__': if reply == True: - prompt = query_word + prompt = unescape(query_word) if prompt[:7] == 'imatge:': diff --git a/xatapi.py b/xatapi.py index 4ff011c..fe447ab 100644 --- a/xatapi.py +++ b/xatapi.py @@ -193,7 +193,8 @@ class Xat: elif response.status_code == 502: ex_type = OpenaiBadGatewayError elif response.status_code == 503: - ex_type = OpenaiServiceUnavailableError + #ex_type = OpenaiServiceUnavailableError + return response elif response.status_code == 504: ex_type = OpenaiGatewayTimeoutError elif response.status_code >= 500 and \