finish typing change

This commit is contained in:
yanyongyu
2020-12-17 21:09:30 +08:00
parent 6bd69e6708
commit 799144e64d
19 changed files with 309 additions and 315 deletions

View File

@ -1,14 +1,14 @@
from nonebot.rule import to_me
from nonebot.typing import State
from nonebot.typing import T_State
from nonebot.plugin import on_command
from nonebot.adapters.cqhttp import Bot, Event
from nonebot.adapters import Bot, Event
test_command = on_command("帮助", to_me())
@test_command.handle()
async def test_handler(bot: Bot, event: Event, state: State):
args = str(event.message).strip()
async def test_handler(bot: Bot, event: Event, state: T_State):
args = str(event.get_message()).strip()
print("[!] Command:", state["_prefix"], "Args:", args)
if args:
state["help"] = args
@ -17,7 +17,7 @@ async def test_handler(bot: Bot, event: Event, state: State):
@test_command.got("help", prompt="你要帮助的命令是?")
async def test_handler(bot: Bot, event: Event, state: State):
async def test_handler(bot: Bot, event: Event, state: T_State):
print("[!] Command 帮助:", state["help"])
if state["help"] not in ["test1", "test2"]:
await test_command.reject(f"{state['help']} 不支持,请重新输入!")