🐛 fix matcher

This commit is contained in:
yanyongyu 2021-02-02 12:48:16 +08:00
parent 98b67ad829
commit d913be5c0d

View File

@ -167,8 +167,9 @@ class Matcher(metaclass=MatcherMeta):
rule or Rule(),
"permission":
permission or Permission(),
"handlers":
handlers or [],
"handlers": [
cls.process_handler(handler) for handler in handlers
] if handlers else [],
"temp":
temp,
"expire_time":
@ -204,7 +205,9 @@ class Matcher(metaclass=MatcherMeta):
- ``bool``: 是否满足权限
"""
return await cls.permission(bot, event)
event_type = event.get_type()
return (event_type == (cls.type or event_type) and
await cls.permission(bot, event))
@classmethod
async def check_rule(cls, bot: "Bot", event: "Event",