fix 修复通知 修复推一推参数设置

This commit is contained in:
ZJY 2021-10-03 20:50:27 +08:00
parent 842a45c302
commit 129bdcc78f
4 changed files with 17 additions and 9 deletions

View File

@ -14,7 +14,7 @@ IsOldV4: #填写true或者false false是否新版或者旧版V4
Wskey: # 填空默认禁用wskey转换 需要的填true
IsAddFriend: #填写true或者false false
Lim: #填写1-N 代表限制次数
tytnum: #填写1-N 代表推一推需要的互助值默认为8
Tyt: #填写1-N 代表推一推需要的互助值默认为8
theme:
static: ./static
master:

View File

@ -243,7 +243,10 @@ func CookieOK(ck *JdCookie) bool {
}
ui := &UserInfoResult{}
if nil != json.Unmarshal(data, ui) {
(&JdCookie{}).Push("第一个接口失效切换到第二个接口可能黑IP")
if !Config.IFC {
(&JdCookie{}).Push("第一个接口失效切换到第二个接口可能黑IP")
Config.IFC = true
}
b2 := av2(cookie)
if b2 == false {
if ck.Available == True {
@ -295,6 +298,10 @@ func CookieOK(ck *JdCookie) bool {
return true
}
}
if Config.IFC {
(&JdCookie{}).Push("第一个接口恢复切换回第一接口恭喜你IP洗白白了")
Config.IFC = true
}
switch ui.Retcode {
case "1001": //ck.BeanNum
if ui.Msg == "not login" {

View File

@ -191,15 +191,12 @@ var handleMessage = func(msgs ...interface{}) interface{} {
ss := regexp.MustCompile(`packetId=(\S+)(&|&)currentActId`).FindStringSubmatch(msg)
if len(ss) > 0 {
if !sender.IsAdmin {
if Config.tytnum == 0 {
Config.tytnum = 8
}
coin := GetCoin(sender.UserID)
if coin < Config.tytnum {
return fmt.Sprintf("推一推需要%d个互助值", Config.tytnum)
if coin < Config.Tyt {
return fmt.Sprintf("推一推需要%d个互助值", Config.Tyt)
}
RemCoin(sender.UserID, 8)
sender.Reply(fmt.Sprintf("推一推即将开始,已扣除%d个互助值", Config.tytnum))
sender.Reply(fmt.Sprintf("推一推即将开始,已扣除%d个互助值", Config.Tyt))
}
runTask(&Task{Path: "jd_tyt.js", Envs: []Env{
{Name: "tytpacketId", Value: ss[1]},

View File

@ -41,7 +41,8 @@ type Yaml struct {
SMSAddress string `yaml:"SMSAddress"`
IsAddFriend bool `yaml:"IsAddFriend"`
Lim int `yaml:"Lim"`
tytnum int `yaml:"tytnum"`
Tyt int `yaml:"Tyt"`
IFC bool `yaml:"IFC"`
Node string
Npm string
Python string
@ -104,6 +105,9 @@ func initConfig() {
if Config.NoGhproxy {
GhProxy = ""
}
if Config.Tyt == 0 {
Config.Tyt = 8
}
if Config.Database == "" {
Config.Database = ExecPath + "/.xdd.db"
}