update code

This commit is contained in:
HibiKier
2021-09-05 02:21:38 +08:00
parent 21a5feda43
commit 7afb099c12
84 changed files with 3377 additions and 1404 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ async def _(bot: Bot, event: MessageEvent, state: T_State):
result = await get_chat_result(msg, img, event.user_id, nickname)
logger.info(
f"USER {event.user_id} GROUP {event.group_id if not isinstance(event, PrivateMessageEvent) else ''} "
f"问题:{msg}\n回答:{result}"
f"问题:{msg} ---- 回答:{result}"
)
if result:
await ai.finish(Message(result))
+3 -2
View File
@@ -23,7 +23,6 @@ index = 0
anime_data = json.load(open(DATA_PATH + "anime.json", "r", encoding="utf8"))
# 图灵AI
async def get_chat_result(text: str, img_url: str, user_id: int, nickname: str) -> str:
global index
if index == 5:
@@ -104,7 +103,9 @@ async def xie_ai(text: str, sess: ClientSession):
if data["result"] == 0:
content = data["content"]
if "菲菲" in content:
content = content.replace("菲菲", f"{NICKNAME}")
content = content.replace("菲菲", NICKNAME)
if '艳儿' in content:
content = content.replace('艳儿', NICKNAME)
if "公众号" in content:
content = ""
if "{br}" in content: