fix: pointer

This commit is contained in:
Wbucket
2026-11-06 22:41:33 +08:00
parent a7c4925106
commit 8ce5aa8847
2 changed files with 9 additions and 5 deletions
+6 -3
View File
@@ -21,17 +21,20 @@ class TimerService:
Second:int|None = None Second:int|None = None
logger.info("[wait_msg]:开始解析模板") logger.info("[wait_msg]:开始解析模板")
chain = res.chain for index,i in enumerate(res.chain) :
for i in chain :
logger.info(f"获得消息链类型:{i.type}内容:{i}") logger.info(f"获得消息链类型:{i.type}内容:{i}")
if not isinstance(i,Plain) or i.type == "Plain": if not isinstance(i,Plain) or i.type == "Plain":
continue continue
dump = Pattern(i.text) dump = Pattern(i.text)
i.text = dump.string i.text = dump.string
Second = dump.count Second = dump.count
# 改变信息
res.chain[index] = i
event.set_result(res)
if not Second is None: if not Second is None:
self.timer(event,Second) self.timer(event,Second)
return
# 定时: # 定时:
+2 -1
View File
@@ -29,7 +29,7 @@ class Pattern:
num = int(content) num = int(content)
return self.sec_range(num) return self.sec_range(num)
except: except:
logger.debug ("模板内容错误:{}".format(content)) logger.warning ("模板内容错误:{}".format(content))
return None return None
def extract(self,o_str:str): def extract(self,o_str:str):
@@ -47,6 +47,7 @@ class Pattern:
#消除不完整/非法模板 #消除不完整/非法模板
o_str= o_str.replace("<wt>","") o_str= o_str.replace("<wt>","")
o_str=o_str.replace("</wt>","") o_str=o_str.replace("</wt>","")
logger.info(f"过滤后消息:{o_str}")
return { return {
"content":o_str, "content":o_str,