diff --git a/src/structures/Channel.js b/src/structures/Channel.js index 644748891..b37b14b41 100644 --- a/src/structures/Channel.js +++ b/src/structures/Channel.js @@ -5,10 +5,11 @@ class Channel { constructor(client, data) { /** * The client that instantiated the Channel + * @name Channel#client * @type {Client} + * @readonly */ - this.client = client; - Object.defineProperty(this, 'client', { enumerable: false, configurable: false }); + Object.defineProperty(this, 'client', { value: client }); /** * The type of the channel, either: diff --git a/src/structures/Emoji.js b/src/structures/Emoji.js index ca533f929..a1823ba8f 100644 --- a/src/structures/Emoji.js +++ b/src/structures/Emoji.js @@ -8,10 +8,11 @@ class Emoji { constructor(guild, data) { /** * The Client that instantiated this object + * @name Emoji#client * @type {Client} + * @readonly */ - this.client = guild.client; - Object.defineProperty(this, 'client', { enumerable: false, configurable: false }); + Object.defineProperty(this, 'client', { value: guild.client }); /** * The guild this emoji is part of diff --git a/src/structures/Guild.js b/src/structures/Guild.js index f50c1bd98..81dddeeec 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -17,10 +17,11 @@ class Guild { constructor(client, data) { /** * The Client that created the instance of the the Guild. + * @name Guild#client * @type {Client} + * @readonly */ - this.client = client; - Object.defineProperty(this, 'client', { enumerable: false, configurable: false }); + Object.defineProperty(this, 'client', { value: client }); /** * A collection of members that are in this guild. The key is the member's ID, the value is the member. diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index d0513031f..d1e4867c8 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -13,10 +13,11 @@ class GuildMember { constructor(guild, data) { /** * The Client that instantiated this GuildMember + * @name GuildMember#client * @type {Client} + * @readonly */ - this.client = guild.client; - Object.defineProperty(this, 'client', { enumerable: false, configurable: false }); + Object.defineProperty(this, 'client', { value: guild.client }); /** * The guild that this member is part of diff --git a/src/structures/Invite.js b/src/structures/Invite.js index 7da9bc93f..b4b34dafd 100644 --- a/src/structures/Invite.js +++ b/src/structures/Invite.js @@ -31,10 +31,11 @@ class Invite { constructor(client, data) { /** * The client that instantiated the invite + * @name Invite#client * @type {Client} + * @readonly */ - this.client = client; - Object.defineProperty(this, 'client', { enumerable: false, configurable: false }); + Object.defineProperty(this, 'client', { value: client }); this.setup(data); } diff --git a/src/structures/Message.js b/src/structures/Message.js index 39a40b6b4..e015043da 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -12,10 +12,11 @@ class Message { constructor(channel, data, client) { /** * The Client that instantiated the Message + * @name Message#client * @type {Client} + * @readonly */ - this.client = client; - Object.defineProperty(this, 'client', { enumerable: false, configurable: false }); + Object.defineProperty(this, 'client', { value: client }); /** * The channel that the message was sent in diff --git a/src/structures/MessageAttachment.js b/src/structures/MessageAttachment.js index 0c87d3a75..29dfb524e 100644 --- a/src/structures/MessageAttachment.js +++ b/src/structures/MessageAttachment.js @@ -5,10 +5,11 @@ class MessageAttachment { constructor(message, data) { /** * The Client that instantiated this MessageAttachment. + * @name MessageAttachment#client * @type {Client} + * @readonly */ - this.client = message.client; - Object.defineProperty(this, 'client', { enumerable: false, configurable: false }); + Object.defineProperty(this, 'client', { value: message.client }); /** * The message this attachment is part of. diff --git a/src/structures/MessageEmbed.js b/src/structures/MessageEmbed.js index 2790a679c..9dd0a9a0f 100644 --- a/src/structures/MessageEmbed.js +++ b/src/structures/MessageEmbed.js @@ -5,10 +5,11 @@ class MessageEmbed { constructor(message, data) { /** * The client that instantiated this embed + * @name MessageEmbed#client * @type {Client} + * @readonly */ - this.client = message.client; - Object.defineProperty(this, 'client', { enumerable: false, configurable: false }); + Object.defineProperty(this, 'client', { value: message.client }); /** * The message this embed is part of diff --git a/src/structures/OAuth2Application.js b/src/structures/OAuth2Application.js index 1bd740b1c..b7c728581 100644 --- a/src/structures/OAuth2Application.js +++ b/src/structures/OAuth2Application.js @@ -5,10 +5,11 @@ class OAuth2Application { constructor(client, data) { /** * The client that instantiated the application + * @name OAuth2Application#client * @type {Client} + * @readonly */ - this.client = client; - Object.defineProperty(this, 'client', { enumerable: false, configurable: false }); + Object.defineProperty(this, 'client', { value: client }); this.setup(data); } diff --git a/src/structures/PartialGuild.js b/src/structures/PartialGuild.js index aff53cd84..407212e2f 100644 --- a/src/structures/PartialGuild.js +++ b/src/structures/PartialGuild.js @@ -12,10 +12,11 @@ class PartialGuild { constructor(client, data) { /** * The Client that instantiated this PartialGuild + * @name PartialGuild#client * @type {Client} + * @readonly */ - this.client = client; - Object.defineProperty(this, 'client', { enumerable: false, configurable: false }); + Object.defineProperty(this, 'client', { value: client }); this.setup(data); } diff --git a/src/structures/PartialGuildChannel.js b/src/structures/PartialGuildChannel.js index 87d54f540..e58a6bb91 100644 --- a/src/structures/PartialGuildChannel.js +++ b/src/structures/PartialGuildChannel.js @@ -11,10 +11,11 @@ class PartialGuildChannel { constructor(client, data) { /** * The Client that instantiated this PartialGuildChannel + * @name PartialGuildChannel#client * @type {Client} + * @readonly */ - this.client = client; - Object.defineProperty(this, 'client', { enumerable: false, configurable: false }); + Object.defineProperty(this, 'client', { value: client }); this.setup(data); } diff --git a/src/structures/Role.js b/src/structures/Role.js index fe4fd85e0..c56035eb6 100644 --- a/src/structures/Role.js +++ b/src/structures/Role.js @@ -7,10 +7,11 @@ class Role { constructor(guild, data) { /** * The client that instantiated the role + * @name Role#client * @type {Client} + * @readonly */ - this.client = guild.client; - Object.defineProperty(this, 'client', { enumerable: false, configurable: false }); + Object.defineProperty(this, 'client', { value: guild.client }); /** * The guild that the role belongs to diff --git a/src/structures/User.js b/src/structures/User.js index 28e8f73b5..d3218cf25 100644 --- a/src/structures/User.js +++ b/src/structures/User.js @@ -10,10 +10,11 @@ class User { constructor(client, data) { /** * The Client that created the instance of the the User. + * @name User#client * @type {Client} + * @readonly */ - this.client = client; - Object.defineProperty(this, 'client', { enumerable: false, configurable: false }); + Object.defineProperty(this, 'client', { value: client }); if (data) this.setup(data); } diff --git a/src/structures/UserProfile.js b/src/structures/UserProfile.js index d47ac922f..69f05c7ae 100644 --- a/src/structures/UserProfile.js +++ b/src/structures/UserProfile.js @@ -14,10 +14,11 @@ class UserProfile { /** * The Client that created the instance of the the UserProfile. + * @name UserProfile#client * @type {Client} + * @readonly */ - this.client = this.user.client; - Object.defineProperty(this, 'client', { enumerable: false, configurable: false }); + Object.defineProperty(this, 'client', { value: user.client }); /** * Guilds that the client user and the user share diff --git a/src/structures/Webhook.js b/src/structures/Webhook.js index 47b52acb2..56f9046b5 100644 --- a/src/structures/Webhook.js +++ b/src/structures/Webhook.js @@ -9,15 +9,16 @@ class Webhook { if (client) { /** * The Client that instantiated the Webhook + * @name Webhook#client * @type {Client} + * @readonly */ - this.client = client; - Object.defineProperty(this, 'client', { enumerable: false, configurable: false }); + Object.defineProperty(this, 'client', { value: client }); if (dataOrID) this.setup(dataOrID); } else { this.id = dataOrID; this.token = token; - this.client = this; + Object.defineProperty(this, 'client', { value: this }); } }