From a3d52c07402a1adaf385c61fadd4beb1579059f1 Mon Sep 17 00:00:00 2001 From: haikerwang Date: Mon, 18 Sep 2023 00:37:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BE=A4=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E9=A2=84=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- timetask.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/timetask.py b/timetask.py index a6dd6b7..2977a8a 100644 --- a/timetask.py +++ b/timetask.py @@ -202,6 +202,13 @@ def add_timeTask(self, content, e_context: EventContext): if len(groupTitle) <= 0 or len(newEvent) <= 0 : self.replay_use_default(defaultErrorMsg, e_context) return + else: + channel_name = RobotConfig.conf().get("channel_type", "wx") + groupId = taskModel.get_gropID_withGroupTitle(groupTitle , channel_name) + if len(groupId) <= 0: + defaultErrorMsg = f"⏰定时任务指令格式异常😭,未找到群名为{groupTitle}的群聊,请核查!" + self.get_default_remind(TimeTaskRemindType.Add_Failed) + self.replay_use_default(defaultErrorMsg, e_context) + return #task入库 taskId = self.taskManager.addTask(taskModel)