Replace usages of owner.id with ownerID, and fix GroupDMChannel.equals

This commit is contained in:
Schuyler Cebulskie
2016-09-19 01:43:24 -04:00
parent 77e171e599
commit 9288cd8563
4 changed files with 6 additions and 6 deletions

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);
}