mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 13:59:39 +08:00
✨ 添加戳一戳回戳
This commit is contained in:
parent
dd8606fb81
commit
4736b19639
24
chat/chat.go
Normal file
24
chat/chat.go
Normal file
@ -0,0 +1,24 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
zero "github.com/wdvxdr1123/ZeroBot"
|
||||
)
|
||||
|
||||
func init() { // 插件主体
|
||||
zero.OnNotice(zero.OnlyToMe).SetBlock(true).SetPriority(0).
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
if ctx.Event.NoticeType != "notify" {
|
||||
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))
|
||||
}
|
||||
})
|
||||
}
|
||||
1
main.go
1
main.go
@ -8,6 +8,7 @@ import (
|
||||
zero "github.com/wdvxdr1123/ZeroBot"
|
||||
"github.com/wdvxdr1123/ZeroBot/driver"
|
||||
|
||||
_ "github.com/Yiwen-Chan/ZeroBot-Plugin/chat"
|
||||
_ "github.com/Yiwen-Chan/ZeroBot-Plugin/github"
|
||||
_ "github.com/Yiwen-Chan/ZeroBot-Plugin/manager"
|
||||
_ "github.com/Yiwen-Chan/ZeroBot-Plugin/music"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user