From dbc6bc0f43d1663dd155fa3a5e1188ba4fc7b3e3 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Fri, 9 Sep 2022 16:16:31 -0600 Subject: [PATCH] Fix W|A bug and improve error message --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 2980565..8fdf465 100755 --- a/main.py +++ b/main.py @@ -147,7 +147,7 @@ def think_send(query): if len(result) > 500: result = result[:500] + '... truncated.' - elif len(result) == 0 and not img_url: + elif len(result) == 0: result = 'Error' result = result.replace('Wolfram|Alpha', 'Protovac') @@ -163,6 +163,9 @@ def think_send(query): if '(although' in result: result = result.split('(although')[0] + if result == 'Error': + result = 'INSUFFICIENT DATA FOR A MEANINGFUL ANSWER.' + return result skip_input = False