mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
Fix Permissions now that member is deprecated (#1491)
This commit is contained in:
@@ -244,13 +244,13 @@ class GuildMember {
|
|||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get permissions() {
|
get permissions() {
|
||||||
if (this.user.id === this.guild.ownerID) return new Permissions(this, Permissions.ALL);
|
if (this.user.id === this.guild.ownerID) return new Permissions(Permissions.ALL);
|
||||||
|
|
||||||
let permissions = 0;
|
let permissions = 0;
|
||||||
const roles = this.roles;
|
const roles = this.roles;
|
||||||
for (const role of roles.values()) permissions |= role.permissions;
|
for (const role of roles.values()) permissions |= role.permissions;
|
||||||
|
|
||||||
return new Permissions(this, permissions);
|
return new Permissions(permissions);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user