From 65432ef8dca67b82a4f441042c51dbff469be008 Mon Sep 17 00:00:00 2001 From: u188 <302761125@qq.com> Date: Mon, 27 Sep 2021 09:35:43 +0000 Subject: [PATCH 1/3] =?UTF-8?q?update=20conf/demo=5Fconfig.yaml.=20tytnum:?= =?UTF-8?q?=20#=E5=A1=AB=E5=86=991-N=20=E4=BB=A3=E8=A1=A8=E6=8E=A8?= =?UTF-8?q?=E4=B8=80=E6=8E=A8=E9=9C=80=E8=A6=81=E7=9A=84=E4=BA=92=E5=8A=A9?= =?UTF-8?q?=E5=80=BC=EF=BC=8C=E9=BB=98=E8=AE=A4=E4=B8=BA8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/demo_config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/demo_config.yaml b/conf/demo_config.yaml index 21e2c1d..996234a 100644 --- a/conf/demo_config.yaml +++ b/conf/demo_config.yaml @@ -16,6 +16,7 @@ Wskey: # 填空默认禁用wskey转换 需要的填true SMSAddress: IsAddFriend: #填写true或者false false Lim: #填写1-N 代表限制次数 +tytnum: #填写1-N 代表推一推需要的互助值,默认为8 theme: static: ./static master: From 0d554c33443434a406b170aae96f0db12771e2ca Mon Sep 17 00:00:00 2001 From: u188 <302761125@qq.com> Date: Mon, 27 Sep 2021 09:37:49 +0000 Subject: [PATCH 2/3] =?UTF-8?q?update=20models/bot.go.=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0tytnum=E9=99=90=E5=88=B6=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/bot.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/models/bot.go b/models/bot.go index 61dfb76..e5f516a 100644 --- a/models/bot.go +++ b/models/bot.go @@ -191,12 +191,15 @@ 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 < 8 { - return "推一推需要8个互助值。" + if coin < Config.tytnum { + sender.Reply(fmt.Sprintf("推一推需要%d个互助值",Config.tytnum)) } RemCoin(sender.UserID, 8) - sender.Reply("推一推即将开始,已扣除8个互助值。") + sender.Reply(fmt.Sprintf("推一推即将开始,已扣除%d个互助值",Config.tytnum)) } runTask(&Task{Path: "jd_tyt.js", Envs: []Env{ {Name: "tytpacketId", Value: ss[1]}, From eb7b888687a9f237e4cbfa6141e0b96e579a6ea3 Mon Sep 17 00:00:00 2001 From: u188 <302761125@qq.com> Date: Mon, 27 Sep 2021 09:38:31 +0000 Subject: [PATCH 3/3] =?UTF-8?q?update=20models/config.go.=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0tytnum=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/models/config.go b/models/config.go index 61fccf0..66b31d6 100644 --- a/models/config.go +++ b/models/config.go @@ -41,6 +41,7 @@ type Yaml struct { SMSAddress string `yaml:"SMSAddress"` IsAddFriend bool `yaml:"IsAddFriend"` Lim int `yaml:"Lim"` + tytnum int `yaml:"tytnum"` Node string Npm string Python string