Skip to content

Commit

Permalink
optimize: GroupHigherPermission
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Jul 28, 2023
1 parent 621c983 commit c70923d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rules.go
Expand Up @@ -252,11 +252,12 @@ func UserOrGrpAdmin(ctx *Ctx) bool {
// GroupHigherPermission 群发送者权限高于 target
//
// 隐含 OnlyGroup 判断
func GroupHigherPermission(target int64) Rule {
func GroupHigherPermission(gettarget func(ctx *Ctx) int64) Rule {
return func(ctx *Ctx) bool {
if !OnlyGroup(ctx) {
return false
}
target := gettarget(ctx)
if SuperUserPermission(ctx) {
sender := ctx.Event.UserID
return BotConfig.GetFirstSuperUser(sender, target) == sender
Expand Down

0 comments on commit c70923d

Please sign in to comment.