mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-23 01:05:06 +08:00
✏️ 减少指令误触发
This commit is contained in:
parent
3eee3d64f1
commit
184b12628f
@ -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 {
|
||||
|
||||
@ -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("少女祈祷中......")
|
||||
|
||||
@ -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")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user