From beb19adad5bcd0fa9aff5408ac522015f6098bd7 Mon Sep 17 00:00:00 2001 From: MingxuanGame Date: Thu, 30 Jun 2022 12:19:10 +0800 Subject: [PATCH] :memo: fix docs call `Permission` wrong (#1072) --- website/docs/advanced/permission.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/docs/advanced/permission.md b/website/docs/advanced/permission.md index 3a73b29a..8159329a 100644 --- a/website/docs/advanced/permission.md +++ b/website/docs/advanced/permission.md @@ -45,16 +45,16 @@ async def _(): ```python from nonebot import on_command -from nonebot.adapters.onebot.v11 import GroupMessageEvent +from nonebot.adapters.onebot.v11 import Bot, GroupMessageEvent from nonebot.adapters.onebot.v11 import GROUP_ADMIN, GROUP_OWNER matcher = on_command("测试权限") @matcher.handle() -async def _(event: GroupMessageEvent): - if await GROUP_ADMIN(event): +async def _(bot: Bot, event: GroupMessageEvent): + if await GROUP_ADMIN(bot, event): await matcher.send("管理员测试成功") - elif await GROUP_OWNER(event): + elif await GROUP_OWNER(bot, event): await matcher.send("群主测试成功") else: await matcher.send("群员测试成功")