mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 06:20:08 +08:00
fix:修改niuniu插件at功能正则,提高兼容性 (#973)
This commit is contained in:
parent
6ec3dff78a
commit
13ef54ef62
@ -220,7 +220,7 @@ func init() {
|
|||||||
ctx.SendChain(message.Reply(ctx.Event.GroupID),
|
ctx.SendChain(message.Reply(ctx.Event.GroupID),
|
||||||
message.Text("注册成功,你的牛牛现在有", u.Length, "cm"))
|
message.Text("注册成功,你的牛牛现在有", u.Length, "cm"))
|
||||||
})
|
})
|
||||||
en.OnRegex(`jj\[CQ:at,qq=(\d+),name=[\s\S]*\]$`, getdb,
|
en.OnRegex(`^jj\s?(\[CQ:at,(?:\S*,)?qq=(\d+)(?:,\S*)?\]|(\d+))$`, getdb,
|
||||||
zero.OnlyGroup).SetBlock(true).Limit(func(ctx *zero.Ctx) *rate.Limiter {
|
zero.OnlyGroup).SetBlock(true).Limit(func(ctx *zero.Ctx) *rate.Limiter {
|
||||||
lt := jjLimiter.Load(fmt.Sprintf("%d_%d", ctx.Event.GroupID, ctx.Event.UserID))
|
lt := jjLimiter.Load(fmt.Sprintf("%d_%d", ctx.Event.GroupID, ctx.Event.UserID))
|
||||||
ctx.State["jj_last_touch"] = lt.LastTouch()
|
ctx.State["jj_last_touch"] = lt.LastTouch()
|
||||||
@ -235,7 +235,8 @@ func init() {
|
|||||||
})))
|
})))
|
||||||
},
|
},
|
||||||
).Handle(func(ctx *zero.Ctx) {
|
).Handle(func(ctx *zero.Ctx) {
|
||||||
adduser, err := strconv.ParseInt(ctx.State["regex_matched"].([]string)[1], 10, 64)
|
fiancee := ctx.State["regex_matched"].([]string)
|
||||||
|
adduser, err := strconv.ParseInt(fiancee[2]+fiancee[3], 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.SendChain(message.Text("ERROR:", err))
|
ctx.SendChain(message.Text("ERROR:", err))
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user