fix: pointer
This commit is contained in:
+6
-3
@@ -21,17 +21,20 @@ class TimerService:
|
||||
Second:int|None = None
|
||||
logger.info("[wait_msg]:开始解析模板")
|
||||
|
||||
chain = res.chain
|
||||
for i in chain :
|
||||
for index,i in enumerate(res.chain) :
|
||||
logger.info(f"获得消息链类型:{i.type}内容:{i}")
|
||||
if not isinstance(i,Plain) or i.type == "Plain":
|
||||
continue
|
||||
dump = Pattern(i.text)
|
||||
i.text = dump.string
|
||||
Second = dump.count
|
||||
# 改变信息
|
||||
res.chain[index] = i
|
||||
|
||||
event.set_result(res)
|
||||
if not Second is None:
|
||||
self.timer(event,Second)
|
||||
|
||||
return
|
||||
|
||||
|
||||
# 定时:
|
||||
|
||||
+2
-1
@@ -29,7 +29,7 @@ class Pattern:
|
||||
num = int(content)
|
||||
return self.sec_range(num)
|
||||
except:
|
||||
logger.debug ("模板内容错误:{}".format(content))
|
||||
logger.warning ("模板内容错误:{}".format(content))
|
||||
return None
|
||||
|
||||
def extract(self,o_str:str):
|
||||
@@ -47,6 +47,7 @@ class Pattern:
|
||||
#消除不完整/非法模板
|
||||
o_str= o_str.replace("<wt>","")
|
||||
o_str=o_str.replace("</wt>","")
|
||||
logger.info(f"过滤后消息:{o_str}")
|
||||
|
||||
return {
|
||||
"content":o_str,
|
||||
|
||||
Reference in New Issue
Block a user