🎨 impove typing

This commit is contained in:
yanyongyu
2020-12-07 00:06:09 +08:00
parent 629eed08b6
commit 6b3f6a46e6
27 changed files with 60 additions and 137 deletions

View File

@ -1,18 +1,18 @@
from nonebot.rule import to_me
from nonebot.typing import Event
from nonebot.typing import State
from nonebot.plugin import on_startswith
from nonebot.adapters.cqhttp import Bot
from nonebot.adapters.ding import Bot as DingBot, Event as DingEvent
from nonebot.permission import GROUP_ADMIN
from nonebot.adapters.ding import Bot as DingBot, Event as DingEvent
from nonebot.adapters.cqhttp import Bot as CQHTTPBot, Event as CQHTTPEvent
test_command = on_startswith("hello", to_me(), permission=GROUP_ADMIN)
@test_command.handle()
async def test_handler(bot: Bot, event: Event, state: dict):
async def test_handler(bot: CQHTTPBot, event: CQHTTPEvent, state: State):
await test_command.finish("cqhttp hello")
@test_command.handle()
async def test_handler(bot: DingBot, event: DingEvent, state: dict):
async def test_handler(bot: DingBot, event: DingEvent, state: State):
await test_command.finish("ding hello")