update
This commit is contained in:
@@ -90,7 +90,7 @@ set tg token ?
|
||||
|
||||
##### 设置telegram机器人代理
|
||||
|
||||
set tg url ?
|
||||
set tg http_proxy ?
|
||||
|
||||
##### 设置telegram机器人管理员
|
||||
|
||||
|
||||
@@ -301,9 +301,9 @@ func GetCronID(keyword string) (*Cron, error) {
|
||||
}
|
||||
cs := []Cron{}
|
||||
for _, cron := range crons {
|
||||
if cron.IsDisabled != 0 {
|
||||
continue
|
||||
}
|
||||
// if cron.IsDisabled != 0 {
|
||||
// continue
|
||||
// }
|
||||
if cron.ID == keyword {
|
||||
cs = append(cs, cron)
|
||||
break
|
||||
@@ -315,6 +315,20 @@ func GetCronID(keyword string) (*Cron, error) {
|
||||
cs = append(cs, cron)
|
||||
}
|
||||
}
|
||||
tmp := cs
|
||||
cs = []Cron{}
|
||||
if len := len(cs); len > 1 {
|
||||
for _, cron := range tmp {
|
||||
if len == 1 {
|
||||
break
|
||||
}
|
||||
if cron.IsDisabled != 0 {
|
||||
len--
|
||||
continue
|
||||
}
|
||||
cs = append(cs, cron)
|
||||
}
|
||||
}
|
||||
if len(cs) == 0 {
|
||||
return nil, errors.New("找不到任务。")
|
||||
}
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ func init() {
|
||||
if url := tg.Get("http_proxy"); url != "" {
|
||||
client, clientErr := buildClientWithProxy(url)
|
||||
if clientErr != nil {
|
||||
logs.Warn("监听telegram代理失败:%v", clientErr)
|
||||
logs.Warn("telegram代理失败:%v", clientErr)
|
||||
return
|
||||
}
|
||||
settings.Client = client
|
||||
|
||||
Reference in New Issue
Block a user