🔧 change command and add builtin plugin

This commit is contained in:
yanyongyu
2020-08-29 21:59:36 +08:00
parent def5caedbc
commit f5b655ef71
6 changed files with 79 additions and 21 deletions

View File

@ -7,10 +7,22 @@ import sys
sys.path.insert(0, os.path.abspath(".."))
import nonebot
from nonebot.log import logger, default_format
# test custom log
logger.add("error.log",
rotation="00:00",
diagnose=False,
level="ERROR",
format=default_format)
nonebot.init()
app = nonebot.get_asgi()
# load builtin plugin
nonebot.load_plugin("nonebot.plugins.base")
# load local plugins
nonebot.load_plugins("test_plugins")
if __name__ == "__main__":

View File

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