mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 13:59:39 +08:00
优化atri.go匹配逻辑
This commit is contained in:
parent
f790165358
commit
9665f6cb3f
@ -46,7 +46,7 @@ func init() { // 插件主体
|
|||||||
ctx.SendChain(randRecord("RocketPunch.amr"))
|
ctx.SendChain(randRecord("RocketPunch.amr"))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
zero.OnKeywordGroup([]string{"喜欢", "爱你", "爱", "suki", "daisuki", "すき", "好き", "贴贴", "老婆", "亲一个", "mua"}, atriSwitch(), atriSleep(), zero.OnlyToMe).SetBlock(true).SetPriority(prio).
|
zero.OnFullMatchGroup([]string{"喜欢", "爱你", "爱", "suki", "daisuki", "すき", "好き", "贴贴", "老婆", "亲一个", "mua"}, atriSwitch(), atriSleep(), zero.OnlyToMe).SetBlock(true).SetPriority(prio).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
time.Sleep(time.Second * 1)
|
time.Sleep(time.Second * 1)
|
||||||
ctx.SendChain(randImage("SUKI.jpg", "SUKI1.jpg", "SUKI2.png"))
|
ctx.SendChain(randImage("SUKI.jpg", "SUKI1.jpg", "SUKI2.png"))
|
||||||
@ -57,7 +57,7 @@ func init() { // 插件主体
|
|||||||
time.Sleep(time.Second * 1)
|
time.Sleep(time.Second * 1)
|
||||||
ctx.SendChain(randImage("FN.jpg", "WQ.jpg", "WQ1.jpg"))
|
ctx.SendChain(randImage("FN.jpg", "WQ.jpg", "WQ1.jpg"))
|
||||||
})
|
})
|
||||||
zero.OnKeywordGroup([]string{"早安", "早哇", "早上好", "ohayo", "哦哈哟", "お早う", "早好", "早"}, atriSwitch()).SetBlock(true).SetPriority(prio).
|
zero.OnFullMatchGroup([]string{"早安", "早哇", "早上好", "ohayo", "哦哈哟", "お早う", "早好", "早"}, atriSwitch()).SetBlock(true).SetPriority(prio).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
now := time.Now().Hour()
|
now := time.Now().Hour()
|
||||||
switch {
|
switch {
|
||||||
@ -100,7 +100,7 @@ func init() { // 插件主体
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
zero.OnKeywordGroup([]string{"中午好", "午安", "午好"}, atriSwitch()).SetBlock(true).SetPriority(prio).
|
zero.OnFullMatchGroup([]string{"中午好", "午安", "午好"}, atriSwitch()).SetBlock(true).SetPriority(prio).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
now := time.Now().Hour()
|
now := time.Now().Hour()
|
||||||
if now > 11 && now < 15 { // 中午
|
if now > 11 && now < 15 { // 中午
|
||||||
@ -113,7 +113,7 @@ func init() { // 插件主体
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
zero.OnKeywordGroup([]string{"晚安", "oyasuminasai", "おやすみなさい", "晚好"}, atriSwitch()).SetBlock(true).SetPriority(prio).
|
zero.OnFullMatchGroup([]string{"晚安", "oyasuminasai", "おやすみなさい", "晚好"}, atriSwitch()).SetBlock(true).SetPriority(prio).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
now := time.Now().Hour()
|
now := time.Now().Hour()
|
||||||
switch {
|
switch {
|
||||||
|
|||||||
@ -13,14 +13,7 @@ import (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
//所有群添加定时早安
|
//所有群添加定时早安
|
||||||
//zero.RangeBot(func(id int64, ctx *zero.Ctx) bool { // test the range bot function
|
|
||||||
// result := ctx.GetGroupList()
|
|
||||||
// log.Println(result)
|
|
||||||
// for _, v := range result.Array() {
|
|
||||||
// Daily(v.Get("group_id").Int())
|
|
||||||
// }
|
|
||||||
// return true
|
|
||||||
//})
|
|
||||||
zero.OnCommand("daily").SetBlock(false).FirstPriority().Handle(func(ctx *zero.Ctx) {
|
zero.OnCommand("daily").SetBlock(false).FirstPriority().Handle(func(ctx *zero.Ctx) {
|
||||||
log.Println(ctx.GetGroupList())
|
log.Println(ctx.GetGroupList())
|
||||||
result := ctx.GetGroupList()
|
result := ctx.GetGroupList()
|
||||||
|
|||||||
@ -75,11 +75,11 @@ func init() { // 插件主体
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
zero.OnFullMatch("启动自动回复", zero.SuperUserPermission).SetBlock(true).SetPriority(prio).
|
zero.OnFullMatch("开启自动回复", zero.SuperUserPermission).SetBlock(true).SetPriority(prio).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
|
|
||||||
enable = true
|
enable = true
|
||||||
ctx.SendChain(message.Text("自动回复启动"))
|
ctx.SendChain(message.Text("自动回复开启"))
|
||||||
|
|
||||||
})
|
})
|
||||||
zero.OnFullMatch("关闭自动回复", zero.SuperUserPermission).SetBlock(true).SetPriority(prio).
|
zero.OnFullMatch("关闭自动回复", zero.SuperUserPermission).SetBlock(true).SetPriority(prio).
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user