From 54ff5dbcc2fd13cbb3287d8f6c487fd4726a011a Mon Sep 17 00:00:00 2001 From: vision Date: Thu, 26 Dec 2024 23:16:05 +0800 Subject: [PATCH] fix: resolve display issue for replies containing only URLs --- bot/linkai/link_ai_bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/linkai/link_ai_bot.py b/bot/linkai/link_ai_bot.py index 95c514dae..52983513f 100644 --- a/bot/linkai/link_ai_bot.py +++ b/bot/linkai/link_ai_bot.py @@ -147,9 +147,9 @@ def _chat(self, query, context, retry_count=0) -> Reply: if response["choices"][0].get("img_urls"): thread = threading.Thread(target=self._send_image, args=(context.get("channel"), context, response["choices"][0].get("img_urls"))) thread.start() - if response["choices"][0].get("text_content"): - reply_content = response["choices"][0].get("text_content") - reply_content = self._process_url(reply_content) + reply_content = response["choices"][0].get("text_content") + if reply_content: + reply_content = self._process_url(reply_content) return Reply(ReplyType.TEXT, reply_content) else: