Skip to content

Commit

Permalink
fix: 使机器人管理员组的权限凌驾于群管理员 (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
lava081 authored Nov 17, 2024
1 parent 7ac3027 commit 3237e55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/event/handler/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export class EventBaseHandler {

const role = list[permission]
if (!role) return true
if (role.role === 'owner' && this.e.sender?.role === 'owner') return true
if (role.role === 'admin' && (this.e.sender?.role === 'owner' || this.e.sender?.role === 'admin')) return true
if (role.role === 'owner' && (this.e.sender?.role === 'owner' || this.e.isMaster || this.e.isAdmin)) return true
if (role.role === 'admin' && (this.e.sender?.role === 'owner' || this.e.sender?.role === 'admin' || this.e.isMaster || this.e.isAdmin)) return true

this.e.reply(`暂无权限,只有${role.name}才能操作`)
return false
Expand Down

0 comments on commit 3237e55

Please sign in to comment.