mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
Replace usages of owner.id with ownerID, and fix GroupDMChannel.equals
This commit is contained in:
@@ -55,7 +55,7 @@ class ClientDataResolver {
|
|||||||
if (user instanceof User || user instanceof GuildMember) return user.id;
|
if (user instanceof User || user instanceof GuildMember) return user.id;
|
||||||
if (typeof user === 'string') return user || null;
|
if (typeof user === 'string') return user || null;
|
||||||
if (user instanceof Message) return user.author.id;
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ class GroupDMChannel extends Channel {
|
|||||||
this.id === channel.id &&
|
this.id === channel.id &&
|
||||||
this.name === channel.name &&
|
this.name === channel.name &&
|
||||||
this.icon === channel.icon &&
|
this.icon === channel.icon &&
|
||||||
this.owner.id === channel.owner_id;
|
this.ownerID === channel.ownerID;
|
||||||
|
|
||||||
if (equal) {
|
if (equal) {
|
||||||
const thisIDs = this.recipients.array().map(r => r.id);
|
const thisIDs = this.recipients.array().map(r => r.id);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class GuildChannel extends Channel {
|
|||||||
permissionsFor(member) {
|
permissionsFor(member) {
|
||||||
member = this.client.resolver.resolveGuildMember(this.guild, member);
|
member = this.client.resolver.resolveGuildMember(this.guild, member);
|
||||||
if (!member) return null;
|
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;
|
let permissions = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ class GuildMember {
|
|||||||
* @type {EvaluatedPermissions}
|
* @type {EvaluatedPermissions}
|
||||||
*/
|
*/
|
||||||
get permissions() {
|
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;
|
let permissions = 0;
|
||||||
const roles = this.roles;
|
const roles = this.roles;
|
||||||
@@ -217,7 +217,7 @@ class GuildMember {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
hasPermission(permission, explicit = false) {
|
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));
|
return this.roles.some(r => r.hasPermission(permission, explicit));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,7 +228,7 @@ class GuildMember {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
hasPermissions(permissions, explicit = false) {
|
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);
|
return permissions.map(p => this.hasPermission(p, explicit)).every(v => v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user