mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
docs(*): wrap optional properties with union types in parentheses (#6021)
This commit is contained in:
@@ -55,7 +55,7 @@ class ClientApplication extends Application {
|
||||
|
||||
/**
|
||||
* The owner of this OAuth application
|
||||
* @type {?User|Team}
|
||||
* @type {?(User|Team)}
|
||||
*/
|
||||
this.owner = data.team
|
||||
? new Team(this.client, data.team)
|
||||
|
||||
@@ -103,7 +103,7 @@ class ClientUser extends Structures.get('User') {
|
||||
* @property {PresenceStatusData} [status] Status of the user
|
||||
* @property {boolean} [afk] Whether the user is AFK
|
||||
* @property {ActivitiesOptions[]} [activities] Activity the user is playing
|
||||
* @property {?number|number[]} [shardID] Shard Id(s) to have the activity set on
|
||||
* @property {?(number|number[])} [shardID] Shard Id(s) to have the activity set on
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -130,7 +130,7 @@ class ClientUser extends Structures.get('User') {
|
||||
/**
|
||||
* Sets the status of the client user.
|
||||
* @param {PresenceStatusData} status Status to change to
|
||||
* @param {?number|number[]} [shardID] Shard ID(s) to have the activity set on
|
||||
* @param {?(number|number[])} [shardID] Shard ID(s) to have the activity set on
|
||||
* @returns {Presence}
|
||||
* @example
|
||||
* // Set the client user's status
|
||||
|
||||
@@ -17,7 +17,7 @@ class CommandInteraction extends Interaction {
|
||||
|
||||
/**
|
||||
* The channel this interaction was sent in
|
||||
* @type {?TextChannel|NewsChannel|DMChannel}
|
||||
* @type {?(TextChannel|NewsChannel|DMChannel)}
|
||||
* @name CommandInteraction#channel
|
||||
* @readonly
|
||||
*/
|
||||
|
||||
@@ -354,7 +354,7 @@ class GuildAuditLogsEntry {
|
||||
|
||||
/**
|
||||
* Specific property changes
|
||||
* @type {?(AuditLogChange[])}
|
||||
* @type {?AuditLogChange[]}
|
||||
*/
|
||||
this.changes = data.changes?.map(c => ({ key: c.key, old: c.old_value, new: c.new_value })) ?? null;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ class Interaction extends Base {
|
||||
|
||||
/**
|
||||
* If this interaction was sent in a guild, the member which sent it
|
||||
* @type {?GuildMember|APIGuildMember}
|
||||
* @type {?(GuildMember|APIGuildMember)}
|
||||
*/
|
||||
this.member = data.member ? this.guild?.members.add(data.member) ?? data.member : null;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class InteractionCollector extends Collector {
|
||||
|
||||
/**
|
||||
* The channel from which to collect interactions, if provided
|
||||
* @type {?TextChannel|DMChannel|NewsChannel}
|
||||
* @type {?(TextChannel|DMChannel|NewsChannel)}
|
||||
*/
|
||||
this.channel = this.message?.channel ?? options.channel ?? null;
|
||||
|
||||
|
||||
@@ -68,13 +68,13 @@ class Webhook {
|
||||
|
||||
/**
|
||||
* The owner of the webhook
|
||||
* @type {?User|APIUser}
|
||||
* @type {?(User|APIUser)}
|
||||
*/
|
||||
this.owner = data.user ? this.client.users?.add(data.user) ?? data.user : null;
|
||||
|
||||
/**
|
||||
* The source guild of the webhook
|
||||
* @type {?Guild|APIGuild}
|
||||
* @type {?(Guild|APIGuild)}
|
||||
*/
|
||||
this.sourceGuild = data.source_guild
|
||||
? this.client.guilds?.add(data.source_guild, false) ?? data.source_guild
|
||||
@@ -82,7 +82,7 @@ class Webhook {
|
||||
|
||||
/**
|
||||
* The source channel of the webhook
|
||||
* @type {?Channel|APIChannel}
|
||||
* @type {?(Channel|APIChannel)}
|
||||
*/
|
||||
this.sourceChannel = this.client.channels?.resolve(data.source_channel?.id) ?? data.source_channel ?? null;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class WelcomeChannel extends Base {
|
||||
|
||||
/**
|
||||
* The channel of this welcome channel
|
||||
* @type {?TextChannel|NewsChannel}
|
||||
* @type {?(TextChannel|NewsChannel)}
|
||||
*/
|
||||
get channel() {
|
||||
return this.client.channels.resolve(this.channelID);
|
||||
|
||||
Reference in New Issue
Block a user