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 c70923d commit 4fd3637
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rules.go
Expand Up @@ -258,6 +258,9 @@ func GroupHigherPermission(gettarget func(ctx *Ctx) int64) Rule {
return false
}
target := gettarget(ctx)
if target == ctx.Event.UserID { // 特判, 自己和自己比
return false
}
if SuperUserPermission(ctx) {
sender := ctx.Event.UserID
return BotConfig.GetFirstSuperUser(sender, target) == sender
Expand Down

0 comments on commit 4fd3637

Please sign in to comment.