mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-11 06:39:59 +08:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -277,6 +277,11 @@ PS: **ARM平台** 请使用全量版 同时 **如果你的机器 RAM < 1G 可能
|
|||||||
|
|
||||||
## 更新
|
## 更新
|
||||||
|
|
||||||
|
### 2022/8/26
|
||||||
|
|
||||||
|
* 修复群管理员无法添加词条
|
||||||
|
* 修复词条关键词"问"前空格问题
|
||||||
|
|
||||||
### 2022/8/23
|
### 2022/8/23
|
||||||
|
|
||||||
* 修了下模糊匹配 issue#1026 [@pull/1026](https://github.com/HibiKier/zhenxun_bot/pull/1026)
|
* 修了下模糊匹配 issue#1026 [@pull/1026](https://github.com/HibiKier/zhenxun_bot/pull/1026)
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ async def _(
|
|||||||
state: T_State,
|
state: T_State,
|
||||||
reg_group: Tuple[Any, ...] = RegexGroup(),
|
reg_group: Tuple[Any, ...] = RegexGroup(),
|
||||||
):
|
):
|
||||||
if str(event.user_id) not in bot.config.superusers:
|
if isinstance(event, PrivateMessageEvent) and str(event.user_id) not in bot.config.superusers:
|
||||||
await add_word.finish('权限不足捏')
|
await add_word.finish('权限不足捏')
|
||||||
word_scope, word_type, problem, answer = reg_group
|
word_scope, word_type, problem, answer = reg_group
|
||||||
if (
|
if (
|
||||||
@@ -130,8 +130,9 @@ async def _(
|
|||||||
problem = temp
|
problem = temp
|
||||||
break
|
break
|
||||||
problem = unescape(problem)
|
problem = unescape(problem)
|
||||||
index = len((word_scope or "") + "添加词条" + (word_type or "") + problem) + 1
|
# index = len((word_scope or "") + "添加词条" + (word_type or "") + problem) + 1
|
||||||
event.message[0] = event.message[0].data["text"][index + 1 :].strip()
|
# event.message[0] = event.message[0].data["text"][index + 1 :].strip()
|
||||||
|
event.message[0] = event.message[0].data["text"].split('答', maxsplit=1)[-1].strip()
|
||||||
state["word_scope"] = word_scope
|
state["word_scope"] = word_scope
|
||||||
state["word_type"] = word_type
|
state["word_type"] = word_type
|
||||||
state["problem"] = problem
|
state["problem"] = problem
|
||||||
|
|||||||
Reference in New Issue
Block a user