mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
docs: mark getters as @ readonly
This commit is contained in:
@@ -30,8 +30,8 @@ class ClientUser extends Structures.get('User') {
|
||||
|
||||
/**
|
||||
* ClientUser's presence
|
||||
* @readonly
|
||||
* @type {Presence}
|
||||
* @readonly
|
||||
*/
|
||||
get presence() {
|
||||
return this.client.presence;
|
||||
|
||||
@@ -49,6 +49,7 @@ class DMChannel extends Channel {
|
||||
/**
|
||||
* Whether this DMChannel is a partial
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
get partial() {
|
||||
return !this.recipient;
|
||||
|
||||
@@ -83,6 +83,7 @@ class GuildMember extends Base {
|
||||
/**
|
||||
* Whether this GuildMember is a partial
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
get partial() {
|
||||
return !this.joinedTimestamp;
|
||||
|
||||
@@ -172,6 +172,7 @@ class Message extends Base {
|
||||
/**
|
||||
* Whether or not this message is a partial
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
get partial() {
|
||||
return typeof this.content !== 'string' || !this.author;
|
||||
|
||||
@@ -45,6 +45,7 @@ class Presence {
|
||||
/**
|
||||
* The user of this presence
|
||||
* @type {?User}
|
||||
* @readonly
|
||||
*/
|
||||
get user() {
|
||||
return this.client.users.get(this.userID) || null;
|
||||
@@ -53,6 +54,7 @@ class Presence {
|
||||
/**
|
||||
* The member of this presence
|
||||
* @type {?GuildMember}
|
||||
* @readonly
|
||||
*/
|
||||
get member() {
|
||||
return this.guild.members.get(this.userID) || null;
|
||||
|
||||
@@ -78,6 +78,7 @@ class User extends Base {
|
||||
/**
|
||||
* Whether this User is a partial
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
get partial() {
|
||||
return typeof this.username !== 'string';
|
||||
|
||||
@@ -30,6 +30,7 @@ class VoiceChannel extends GuildChannel {
|
||||
* The members in this voice channel
|
||||
* @type {Collection<Snowflake, GuildMember>}
|
||||
* @name VoiceChannel#members
|
||||
* @readonly
|
||||
*/
|
||||
get members() {
|
||||
const coll = new Collection();
|
||||
|
||||
@@ -58,6 +58,7 @@ class VoiceState extends Base {
|
||||
/**
|
||||
* The member that this voice state belongs to
|
||||
* @type {?GuildMember}
|
||||
* @readonly
|
||||
*/
|
||||
get member() {
|
||||
return this.guild.members.get(this.id) || null;
|
||||
@@ -66,6 +67,7 @@ class VoiceState extends Base {
|
||||
/**
|
||||
* The channel that the member is connected to
|
||||
* @type {?VoiceChannel}
|
||||
* @readonly
|
||||
*/
|
||||
get channel() {
|
||||
return this.guild.channels.get(this.channelID) || null;
|
||||
@@ -74,6 +76,7 @@ class VoiceState extends Base {
|
||||
/**
|
||||
* Whether this member is either self-deafened or server-deafened
|
||||
* @type {?boolean}
|
||||
* @readonly
|
||||
*/
|
||||
get deaf() {
|
||||
return this.serverDeaf || this.selfDeaf;
|
||||
@@ -82,6 +85,7 @@ class VoiceState extends Base {
|
||||
/**
|
||||
* Whether this member is either self-muted or server-muted
|
||||
* @type {?boolean}
|
||||
* @readonly
|
||||
*/
|
||||
get mute() {
|
||||
return this.serverMute || this.selfMute;
|
||||
@@ -91,6 +95,7 @@ class VoiceState extends Base {
|
||||
* Whether this member is currently speaking. A boolean if the information is available (aka
|
||||
* the bot is connected to any voice channel in the guild), otherwise this is null
|
||||
* @type {?boolean}
|
||||
* @readonly
|
||||
*/
|
||||
get speaking() {
|
||||
return this.channel && this.channel.connection ?
|
||||
|
||||
Reference in New Issue
Block a user