feat(services): 通知标题添加脚本实例信息

This commit is contained in:
DLmaster
2025-02-08 12:25:48 +08:00
parent d13fbb063d
commit 0c123e9389
2 changed files with 12 additions and 14 deletions

View File

@@ -54,10 +54,7 @@ class Task(QThread):
accomplish = Signal(list)
def __init__(
self,
mode: str,
name: str,
info: Dict[str, Dict[str, Union[str, int, bool]]],
self, mode: str, name: str, info: Dict[str, Dict[str, Union[str, int, bool]]]
):
super(Task, self).__init__()
@@ -67,6 +64,8 @@ class Task(QThread):
self.logs = []
self.question_response.connect(lambda: print("response"))
def run(self):
if "设置MAA" in self.mode:

View File

@@ -503,9 +503,14 @@ class MaaManager(QObject):
f"{"\n".join([self.data[_][0] for _ in wait_index])}\n"
)
title = (
f"{self.set["MaaSet"]["Name"]}{self.mode[:4]}任务报告"
if self.set["MaaSet"]["Name"] != ""
else f"{self.mode[:4]}任务报告"
)
# 推送代理结果通知
Notify.push_notification(
f"{self.mode[2:4]}任务已完成!",
title.replace("报告", "已完成!"),
f"已完成用户数:{len(over_index)},未完成用户数:{len(error_index) + len(wait_index)}",
f"已完成用户数:{len(over_index)},未完成用户数:{len(error_index) + len(wait_index)}",
10,
@@ -517,17 +522,11 @@ class MaaManager(QObject):
and len(error_index) + len(wait_index) != 0
):
Notify.send_mail(
f"{self.mode[:4]}任务报告",
title,
f"{end_log}\n\nAUTO_MAA 敬上\n\n我们根据您在 AUTO_MAA 中的设置发送了这封电子邮件,本邮件无需回复\n",
)
Notify.ServerChanPush(
f"{self.mode[:4]}任务报告",
f"{end_log}\n\nAUTO_MAA 敬上",
)
Notify.CompanyWebHookBotPush(
f"{self.mode[:4]}任务报告",
f"{end_log}AUTO_MAA 敬上",
)
Notify.ServerChanPush(title, f"{end_log}\n\nAUTO_MAA 敬上")
Notify.CompanyWebHookBotPush(title, f"{end_log}AUTO_MAA 敬上")
self.agree_bilibili(False)
self.accomplish.emit({"Time": begin_time, "History": end_log})