summaryrefslogtreecommitdiff
path: root/ATRI/plugins/Check.py
diff options
context:
space:
mode:
Diffstat (limited to 'ATRI/plugins/Check.py')
-rw-r--r--ATRI/plugins/Check.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/ATRI/plugins/Check.py b/ATRI/plugins/Check.py
index 9a39470..1dc64a0 100644
--- a/ATRI/plugins/Check.py
+++ b/ATRI/plugins/Check.py
@@ -197,4 +197,30 @@ async def _(session: CommandSession):
* disk: {disk}%
* BytesSENT: {inteSENT}
* BytesRECV: {inteRECV}
-{status}""".strip()) \ No newline at end of file
+{status}""".strip())
+
+
+@on_command('trackERROR', aliases = ['追踪'], only_to_me = False)
+async def _(session: CommandSession):
+ if session.event.user_id in master:
+ msg = session.current_arg.strip()
+ if not msg:
+ msg = session.get('message', prompt = '请发送trackID')
+
+ try:
+ with open(Path('.') / 'ATRI' / 'data' / 'errorData' / 'errorData.json', 'r') as f:
+ data = json.load(f)
+ except:
+ data = {}
+
+ if str(msg) in data.keys():
+ err = data[f"{msg}"]
+ msg0 = f'trackID: {msg}\n'
+ msg0 += err
+ await session.send(msg0)
+
+ else:
+ session.finish('未发现该ID')
+
+ else:
+ await session.send('恁哪位呀~?') \ No newline at end of file