This commit is contained in:
cdle 2021-08-17 14:15:35 +08:00
parent 6dc0242397
commit 0aa9ad1286
2 changed files with 14 additions and 58 deletions

View File

@ -254,58 +254,6 @@ var handleMessage = func(msgs ...interface{}) interface{} {
} }
cks := GetJdCookies() cks := GetJdCookies()
a := s[2] a := s[2]
// {
// if s := strings.Split(a, "-"); len(s) == 2 {
// for i, ck := range cks {
// if i+1 >= Int(s[0]) && i+1 <= Int(s[1]) {
// switch tp {
// case "tg":
// tgBotNotify(ck.Query())
// case "qq":
// if id == ck.QQ {
// SendQQ(int64(id), ck.Query())
// } else {
// SendQQ(Config.QQID, ck.Query())
// }
// case "qqg":
// uid := msgs[3].(int)
// if uid == ck.QQ || uid == int(Config.QQID) {
// SendQQGroup(int64(id), int64(msgs[3].(int)), ck.Query())
// }
// }
// }
// }
// return nil
// }
// }
// {
// if x := regexp.MustCompile(`^[\s\d,]+$`).FindString(a); x != "" {
// xx := regexp.MustCompile(`(\d+)`).FindAllStringSubmatch(a, -1)
// for i, ck := range cks {
// for _, x := range xx {
// if fmt.Sprint(i+1) == x[1] {
// switch tp {
// case "tg":
// tgBotNotify(ck.Query())
// case "qq":
// if id == ck.QQ {
// SendQQ(int64(id), ck.Query())
// } else {
// SendQQ(Config.QQID, ck.Query())
// }
// case "qqg":
// uid := msgs[3].(int)
// if uid == ck.QQ || uid == int(Config.QQID) {
// SendQQGroup(int64(id), int64(msgs[3].(int)), ck.Query())
// }
// }
// }
// }
// }
// return nil
// }
// }
{ {
a = strings.Replace(a, " ", "", -1) a = strings.Replace(a, " ", "", -1)
pins := "" pins := ""
@ -314,13 +262,15 @@ var handleMessage = func(msgs ...interface{}) interface{} {
pins += ck.PtPin pins += ck.PtPin
} }
} }
if pins == "" {
return "找不到匹配的账号"
}
for _, task := range Config.Tasks { for _, task := range Config.Tasks {
if task.Word == "查询" { if task.Word == "查询" {
task.Envs = []Env{{ task.Envs = []Env{{
Name: "pins", Name: "pins",
Value: pins, Value: pins,
}} }}
task.Ykq = false
runTask(&task, msgs...) runTask(&task, msgs...)
break break
} }

View File

@ -53,6 +53,13 @@ func createTask(task *Task) {
} }
func runTask(task *Task, msgs ...interface{}) string { func runTask(task *Task, msgs ...interface{}) string {
if len(msgs) > 0 {
if msgs[1].(string) == "tg" {
task.Ykq = false
} else {
task.Ykq = true
}
}
msg := "" msg := ""
if task.Name == "" { if task.Name == "" {
slice := strings.Split(task.Path, "/") slice := strings.Split(task.Path, "/")
@ -112,14 +119,13 @@ func runTask(task *Task, msgs ...interface{}) string {
if err2 != nil || io.EOF == err2 { if err2 != nil || io.EOF == err2 {
break break
} }
if task.Ykq { msg += line
msg += line if !task.Ykq {
} else { sendMessagee(line, msgs...)
sendAdminMessagee(line, msgs...)
} }
} }
if task.Ykq { if task.Ykq {
sendAdminMessagee(msg, msgs...) sendMessagee(msg, msgs...)
} }
err = cmd.Wait() err = cmd.Wait()
return msg return msg