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 \