fix several bugs

This commit is contained in:
yanyongyu
2020-08-24 17:59:36 +08:00
parent 599844d3ca
commit eaa9b98bd9
7 changed files with 53 additions and 22 deletions

View File

@ -1,8 +1,8 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from nonebot.plugin import on_metaevent
from nonebot.typing import Bot, Event
from nonebot.plugin import on_metaevent
async def heartbeat(bot: Bot, event: Event, state: dict) -> bool:

View File

@ -11,8 +11,8 @@ test_command = on_command("帮助", to_me())
@test_command.handle()
async def test_handler(bot: Bot, event: Event, state: dict):
print("[!] Command:", state["_prefix"])
args = str(event.message)[len(state["_prefix"]):].strip()
args = str(event.message)[len(list(state["_prefix"].keys())[0]):].strip()
print("[!] Command:", state["_prefix"], "Args:", args)
if args:
state["help"] = args
else: