nonebot2/tests/test_plugins/test_permission.py
2020-10-20 22:40:16 +08:00

13 lines
385 B
Python

from nonebot.rule import to_me
from nonebot.typing import Event
from nonebot.plugin import on_startswith
from nonebot.adapters.cqhttp import Bot
from nonebot.permission import GROUP_ADMIN
test_command = on_startswith("hello", to_me(), permission=GROUP_ADMIN)
@test_command.handle()
async def test_handler(bot: Bot, event: Event, state: dict):
await test_command.finish("hello")