Skip to content

Commit

Permalink
使用niu包
Browse files Browse the repository at this point in the history
  • Loading branch information
xyy0411 committed Jan 12, 2025
1 parent 1557e4d commit bd56064
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions plugin/niuniu/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,6 @@ var (
)

func init() {
en.OnRegex(`^购买(\d+)牛牛$`, zero.OnlyGroup).SetBlock(true).Handle(func(ctx *zero.Ctx) {
n, err := strconv.Atoi(ctx.State["regex_matched"].([]string)[1])
if err != nil {
ctx.SendChain(message.Text("ERROR:", err))
return
}
gid := ctx.Event.GroupID
uid := ctx.Event.UserID
msg, err := niu.Auction(gid, uid, n)
if err != nil {
ctx.SendChain(message.Text("ERROR:", err))
return
}
ctx.SendChain(message.Reply(ctx.Event.Message), message.Text(msg))
})
en.OnFullMatch("牛牛拍卖行", zero.OnlyGroup).SetBlock(true).Handle(func(ctx *zero.Ctx) {
gid := ctx.Event.GroupID
uid := ctx.Event.UserID
Expand Down Expand Up @@ -105,7 +90,7 @@ func init() {
ctx.SendChain(message.Text("ERROR: ", err))
return
}

n--
msg, err := niu.Auction(gid, uid, n)
if err != nil {
ctx.SendChain(message.Text("ERROR:", err))
Expand Down

0 comments on commit bd56064

Please sign in to comment.