mirror of
				https://github.com/nonebot/nonebot2.git
				synced 2025-11-04 00:46:43 +00:00 
			
		
		
		
	📝 fix docs call Permission wrong (#1072)
				
					
				
			This commit is contained in:
		@@ -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("群员测试成功")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user