diff --git a/src/client/rest/RequestHandlers/RequestHandler.js b/src/client/rest/RequestHandlers/RequestHandler.js index 22bb53fa2..a93e6c031 100644 --- a/src/client/rest/RequestHandlers/RequestHandler.js +++ b/src/client/rest/RequestHandlers/RequestHandler.js @@ -23,6 +23,7 @@ class RequestHandler { /** * Whether or not the client is being rate limited on every endpoint. * @type {boolean} + * @readonly */ get globalLimit() { return this.restManager.globallyRateLimited; diff --git a/src/client/voice/VoiceBroadcast.js b/src/client/voice/VoiceBroadcast.js index 85a8261a1..cd1609955 100644 --- a/src/client/voice/VoiceBroadcast.js +++ b/src/client/voice/VoiceBroadcast.js @@ -42,6 +42,7 @@ class VoiceBroadcast extends VolumeInterface { /** * An array of subscribed dispatchers * @type {StreamDispatcher[]} + * @readonly */ get dispatchers() { let d = []; diff --git a/src/client/voice/dispatcher/StreamDispatcher.js b/src/client/voice/dispatcher/StreamDispatcher.js index b07e09c21..5c3cacddb 100644 --- a/src/client/voice/dispatcher/StreamDispatcher.js +++ b/src/client/voice/dispatcher/StreamDispatcher.js @@ -55,6 +55,7 @@ class StreamDispatcher extends VolumeInterface { * How many passes the dispatcher should take when sending packets to reduce packet loss. Values over 5 * aren't recommended, as it means you are using 5x more bandwidth. You _can_ edit this at runtime. * @type {number} + * @readonly */ get passes() { return this.streamOptions.passes || 1; diff --git a/src/client/voice/player/AudioPlayer.js b/src/client/voice/player/AudioPlayer.js index e54a4bd93..54932bcb8 100644 --- a/src/client/voice/player/AudioPlayer.js +++ b/src/client/voice/player/AudioPlayer.js @@ -53,6 +53,7 @@ class AudioPlayer extends EventEmitter { /** * The current dispatcher * @type {?StreamDispatcher} + * @readonly */ get currentDispatcher() { return this.streams.size > 0 ? this.streams.last().dispatcher || null : null; diff --git a/src/structures/Guild.js b/src/structures/Guild.js index 47c456779..46ea9ea1f 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -306,6 +306,7 @@ class Guild { * Fetches a collection of roles in the current guild sorted by position. * @type {Collection} * @readonly + * @private */ get _sortedRoles() { return this._sortPositionWithID(this.roles); @@ -963,6 +964,7 @@ class Guild { * Fetches a collection of channels in the current guild sorted by position. * @param {string} type Channel type * @returns {Collection} + * @private */ _sortedChannels(type) { return this._sortPositionWithID(this.channels.filter(c => { @@ -977,6 +979,7 @@ class Guild { * Intended to be identical to Discord's sorting method. * @param {Collection} collection The collection to sort * @returns {Collection} + * @private */ _sortPositionWithID(collection) { return collection.sort((a, b) => diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index d8a801e3f..c5f11a77d 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -49,6 +49,7 @@ class GuildChannel extends Channel { /** * The position of the channel * @type {number} + * @readonly */ get calculatedPosition() { const sorted = this.guild._sortedChannels(this.type); diff --git a/src/structures/MessageEmbed.js b/src/structures/MessageEmbed.js index cb7d59c91..eba8b870b 100644 --- a/src/structures/MessageEmbed.js +++ b/src/structures/MessageEmbed.js @@ -105,6 +105,7 @@ class MessageEmbed { /** * The date this embed was created * @type {Date} + * @readonly */ get createdAt() { return new Date(this.createdTimestamp); diff --git a/src/structures/MessageReaction.js b/src/structures/MessageReaction.js index cd7f6114f..2d1777b28 100644 --- a/src/structures/MessageReaction.js +++ b/src/structures/MessageReaction.js @@ -39,6 +39,7 @@ class MessageReaction { * object which has fewer properties. Whatever the prototype of the emoji, it will still have * `name`, `id`, `identifier` and `toString()` * @type {Emoji|ReactionEmoji} + * @readonly */ get emoji() { if (this._emoji instanceof Emoji) return this._emoji; diff --git a/src/structures/Role.js b/src/structures/Role.js index 44a5f4275..eb6228a34 100644 --- a/src/structures/Role.js +++ b/src/structures/Role.js @@ -126,6 +126,7 @@ class Role { /** * The position of the role in the role manager * @type {number} + * @readonly */ get calculatedPosition() { const sorted = this.guild._sortedRoles; diff --git a/src/structures/User.js b/src/structures/User.js index ad5c591b1..1b876f2de 100644 --- a/src/structures/User.js +++ b/src/structures/User.js @@ -175,6 +175,7 @@ class User { /** * The DM between the client's user and this user * @type {?DMChannel} + * @readonly */ get dmChannel() { return this.client.channels.filter(c => c.type === 'dm').find(c => c.recipient.id === this.id); diff --git a/src/structures/VoiceChannel.js b/src/structures/VoiceChannel.js index b69279c8e..5a5ed6d36 100644 --- a/src/structures/VoiceChannel.js +++ b/src/structures/VoiceChannel.js @@ -48,6 +48,7 @@ class VoiceChannel extends GuildChannel { /** * Checks if the voice channel is full * @type {boolean} + * @readonly */ get full() { return this.userLimit > 0 && this.members.size >= this.userLimit; @@ -56,6 +57,7 @@ class VoiceChannel extends GuildChannel { /** * Checks if the client has permission join the voice channel * @type {boolean} + * @readonly */ get joinable() { if (this.client.browser) return false; @@ -67,6 +69,7 @@ class VoiceChannel extends GuildChannel { /** * Checks if the client has permission to send audio to the voice channel * @type {boolean} + * @readonly */ get speakable() { return this.permissionsFor(this.client.user).hasPermission('SPEAK'); diff --git a/src/util/Permissions.js b/src/util/Permissions.js index e099d8390..bbc4e4d77 100644 --- a/src/util/Permissions.js +++ b/src/util/Permissions.js @@ -32,6 +32,7 @@ class Permissions { * @type {number} * @see {@link Permissions#bitfield} * @deprecated + * @readonly */ get raw() { return this.bitfield;