mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 06:20:08 +08:00
🎨 戳一戳独立到闲聊插件
This commit is contained in:
parent
d3888d22b1
commit
e4a78e5842
17
chat/chat.go
17
chat/chat.go
@ -1,24 +1,17 @@
|
|||||||
package chat
|
package chat
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"strconv"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
zero "github.com/wdvxdr1123/ZeroBot"
|
zero "github.com/wdvxdr1123/ZeroBot"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() { // 插件主体
|
func init() { // 插件主体
|
||||||
zero.OnNotice(zero.OnlyToMe).SetBlock(true).SetPriority(0).
|
// 戳一戳
|
||||||
|
zero.On("notice/notify/poke", zero.OnlyToMe).SetBlock(false).SetPriority(0).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
if ctx.Event.NoticeType != "notify" {
|
time.Sleep(time.Second * 1)
|
||||||
return
|
ctx.Send("请不要戳我 >_<")
|
||||||
}
|
return
|
||||||
bot, _ := strconv.ParseInt(zero.BotConfig.SelfID, 10, 64)
|
|
||||||
if ctx.Event.UserID == bot {
|
|
||||||
time.Sleep(time.Second * 1)
|
|
||||||
ctx.Send("请不要戳我 >_<")
|
|
||||||
ctx.Send(fmt.Sprintf("[CQ:poke,qq=%d]", ctx.Event.OperatorID))
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package manager
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/Yiwen-Chan/ZeroBot-Plugin/manager/utils"
|
"github.com/Yiwen-Chan/ZeroBot-Plugin/manager/utils"
|
||||||
zero "github.com/wdvxdr1123/ZeroBot"
|
zero "github.com/wdvxdr1123/ZeroBot"
|
||||||
@ -228,15 +227,6 @@ func init() { // 插件主体
|
|||||||
ctx.Send("📧 --> " + ctx.State["regex_matched"].([]string)[1])
|
ctx.Send("📧 --> " + ctx.State["regex_matched"].([]string)[1])
|
||||||
return
|
return
|
||||||
})
|
})
|
||||||
// 戳一戳
|
|
||||||
zero.OnNotice().SetBlock(false).SetPriority(40).
|
|
||||||
Handle(func(ctx *zero.Ctx) {
|
|
||||||
if ctx.Event.NoticeType == "notify" && ctx.Event.SubType == "poke" && ctx.Event.RawEvent.Get("target_id").Int() == utils.Str2Int(zero.BotConfig.SelfID) {
|
|
||||||
time.Sleep(time.Second * 1)
|
|
||||||
ctx.Send("请不要戳我 >_<")
|
|
||||||
}
|
|
||||||
return
|
|
||||||
})
|
|
||||||
// 入群欢迎
|
// 入群欢迎
|
||||||
zero.OnNotice().SetBlock(false).SetPriority(40).
|
zero.OnNotice().SetBlock(false).SetPriority(40).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user