mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-15 01:49:10 +00:00
fix(DiscordService): getPermissions heeds owner powers
This commit is contained in:
parent
12d94b1576
commit
0e70e2590b
3 changed files with 5 additions and 4 deletions
|
@ -71,10 +71,11 @@ module.exports = (R, $) => {
|
|||
return
|
||||
}
|
||||
|
||||
const guild = await $.discord.getServer(id)
|
||||
const guildRoles = await $.discord.getRoles(id)
|
||||
|
||||
// check perms
|
||||
if (!$.discord.getPermissions(gm, guildRoles).canManageRoles) {
|
||||
if (!$.discord.getPermissions(gm, guildRoles, guild).canManageRoles) {
|
||||
ctx.status = 403
|
||||
ctx.body = { err: 'cannot_manage_roles' }
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue