mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-01-07 21:59:01 +08:00
✏️ 增加 setblock 避免冲突
This commit is contained in:
parent
6e0b754a66
commit
bd88c68208
@ -21,7 +21,7 @@ func init() { // 插件主体
|
|||||||
Help: "AIfalse\n" +
|
Help: "AIfalse\n" +
|
||||||
"- 查询计算机当前活跃度[检查身体|自检|启动自检|系统状态",
|
"- 查询计算机当前活跃度[检查身体|自检|启动自检|系统状态",
|
||||||
})
|
})
|
||||||
engine.OnFullMatchGroup([]string{"检查身体", "自检", "启动自检", "系统状态"}, zero.AdminPermission).
|
engine.OnFullMatchGroup([]string{"检查身体", "自检", "启动自检", "系统状态"}, zero.AdminPermission).SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
ctx.SendChain(message.Text(
|
ctx.SendChain(message.Text(
|
||||||
"* CPU占用率: ", cpuPercent(), "%\n",
|
"* CPU占用率: ", cpuPercent(), "%\n",
|
||||||
|
|||||||
@ -24,7 +24,7 @@ func init() { // 插件主体
|
|||||||
DisableOnDefault: false,
|
DisableOnDefault: false,
|
||||||
Help: "AIWife\n" +
|
Help: "AIWife\n" +
|
||||||
"- waifu|随机waifu",
|
"- waifu|随机waifu",
|
||||||
}).OnFullMatchGroup([]string{"waifu", "随机waifu"}).SetPriority(10).
|
}).OnFullMatchGroup([]string{"waifu", "随机waifu"}).SetPriority(10).SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
miku := rand.Intn(100000) + 1
|
miku := rand.Intn(100000) + 1
|
||||||
ctx.SendChain(message.At(ctx.Event.UserID), message.Image(fmt.Sprintf(bed, miku)))
|
ctx.SendChain(message.At(ctx.Event.UserID), message.Image(fmt.Sprintf(bed, miku)))
|
||||||
|
|||||||
@ -23,7 +23,7 @@ type follower struct {
|
|||||||
|
|
||||||
// 开启日报推送
|
// 开启日报推送
|
||||||
func init() {
|
func init() {
|
||||||
engine.OnFullMatch("/开启粉丝日报", zero.AdminPermission).
|
engine.OnFullMatch("/开启粉丝日报", zero.AdminPermission).SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
fansDaily(ctx.Event.GroupID) // 群号传进去给下面发信息的函数
|
fansDaily(ctx.Event.GroupID) // 群号传进去给下面发信息的函数
|
||||||
})
|
})
|
||||||
|
|||||||
@ -23,7 +23,7 @@ func init() {
|
|||||||
"- >user info [名字|uid]\n" +
|
"- >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) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
keyword := ctx.State["regex_matched"].([]string)[1]
|
keyword := ctx.State["regex_matched"].([]string)[1]
|
||||||
rest, err := uid(keyword)
|
rest, err := uid(keyword)
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
// 查vup粉丝数据
|
// 查vup粉丝数据
|
||||||
func init() {
|
func init() {
|
||||||
engine.OnRegex(`^>vup info\s?(.{1,25})$`).
|
engine.OnRegex(`^>vup info\s?(.{1,25})$`).SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
keyword := ctx.State["regex_matched"].([]string)[1]
|
keyword := ctx.State["regex_matched"].([]string)[1]
|
||||||
res, err := uid(keyword)
|
res, err := uid(keyword)
|
||||||
|
|||||||
@ -24,20 +24,20 @@ func init() {
|
|||||||
"- [回复]查重",
|
"- [回复]查重",
|
||||||
})
|
})
|
||||||
// 随机发送一篇上面的小作文
|
// 随机发送一篇上面的小作文
|
||||||
engine.OnFullMatch("小作文").
|
engine.OnFullMatch("小作文").SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
rand.Seed(time.Now().UnixNano())
|
rand.Seed(time.Now().UnixNano())
|
||||||
// 绕过第一行发病
|
// 绕过第一行发病
|
||||||
ctx.Send((*data.Array)[rand.Intn(len(*data.Array)-1)+1])
|
ctx.Send((*data.Array)[rand.Intn(len(*data.Array)-1)+1])
|
||||||
})
|
})
|
||||||
// 逆天
|
// 逆天
|
||||||
engine.OnFullMatch("发大病").
|
engine.OnFullMatch("发大病").SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
// 第一行是发病
|
// 第一行是发病
|
||||||
ctx.Send((*data.Array)[0])
|
ctx.Send((*data.Array)[0])
|
||||||
})
|
})
|
||||||
// 增加小作文
|
// 增加小作文
|
||||||
engine.OnRegex(`^教你一篇小作文(.*)$`, zero.AdminPermission).
|
engine.OnRegex(`^教你一篇小作文(.*)$`, zero.AdminPermission).SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
err := data.AddText(ctx.State["regex_matched"].([]string)[1])
|
err := data.AddText(ctx.State["regex_matched"].([]string)[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -28,7 +28,7 @@ type zhiwang struct {
|
|||||||
|
|
||||||
// 小作文查重: 回复要查的消息 查重
|
// 小作文查重: 回复要查的消息 查重
|
||||||
func init() {
|
func init() {
|
||||||
engine.OnMessage(fullmatch("查重")).
|
engine.OnMessage(fullmatch("查重")).SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
msg := ctx.Event.Message
|
msg := ctx.Event.Message
|
||||||
if msg[0].Type == "reply" {
|
if msg[0].Type == "reply" {
|
||||||
|
|||||||
@ -65,7 +65,7 @@ func init() {
|
|||||||
DisableOnDefault: false,
|
DisableOnDefault: false,
|
||||||
Help: "关键字搜图\n" +
|
Help: "关键字搜图\n" +
|
||||||
"- 来张 [xxx]",
|
"- 来张 [xxx]",
|
||||||
}).OnRegex(`^来张 (.*)$`, zero.AdminPermission).
|
}).OnRegex(`^来张 (.*)$`, zero.AdminPermission).SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
keyword := ctx.State["regex_matched"].([]string)[1]
|
keyword := ctx.State["regex_matched"].([]string)[1]
|
||||||
soutujson := soutuapi(keyword)
|
soutujson := soutuapi(keyword)
|
||||||
|
|||||||
@ -27,7 +27,7 @@ func init() {
|
|||||||
DisableOnDefault: false,
|
DisableOnDefault: false,
|
||||||
Help: "lolicon\n" +
|
Help: "lolicon\n" +
|
||||||
"- 来份萝莉",
|
"- 来份萝莉",
|
||||||
}).OnFullMatch("来份萝莉").
|
}).OnFullMatch("来份萝莉").SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
go func() {
|
go func() {
|
||||||
for i := 0; i < min(cap(queue)-len(queue), 2); i++ {
|
for i := 0; i < min(cap(queue)-len(queue), 2); i++ {
|
||||||
|
|||||||
@ -46,7 +46,7 @@ func init() {
|
|||||||
servers["ftbi"] = "115.28.186.22:25710"
|
servers["ftbi"] = "115.28.186.22:25710"
|
||||||
servers["ges"] = "115.28.186.22:25701"
|
servers["ges"] = "115.28.186.22:25701"
|
||||||
|
|
||||||
engine.OnCommand("mclist").
|
engine.OnCommand("mclist").SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
model := extension.CommandModel{}
|
model := extension.CommandModel{}
|
||||||
_ = ctx.Parse(&model)
|
_ = ctx.Parse(&model)
|
||||||
|
|||||||
@ -30,7 +30,7 @@ func init() {
|
|||||||
"- /mclist servername\n" +
|
"- /mclist servername\n" +
|
||||||
"- https://github.com/Suwings/MCSManager",
|
"- https://github.com/Suwings/MCSManager",
|
||||||
})
|
})
|
||||||
engine.OnCommand("mcstart").
|
engine.OnCommand("mcstart").SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
model := extension.CommandModel{}
|
model := extension.CommandModel{}
|
||||||
_ = ctx.Parse(&model)
|
_ = ctx.Parse(&model)
|
||||||
@ -38,7 +38,7 @@ func init() {
|
|||||||
result := start(model.Args)
|
result := start(model.Args)
|
||||||
ctx.Send(result)
|
ctx.Send(result)
|
||||||
})
|
})
|
||||||
engine.OnCommand("mcstop").
|
engine.OnCommand("mcstop").SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
model := extension.CommandModel{}
|
model := extension.CommandModel{}
|
||||||
_ = ctx.Parse(&model)
|
_ = ctx.Parse(&model)
|
||||||
|
|||||||
@ -24,7 +24,7 @@ func init() { // 插件主体
|
|||||||
DisableOnDefault: false,
|
DisableOnDefault: false,
|
||||||
Help: "浅草寺求签\n" +
|
Help: "浅草寺求签\n" +
|
||||||
"- 求签|运势|占卜",
|
"- 求签|运势|占卜",
|
||||||
}).OnFullMatchGroup([]string{"求签", "运势", "占卜"}).SetPriority(10).
|
}).OnFullMatchGroup([]string{"求签", "运势", "占卜"}).SetPriority(10).SetBlock(true).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
miku := rand.Intn(100) + 1
|
miku := rand.Intn(100) + 1
|
||||||
ctx.SendChain(
|
ctx.SendChain(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user