添加历史存档读取的功能

This commit is contained in:
binary-husky
2023-04-29 00:00:26 +08:00
parent c295bb4f04
commit 6c17f3e9c8
4 changed files with 146 additions and 11 deletions

View File

@@ -90,8 +90,9 @@ def CatchException(f):
from toolbox import get_conf
proxies, = get_conf('proxies')
tb_str = '```\n' + trimmed_format_exc() + '```'
if chatbot is None or len(chatbot) == 0:
chatbot = [["插件调度异常", "异常原因"]]
if len(chatbot) == 0:
chatbot.clear()
chatbot.append(["插件调度异常", "异常原因"])
chatbot[-1] = (chatbot[-1][0],
f"[Local Message] 实验性函数调用出错: \n\n{tb_str} \n\n当前代理可用性: \n\n{check_proxy(proxies)}")
yield from update_ui(chatbot=chatbot, history=history, msg=f'异常 {e}') # 刷新界面