From be0bb591e71a54cc43488a4d0c9dca51646d229c Mon Sep 17 00:00:00 2001 From: zhayujie Date: Sat, 9 Dec 2023 17:12:08 +0800 Subject: [PATCH] fix: do not draw when text_to_image is empty --- bot/linkai/link_ai_bot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bot/linkai/link_ai_bot.py b/bot/linkai/link_ai_bot.py index cd743b4..c9afa71 100644 --- a/bot/linkai/link_ai_bot.py +++ b/bot/linkai/link_ai_bot.py @@ -32,6 +32,9 @@ class LinkAIBot(Bot): if context.type == ContextType.TEXT: return self._chat(query, context) elif context.type == ContextType.IMAGE_CREATE: + if not conf().get("text_to_image"): + logger.warn("[LinkAI] text_to_image is not enabled, ignore the IMAGE_CREATE request") + return Reply(ReplyType.TEXT, "") ok, res = self.create_img(query, 0) if ok: reply = Reply(ReplyType.IMAGE_URL, res)