dev logger

This commit is contained in:
Wbucket
2026-11-05 21:51:44 +08:00
parent 4512c4a4cc
commit 0a17dc8a43
2 changed files with 6 additions and 1 deletions
+2
View File
@@ -45,6 +45,8 @@ class MyPlugin(Star):
async def pattern_extract(self,event:AstrMessageEvent,req:LLMResponse):
if not req.role == 'assistant':
return
logger.info("[wait_msg]:开始解析模板")
llm_res = req.completion_text
dump = Pattern(llm_res)
await event.send(MessageChain().message("awa定时时间消息:{0}过滤后:{1}".format(dump.count,dump.string)))
+4 -1
View File
@@ -1,5 +1,5 @@
import re
from astrbot.api import logger
class Pattern:
_pattern = r'<wt>((?!wt).)*</wt>'
@@ -27,6 +27,7 @@ class Pattern:
num = int(content)
return self.sec_range(num)
except:
logger.debug ("[wait_msg]:模板内容错误:{}".format(content))
return None
def extract(self,o_str:str):
@@ -42,6 +43,8 @@ class Pattern:
#消除不完整/非法模板
o_str= o_str.replace("<wt>","")
o_str=o_str.replace("</wt>","")
logger.info("[wait_msg]:获得模板:{0}s".format(timerSec))
return {
"content":o_str,
"second":timerSec