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] =?UTF-8?q?update=20models/bot.go.=20=E5=A2=9E=E5=8A=A0tyt?= =?UTF-8?q?num=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]},