summaryrefslogtreecommitdiff
path: root/ATRI/plugins/help.py
diff options
context:
space:
mode:
Diffstat (limited to 'ATRI/plugins/help.py')
-rw-r--r--ATRI/plugins/help.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/ATRI/plugins/help.py b/ATRI/plugins/help.py
index d2754b1..32d3f65 100644
--- a/ATRI/plugins/help.py
+++ b/ATRI/plugins/help.py
@@ -7,7 +7,7 @@ from ATRI.service import SERVICE_DIR
from ATRI.service import Service as sv
-SERVICE_DIR = SERVICE_DIR / "services"
+SERVICE_DIR = SERVICE_DIR / 'services'
__doc__ = """
@@ -19,12 +19,14 @@ __doc__ = """
/help info (cmd)
"""
-help = sv.on_command(cmd="/help", docs=__doc__)
-
+help = sv.on_command(
+ cmd="/help",
+ docs=__doc__
+)
@help.handle()
async def _help(bot: Bot, event: MessageEvent) -> None:
- msg = str(event.message).split(" ")
+ msg = str(event.message).split(' ')
if msg[0] == "":
msg = (
"呀?找不到路了?\n"
@@ -39,7 +41,7 @@ async def _help(bot: Bot, event: MessageEvent) -> None:
for _, _, i in os.walk(SERVICE_DIR):
for a in i:
f = SERVICE_DIR / a
- files.append(json.loads(f.read_bytes())["command"])
+ files.append(json.loads(f.read_bytes())['command'])
cmds = " | ".join(map(str, files))
msg = "咱能做很多事!比如:\n" + cmds
msg0 = msg + "\n没反应可能是没权限...或者为探测类型...不属于可直接触发命令..."
@@ -51,9 +53,13 @@ async def _help(bot: Bot, event: MessageEvent) -> None:
try:
data = json.loads(path.read_bytes())
except:
- await help.finish("未找到相关命令...")
+ await help.finish('未找到相关命令...')
- msg = f"{cmd} INFO:\n" f"Enabled: {data['enabled']}\n" f"{data['docs']}"
+ msg = (
+ f"{cmd} INFO:\n"
+ f"Enabled: {data['enabled']}\n"
+ f"{data['docs']}"
+ )
await help.finish(msg)
else:
- await help.finish("请检查输入...")
+ await help.finish('请检查输入...')