mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-12-01 01:25:07 +08:00
🐛 fix USER bug
This commit is contained in:
parent
b6ec81c21d
commit
12c1f6d764
@ -141,8 +141,8 @@ def USER(*user: str, perm: Optional[Permission] = None):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
async def _user(bot: "Bot", event: "Event") -> bool:
|
async def _user(bot: "Bot", event: "Event") -> bool:
|
||||||
return bool(event.get_session_id() in user and perm and
|
return bool(event.get_session_id() in user and (perm is None or
|
||||||
await perm(bot, event))
|
await perm(bot, event)))
|
||||||
|
|
||||||
return Permission(_user)
|
return Permission(_user)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user