INNER CODE UNIT · Python
clean_eva_output
usepr/eva · showcase/wechat-bot/bot.py:25
def clean_eva_output(out: str):
eva_s = "[*] EVA:"
if eva_s in out:
out = out[out.rindex(eva_s)+len(eva_s):]
session_s = "> 会话已保存到:"
if session_s in out:
out = out[:out.rindex(session_s)]
return out.strip().replace('\033[2m', '').replace('\033[0m', '\n\n___\n')
bot = WeChatBot()
@bot.on_message
async def handle(msg):
await bot.send_typing(msg.user_id)
text = msg.text.strip()