diff options
-rw-r--r-- | ATRI/plugins/essential.py | 4 | ||||
-rw-r--r-- | ATRI/plugins/manage/__init__.py | 16 |
2 files changed, 15 insertions, 5 deletions
diff --git a/ATRI/plugins/essential.py b/ATRI/plugins/essential.py index e3919d5..fa73a3c 100644 --- a/ATRI/plugins/essential.py +++ b/ATRI/plugins/essential.py @@ -346,8 +346,8 @@ def recall_msg_dealer(msg: dict) -> str: temp_m = list() for i in msg: - _type = i["type"] - _data = i["data"] + _type = i.get("type", "idk") + _data = i.get("data", "idk") if _type == "text": temp_m.append(_data["text"]) elif _type == "image": 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) |