diff --git a/music/music_selecter.go b/music/music_selecter.go index 02ef0cf7..ab69738f 100644 --- a/music/music_selecter.go +++ b/music/music_selecter.go @@ -10,7 +10,7 @@ import ( func init() { // 插件主体 // TODO 根据PID搜图 - zero.OnRegex(`点歌(.*)`).SetBlock(true).SetPriority(50). + zero.OnRegex(`^点歌(.*)$`).SetBlock(true).SetPriority(50). Handle(func(ctx *zero.Ctx) { music, err := utils.CloudMusic(ctx.State["regex_matched"].([]string)[1]) if err != nil { diff --git a/setutime/pic_searcher.go b/setutime/pic_searcher.go index a5eff5ab..1384f17d 100644 --- a/setutime/pic_searcher.go +++ b/setutime/pic_searcher.go @@ -9,7 +9,7 @@ import ( func init() { // 插件主体 // TODO 根据PID搜图 - zero.OnRegex(`搜图(\d+)`).SetBlock(true).SetPriority(30). + zero.OnRegex(`^搜图(\d+)$`).SetBlock(true).SetPriority(30). Handle(func(ctx *zero.Ctx) { id := utils.Str2Int(ctx.State["regex_matched"].([]string)[1]) ctx.Send("少女祈祷中......") diff --git a/setutime/setu_geter.go b/setutime/setu_geter.go index bf48c671..eabcb751 100644 --- a/setutime/setu_geter.go +++ b/setutime/setu_geter.go @@ -44,7 +44,7 @@ func init() { } func init() { // 插件主体 - zero.OnRegex(`来份(.*)`, FirstValueInList(PoolList)).SetBlock(true).SetPriority(20). + zero.OnRegex(`^来份(.*)$`, FirstValueInList(PoolList)).SetBlock(true).SetPriority(20). Handle(func(ctx *zero.Ctx) { if limit.Load(ctx.Event.UserID).Acquire() == false { ctx.Send("请稍后重试0x0...") @@ -95,7 +95,7 @@ func init() { // 插件主体 return }) - zero.OnRegex(`添加(.*?)(\d+)`, FirstValueInList(PoolList), zero.SuperUserPermission).SetBlock(true).SetPriority(21). + zero.OnRegex(`^添加(.*?)(\d+)$`, FirstValueInList(PoolList), zero.SuperUserPermission).SetBlock(true).SetPriority(21). Handle(func(ctx *zero.Ctx) { var ( type_ = ctx.State["regex_matched"].([]string)[1] @@ -128,7 +128,7 @@ func init() { // 插件主体 return }) - zero.OnRegex(`删除(.*?)(\d+)`, FirstValueInList(PoolList), zero.SuperUserPermission).SetBlock(true).SetPriority(22). + zero.OnRegex(`^删除(.*?)(\d+)$`, FirstValueInList(PoolList), zero.SuperUserPermission).SetBlock(true).SetPriority(22). Handle(func(ctx *zero.Ctx) { var ( type_ = ctx.State["regex_matched"].([]string)[1] @@ -144,7 +144,7 @@ func init() { // 插件主体 }) // TODO 查询数据库涩图数量 - zero.OnFullMatchGroup([]string{"setu -s", "setu --status"}, zero.SuperUserPermission).SetBlock(true).SetPriority(23). + zero.OnFullMatchGroup([]string{"setu -s", "setu --status"}).SetBlock(true).SetPriority(23). Handle(func(ctx *zero.Ctx) { state := []string{"[SetuTime]"} for i := range PoolList { @@ -161,14 +161,14 @@ func init() { // 插件主体 return }) // TODO 开xml模式 - zero.OnFullMatchGroup([]string{"setu -x", "setu --xml"}, zero.AdminPermission).SetBlock(true).SetPriority(24). + zero.OnFullMatchGroup([]string{"setu -x", "setu --xml"}).SetBlock(true).SetPriority(24). Handle(func(ctx *zero.Ctx) { FORM = "XML" ctx.Send("[SetuTime] XML->ON") return }) // TODO 关xml模式 - zero.OnFullMatchGroup([]string{"setu -p", "setu --pic"}, zero.AdminPermission).SetBlock(true).SetPriority(24). + zero.OnFullMatchGroup([]string{"setu -p", "setu --pic"}).SetBlock(true).SetPriority(24). Handle(func(ctx *zero.Ctx) { FORM = "PIC" ctx.Send("[SetuTime] XML->OFF")