翻牌不@

This commit is contained in:
fumiama 2021-06-17 00:01:26 +08:00
parent 48cd620fc1
commit 425e605ab2

View File

@ -265,13 +265,14 @@ func init() { // 插件主体
return return
}) })
// 随机点名 // 随机点名
zero.OnFullMatchGroup([]string{"翻牌"}, zero.AdminPermission).SetBlock(true).SetPriority(24). zero.OnFullMatchGroup([]string{"翻牌"}).SetBlock(true).SetPriority(40).
Handle(func(ctx *zero.Ctx) { Handle(func(ctx *zero.Ctx) {
if ctx.Event.GroupID > 0 {
list := ctx.GetGroupMemberList(ctx.Event.GroupID) list := ctx.GetGroupMemberList(ctx.Event.GroupID)
path := fmt.Sprint(rand.Intn(int(list.Get("#").Int()))) + ".user_id" path := fmt.Sprint(rand.Intn(int(list.Get("#").Int()))) + ".card"
random_user_id := list.Get(path).Int() random_card := list.Get(path).String()
ctx.SendChain(message.At(random_user_id), message.Text("就是你啦!")) ctx.Send(random_card + ",就是你啦!")
return }
}) })
// 入群欢迎 // 入群欢迎
zero.OnNotice().SetBlock(false).SetPriority(40). zero.OnNotice().SetBlock(false).SetPriority(40).