mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
fix🐛: 修复词条回答包含at时使用模糊|正则等问时无法正确匹配问题
This commit is contained in:
parent
38abb74c4c
commit
0a4df8296e
@ -331,6 +331,10 @@ PS: **ARM平台** 请使用全量版 同时 **如果你的机器 RAM < 1G 可能
|
|||||||
|
|
||||||
## 更新
|
## 更新
|
||||||
|
|
||||||
|
### 2022/8/20
|
||||||
|
|
||||||
|
* 修复词条回答包含at时使用模糊|正则等问时无法正确匹配问题
|
||||||
|
|
||||||
### 2023/8/7
|
### 2023/8/7
|
||||||
|
|
||||||
* 添加 本地图库插件 防吞图特性 [@pull/1468](https://github.com/HibiKier/zhenxun_bot/pull/1468)
|
* 添加 本地图库插件 防吞图特性 [@pull/1468](https://github.com/HibiKier/zhenxun_bot/pull/1468)
|
||||||
|
|||||||
@ -134,9 +134,10 @@ async def _(
|
|||||||
answer = ""
|
answer = ""
|
||||||
problem = ""
|
problem = ""
|
||||||
for index, seg in enumerate(event.message):
|
for index, seg in enumerate(event.message):
|
||||||
if seg.type == "text" and "添加词条问" in str(seg) and is_first:
|
r = re.search("添加词条(模糊|正则|图片)?问", str(seg))
|
||||||
|
if seg.type == "text" and r and is_first:
|
||||||
is_first = False
|
is_first = False
|
||||||
seg_ = str(seg).split("添加词条问")[-1]
|
seg_ = str(seg).split(f"添加词条{r.group(1) or ''}问")[-1]
|
||||||
cur_p = "problem"
|
cur_p = "problem"
|
||||||
# 纯文本
|
# 纯文本
|
||||||
if "答" in seg_:
|
if "答" in seg_:
|
||||||
@ -302,7 +303,9 @@ async def _(bot: Bot, event: GroupMessageEvent, arg: Message = CommandArg()):
|
|||||||
):
|
):
|
||||||
await show_word_matcher.finish("gid必须为数字且在范围内")
|
await show_word_matcher.finish("gid必须为数字且在范围内")
|
||||||
gid = int(gid)
|
gid = int(gid)
|
||||||
msg_list = await show_word(problem, id_, gid, None if gid else str(event.group_id))
|
msg_list = await show_word(
|
||||||
|
problem, id_, gid, None if gid else str(event.group_id)
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
msg_list = await show_word(problem, None, None, str(event.group_id))
|
msg_list = await show_word(problem, None, None, str(event.group_id))
|
||||||
if isinstance(msg_list, str):
|
if isinstance(msg_list, str):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user