Skip to content

Commit

Permalink
✏️ 增加 setblock 避免冲突
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Sep 9, 2021
1 parent 6e0b754 commit bd88c68
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion plugin_ai_false/ai_false.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func init() { // 插件主体
Help: "AIfalse\n" +
"- 查询计算机当前活跃度[检查身体|自检|启动自检|系统状态",
})
engine.OnFullMatchGroup([]string{"检查身体", "自检", "启动自检", "系统状态"}, zero.AdminPermission).
engine.OnFullMatchGroup([]string{"检查身体", "自检", "启动自检", "系统状态"}, zero.AdminPermission).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
ctx.SendChain(message.Text(
"* CPU占用率: ", cpuPercent(), "%\n",
Expand Down
2 changes: 1 addition & 1 deletion plugin_aiwife/non-existent.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func init() { // 插件主体
DisableOnDefault: false,
Help: "AIWife\n" +
"- waifu|随机waifu",
}).OnFullMatchGroup([]string{"waifu", "随机waifu"}).SetPriority(10).
}).OnFullMatchGroup([]string{"waifu", "随机waifu"}).SetPriority(10).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
miku := rand.Intn(100000) + 1
ctx.SendChain(message.At(ctx.Event.UserID), message.Image(fmt.Sprintf(bed, miku)))
Expand Down
2 changes: 1 addition & 1 deletion plugin_bilibili/fansDaily.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type follower struct {

// 开启日报推送
func init() {
engine.OnFullMatch("/开启粉丝日报", zero.AdminPermission).
engine.OnFullMatch("/开启粉丝日报", zero.AdminPermission).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
fansDaily(ctx.Event.GroupID) // 群号传进去给下面发信息的函数
})
Expand Down
2 changes: 1 addition & 1 deletion plugin_bilibili/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func init() {
"- >user info [名字|uid]\n" +
"- /开启粉丝日报",
})
engine.OnRegex(`^>user info\s(.{1,25})$`).
engine.OnRegex(`^>user info\s(.{1,25})$`).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
keyword := ctx.State["regex_matched"].([]string)[1]
rest, err := uid(keyword)
Expand Down
2 changes: 1 addition & 1 deletion plugin_bilibili/live_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

// 查vup粉丝数据
func init() {
engine.OnRegex(`^>vup info\s?(.{1,25})$`).
engine.OnRegex(`^>vup info\s?(.{1,25})$`).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
keyword := ctx.State["regex_matched"].([]string)[1]
res, err := uid(keyword)
Expand Down
6 changes: 3 additions & 3 deletions plugin_diana/bing.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ func init() {
"- [回复]查重",
})
// 随机发送一篇上面的小作文
engine.OnFullMatch("小作文").
engine.OnFullMatch("小作文").SetBlock(true).
Handle(func(ctx *zero.Ctx) {
rand.Seed(time.Now().UnixNano())
// 绕过第一行发病
ctx.Send((*data.Array)[rand.Intn(len(*data.Array)-1)+1])
})
// 逆天
engine.OnFullMatch("发大病").
engine.OnFullMatch("发大病").SetBlock(true).
Handle(func(ctx *zero.Ctx) {
// 第一行是发病
ctx.Send((*data.Array)[0])
})
// 增加小作文
engine.OnRegex(`^教你一篇小作文(.*)$`, zero.AdminPermission).
engine.OnRegex(`^教你一篇小作文(.*)$`, zero.AdminPermission).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
err := data.AddText(ctx.State["regex_matched"].([]string)[1])
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion plugin_diana/zhiwang.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type zhiwang struct {

// 小作文查重: 回复要查的消息 查重
func init() {
engine.OnMessage(fullmatch("查重")).
engine.OnMessage(fullmatch("查重")).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
msg := ctx.Event.Message
if msg[0].Type == "reply" {
Expand Down
2 changes: 1 addition & 1 deletion plugin_image_finder/keyword.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func init() {
DisableOnDefault: false,
Help: "关键字搜图\n" +
"- 来张 [xxx]",
}).OnRegex(`^来张 (.*)$`, zero.AdminPermission).
}).OnRegex(`^来张 (.*)$`, zero.AdminPermission).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
keyword := ctx.State["regex_matched"].([]string)[1]
soutujson := soutuapi(keyword)
Expand Down
2 changes: 1 addition & 1 deletion plugin_lolicon/lolicon.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func init() {
DisableOnDefault: false,
Help: "lolicon\n" +
"- 来份萝莉",
}).OnFullMatch("来份萝莉").
}).OnFullMatch("来份萝莉").SetBlock(true).
Handle(func(ctx *zero.Ctx) {
go func() {
for i := 0; i < min(cap(queue)-len(queue), 2); i++ {
Expand Down
2 changes: 1 addition & 1 deletion plugin_minecraft/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func init() {
servers["ftbi"] = "115.28.186.22:25710"
servers["ges"] = "115.28.186.22:25701"

engine.OnCommand("mclist").
engine.OnCommand("mclist").SetBlock(true).
Handle(func(ctx *zero.Ctx) {
model := extension.CommandModel{}
_ = ctx.Parse(&model)
Expand Down
4 changes: 2 additions & 2 deletions plugin_minecraft/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ func init() {
"- /mclist servername\n" +
"- https://github.com/Suwings/MCSManager",
})
engine.OnCommand("mcstart").
engine.OnCommand("mcstart").SetBlock(true).
Handle(func(ctx *zero.Ctx) {
model := extension.CommandModel{}
_ = ctx.Parse(&model)
ctx.SendChain(message.Text("开启服务器: ", model.Args, "....."))
result := start(model.Args)
ctx.Send(result)
})
engine.OnCommand("mcstop").
engine.OnCommand("mcstop").SetBlock(true).
Handle(func(ctx *zero.Ctx) {
model := extension.CommandModel{}
_ = ctx.Parse(&model)
Expand Down
2 changes: 1 addition & 1 deletion plugin_omikuji/sensou.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func init() { // 插件主体
DisableOnDefault: false,
Help: "浅草寺求签\n" +
"- 求签|运势|占卜",
}).OnFullMatchGroup([]string{"求签", "运势", "占卜"}).SetPriority(10).
}).OnFullMatchGroup([]string{"求签", "运势", "占卜"}).SetPriority(10).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
miku := rand.Intn(100) + 1
ctx.SendChain(
Expand Down

0 comments on commit bd88c68

Please sign in to comment.