Merge remote-tracking branch 'gitee/main' into gitee

This commit is contained in:
ZJY 2021-09-27 17:51:13 +08:00
commit d3433daf60
3 changed files with 8 additions and 3 deletions

View File

@ -15,6 +15,7 @@ ApiToken: #为空默认随机禁用
Wskey: # 填空默认禁用wskey转换 需要的填true
IsAddFriend: #填写true或者false false
Lim: #填写1-N 代表限制次数
tytnum: #填写1-N 代表推一推需要的互助值默认为8
theme:
static: ./static
master:

View File

@ -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]},

View File

@ -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