🏷️ Add typing for cqhttp api

This commit is contained in:
yanyongyu
2020-08-26 17:47:36 +08:00
parent 24e03ed0e7
commit 777343ac1a
6 changed files with 688 additions and 9 deletions

View File

@ -16,8 +16,7 @@ async def test_handler(bot: Bot, event: Event, state: dict):
if args:
state["help"] = args
else:
await bot.send_private_msg(message="命令:\n1. test1\n2. test2",
user_id=event.user_id)
await bot.send(message="命令:\n1. test1\n2. test2", event=event)
@test_command.got("help", prompt="你要帮助的命令是?")
@ -25,4 +24,4 @@ async def test_handler(bot: Bot, event: Event, state: dict):
print("[!] Command 帮助:", state["help"])
if state["help"] not in ["test1", "test2"]:
await test_command.reject(f"{state['help']} 不支持,请重新输入!")
await bot.send_private_msg(message=f"{state['help']} 帮助:\n...")
await bot.send(message=f"{state['help']} 帮助:\n...", event=event)