mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 08:12:14 +08:00
16 lines
433 B
Python
16 lines
433 B
Python
|
#!/usr/bin/env python3
|
||
|
# -*- coding: utf-8 -*-
|
||
|
|
||
|
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")
|