|
@@ -786,9 +786,11 @@ func Subscribe(w ResponseWriter, r *Request) {
|
|
|
w.ReplyText(fmt.Sprintf(exists, strings.ReplaceAll(subkey, "++", " "), fastSubscribeText["skill"].(string)))
|
|
|
} else if pcresult == "vipsubscribe##reply" { //关注
|
|
|
vipsubReply := config.Sysconfig["vipSubscribeReply"].(map[string]interface{})
|
|
|
- time.AfterFunc(time.Second/2, func() {
|
|
|
- w.PostText(fmt.Sprintf(fmt.Sprint(vipsubReply["content"]), config.Sysconfig["webdomain"].(string)+vipsubReply["href"].(string)))
|
|
|
- })
|
|
|
+ if switchBl, ok := vipsubReply["switch"].(bool); switchBl && ok {
|
|
|
+ time.AfterFunc(time.Second/2, func() {
|
|
|
+ w.PostText(fmt.Sprintf(fmt.Sprint(vipsubReply["content"]), config.Sysconfig["webdomain"].(string)+vipsubReply["href"].(string)))
|
|
|
+ })
|
|
|
+ }
|
|
|
isAutoRepl = true
|
|
|
} else {
|
|
|
if subkey != "" {
|
|
@@ -1207,9 +1209,11 @@ func ScanHandler(w ResponseWriter, r *Request) {
|
|
|
w.ReplyText(fmt.Sprintf(config.Sysconfig["welcomemsg"].(string), url))
|
|
|
if pcresult == "vipsubscribe##reply" { //新用户扫码
|
|
|
vipsubReply := config.Sysconfig["vipSubscribeReply"].(map[string]interface{})
|
|
|
- time.AfterFunc(time.Second/2, func() {
|
|
|
- w.PostText(fmt.Sprintf(fmt.Sprint(vipsubReply["content"]), config.Sysconfig["webdomain"].(string)+vipsubReply["href"].(string)))
|
|
|
- })
|
|
|
+ if switchBl, ok := vipsubReply["switch"].(bool); switchBl && ok {
|
|
|
+ time.AfterFunc(time.Second/2, func() {
|
|
|
+ w.PostText(fmt.Sprintf(fmt.Sprint(vipsubReply["content"]), config.Sysconfig["webdomain"].(string)+vipsubReply["href"].(string)))
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1292,7 +1296,9 @@ func ScanHandler(w ResponseWriter, r *Request) {
|
|
|
w.ReplyText(fmt.Sprintf(fmt.Sprint(pchints["key_fail"]), strings.ReplaceAll(subkey, "++", " "), url))
|
|
|
} else if pcresult == "vipsubscribe##reply" { //老用户扫码
|
|
|
vipsubReply := config.Sysconfig["vipSubscribeReply"].(map[string]interface{})
|
|
|
- w.ReplyText(fmt.Sprintf(fmt.Sprint(vipsubReply["content"]), config.Sysconfig["webdomain"].(string)+vipsubReply["href"].(string)))
|
|
|
+ if switchBl, ok := vipsubReply["switch"].(bool); switchBl && ok {
|
|
|
+ w.ReplyText(fmt.Sprintf(fmt.Sprint(vipsubReply["content"]), config.Sysconfig["webdomain"].(string)+vipsubReply["href"].(string)))
|
|
|
+ }
|
|
|
}
|
|
|
} else if pccodepre == "18" { //关注企业
|
|
|
company := redis.GetStr("sso", "pc_subscribe_"+r.EventKey) //企业名称
|