MCPcopy Create free account
hub / github.com/FloatTech/ZeroBot-Plugin-Playground / checkRule

Function checkRule

plugin/exXiaoGuoFan/example.go:112–138  ·  view source on GitHub ↗
(ctx *zero.Ctx)

Source from the content-addressed store, hash-verified

110}
111
112func checkRule(ctx *zero.Ctx) bool {
113 if zero.OnlyPrivate(ctx) {
114 ctx.SendChain(message.Text("这是私聊信息"))
115 }
116 if zero.OnlyGroup(ctx) {
117 ctx.SendChain(message.Text("这是群聊信息"))
118 }
119 if zero.OnlyToMe(ctx) {
120 ctx.SendChain(message.Text("这是@bot的信息"))
121 }
122 if zero.OnlyGuild(ctx) {
123 ctx.SendChain(message.Text("这是频道信息"))
124 }
125 if zero.OnlyPublic(ctx) {
126 ctx.SendChain(message.Text("这是群聊或者频道信息"))
127 }
128 if zero.AdminPermission(ctx) {
129 ctx.SendChain(message.Text("你有管理员权限"))
130 }
131 if zero.OwnerPermission(ctx) {
132 ctx.SendChain(message.Text("你有群主权限"))
133 }
134 if zero.SuperUserPermission(ctx) {
135 ctx.SendChain(message.Text("你有主人权限"))
136 }
137 return true
138}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected