mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 00:55:07 +08:00
🐛 fix state error when matcher update(fix #397)
This commit is contained in:
parent
accbf57776
commit
830276d110
@ -587,13 +587,21 @@ class Matcher(metaclass=MatcherMeta):
|
||||
self.handlers.insert(0, handler) # type: ignore
|
||||
updater = self.__class__._default_type_updater
|
||||
if updater:
|
||||
type_ = await updater(bot, event, state, self.type)
|
||||
type_ = await updater(
|
||||
bot,
|
||||
event,
|
||||
state_, # type: ignore
|
||||
self.type)
|
||||
else:
|
||||
type_ = "message"
|
||||
|
||||
updater = self.__class__._default_permission_updater
|
||||
if updater:
|
||||
permission = await updater(bot, event, state, self.permission)
|
||||
permission = await updater(
|
||||
bot,
|
||||
event,
|
||||
state_, # type: ignore
|
||||
self.permission)
|
||||
else:
|
||||
permission = USER(event.get_session_id(), perm=self.permission)
|
||||
|
||||
@ -615,13 +623,21 @@ class Matcher(metaclass=MatcherMeta):
|
||||
except PausedException:
|
||||
updater = self.__class__._default_type_updater
|
||||
if updater:
|
||||
type_ = await updater(bot, event, state, self.type)
|
||||
type_ = await updater(
|
||||
bot,
|
||||
event,
|
||||
state_, # type: ignore
|
||||
self.type)
|
||||
else:
|
||||
type_ = "message"
|
||||
|
||||
updater = self.__class__._default_permission_updater
|
||||
if updater:
|
||||
permission = await updater(bot, event, state, self.permission)
|
||||
permission = await updater(
|
||||
bot,
|
||||
event,
|
||||
state_, # type: ignore
|
||||
self.permission)
|
||||
else:
|
||||
permission = USER(event.get_session_id(), perm=self.permission)
|
||||
|
||||
|
@ -11,6 +11,8 @@ sidebar: auto
|
||||
- 修改 `Matcher` 属性 `module` 类型
|
||||
- 新增 `Matcher` 属性 `plugin_name` `module_name` `module_prefix`
|
||||
- 移除 `bot.call_api` 参数 `self_id` 切换机器人支持
|
||||
- 修复 `type_updater` `permission_updater` 未传递的错误
|
||||
- 修复 `type_updater` `permission_updater` 参数 `state` 错误
|
||||
|
||||
## v2.0.0a13.post1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user