See quotet 'none' and 'null' also as None answer.

This commit is contained in:
OK 2023-04-10 14:34:38 +02:00
parent e6f43b44de
commit 961e70f17e

View File

@ -116,7 +116,8 @@ class AIResponder(object):
async def post_process(self, message: AIMessage, response: Dict[str, Any]) -> AIResponse:
for fld in ('answer', 'staff', 'picture'):
if str(response[fld]).strip().lower() in ('none', '', 'null'):
if str(response[fld]).strip().lower() in \
('none', '', 'null', '"none"', '"null"', "'none'", "'null'"):
response[fld] = None
for fld in ('answer_needed', 'hack'):
if str(response[fld]).strip().lower() == 'true':