Skip to content

Commit

Permalink
添加群定时任务预校验
Browse files Browse the repository at this point in the history
  • Loading branch information
haikerwang committed Sep 17, 2023
1 parent 16e1b0c commit a3d52c0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions timetask.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a3d52c0

Please sign in to comment.