From 79280a401fa0461868d06909643aa9aad2733b2d Mon Sep 17 00:00:00 2001
From: Kyomotoi <kyomotoiowo@gmail.com>
Date: Thu, 3 Feb 2022 20:03:49 +0800
Subject: =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20=E8=BF=9B=E8=A1=8C=E4=B8=80?=
 =?UTF-8?q?=E4=B8=AAbug=E7=9A=84=E4=BF=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ATRI/plugins/manage/__init__.py | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

(limited to 'ATRI/plugins/manage')

diff --git a/ATRI/plugins/manage/__init__.py b/ATRI/plugins/manage/__init__.py
index 62ed378..befbdf1 100644
--- a/ATRI/plugins/manage/__init__.py
+++ b/ATRI/plugins/manage/__init__.py
@@ -415,7 +415,17 @@ track_error = Manage().on_command("追踪", "获取报错信息,传入追踪
 
 
 @track_error.handle()
-async def _track_error(event: MessageEvent):
-    track_id = str(event.message).strip()
-    repo = await Manage().track_error(track_id)
+async def _track_error(matcher: Matcher, args: Message = CommandArg()):
+    msg = args.extract_plain_text()
+    if msg:
+        matcher.set_arg("track_code", args)
+
+
+@track_error.got("track_code", "报错码 速速")
+async def _(track_code: str = ArgPlainText("track_code")):
+    quit_list = ["算了", "罢了"]
+    if track_code in quit_list:
+        await track_error.finish("好吧...")
+
+    repo = await Manage().track_error(track_code)
     await track_error.finish(repo)
-- 
cgit v1.2.3