up
This commit is contained in:
parent
402d20109c
commit
c91e2b8ac0
22
plugin/chips/insurance.go
Normal file
22
plugin/chips/insurance.go
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package chips
|
||||||
|
|
||||||
|
import (
|
||||||
|
redisrepo "amor/repository/redisRepo"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/spf13/cast"
|
||||||
|
zero "github.com/wdvxdr1123/ZeroBot"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Insurance(ctx *zero.Ctx) {
|
||||||
|
msg := strings.Split(ctx.Event.Message.String(), " ")
|
||||||
|
if len(msg) != 2 {
|
||||||
|
ctx.Send("命令格式错误")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
userID := ctx.Event.UserID
|
||||||
|
chips := cast.ToInt64(msg[1])
|
||||||
|
|
||||||
|
redisrepo.AddUserBalance(userID, chips)
|
||||||
|
ctx.Send("索赔成功")
|
||||||
|
}
|
@ -20,6 +20,9 @@ func Router() {
|
|||||||
// 群内筹码排名
|
// 群内筹码排名
|
||||||
zero.OnFullMatch("rank").Handle(chips.Rank)
|
zero.OnFullMatch("rank").Handle(chips.Rank)
|
||||||
|
|
||||||
|
// 赔钱
|
||||||
|
zero.OnCommand("我不玩了还我钱").Handle(chips.Insurance)
|
||||||
|
|
||||||
// 帮助
|
// 帮助
|
||||||
zero.OnFullMatch("help").Handle(plugin.Help)
|
zero.OnFullMatch("help").Handle(plugin.Help)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user