From 9288cd8563c0cadac431af60a2da67f325267b6c Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Mon, 19 Sep 2016 01:43:24 -0400 Subject: [PATCH] Replace usages of owner.id with ownerID, and fix GroupDMChannel.equals --- src/client/ClientDataResolver.js | 2 +- src/structures/GroupDMChannel.js | 2 +- src/structures/GuildChannel.js | 2 +- src/structures/GuildMember.js | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/ClientDataResolver.js b/src/client/ClientDataResolver.js index f22fd7528..38ce966a4 100644 --- a/src/client/ClientDataResolver.js +++ b/src/client/ClientDataResolver.js @@ -55,7 +55,7 @@ class ClientDataResolver { if (user instanceof User || user instanceof GuildMember) return user.id; if (typeof user === 'string') return user || null; if (user instanceof Message) return user.author.id; - if (user instanceof Guild) return user.owner.id; + if (user instanceof Guild) return user.ownerID; return null; } diff --git a/src/structures/GroupDMChannel.js b/src/structures/GroupDMChannel.js index 8d6a2b7a5..9e9296aae 100644 --- a/src/structures/GroupDMChannel.js +++ b/src/structures/GroupDMChannel.js @@ -97,7 +97,7 @@ class GroupDMChannel extends Channel { this.id === channel.id && this.name === channel.name && this.icon === channel.icon && - this.owner.id === channel.owner_id; + this.ownerID === channel.ownerID; if (equal) { const thisIDs = this.recipients.array().map(r => r.id); diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index e5644bf78..00cee42d5 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -57,7 +57,7 @@ class GuildChannel extends Channel { permissionsFor(member) { member = this.client.resolver.resolveGuildMember(this.guild, member); if (!member) return null; - if (this.guild.owner.id === member.id) return new EvaluatedPermissions(member, Constants.ALL_PERMISSIONS); + if (member.id === this.guild.ownerID) return new EvaluatedPermissions(member, Constants.ALL_PERMISSIONS); let permissions = 0; diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index 41c836975..80812f1ba 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -163,7 +163,7 @@ class GuildMember { * @type {EvaluatedPermissions} */ get permissions() { - if (this.guild.owner.id === this.user.id) return new EvaluatedPermissions(this, Constants.ALL_PERMISSIONS); + if (this.user.id === this.guild.ownerID) return new EvaluatedPermissions(this, Constants.ALL_PERMISSIONS); let permissions = 0; const roles = this.roles; @@ -217,7 +217,7 @@ class GuildMember { * @returns {boolean} */ hasPermission(permission, explicit = false) { - if (!explicit && this.guild.owner.id === this.user.id) return true; + if (!explicit && this.user.id === this.guild.ownerID) return true; return this.roles.some(r => r.hasPermission(permission, explicit)); } @@ -228,7 +228,7 @@ class GuildMember { * @returns {boolean} */ hasPermissions(permissions, explicit = false) { - if (!explicit && this.guild.owner.id === this.user.id) return true; + if (!explicit && this.user.id === this.guild.ownerID) return true; return permissions.map(p => this.hasPermission(p, explicit)).every(v => v); }