This commit is contained in:
cdle 2021-08-17 13:57:41 +08:00
parent 32cd88f9af
commit 6dc0242397
2 changed files with 65 additions and 67 deletions

View File

@ -47,7 +47,7 @@ func DailyAssetsPush() {
Name: "pins",
Value: ck.PtPin,
}}
msg = runTask(&task, true)
msg = runTask(&task)
break
}
}

View File

@ -254,77 +254,75 @@ var handleMessage = func(msgs ...interface{}) interface{} {
}
cks := GetJdCookies()
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())
}
}
}
}
// {
// 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
}
}
// }
// return nil
// }
// }
{
a = strings.Replace(a, " ", "", -1)
pins := ""
for _, ck := range cks {
if strings.Contains(ck.Note, a) || strings.Contains(ck.Nickname, a) || strings.Contains(ck.PtPin, a) {
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())
}
}
pins += ck.PtPin
}
}
for _, task := range Config.Tasks {
if task.Word == "查询" {
task.Envs = []Env{{
Name: "pins",
Value: pins,
}}
task.Ykq = false
runTask(&task, msgs...)
break
}
}
return nil