docs: use preferred nullable syntax (?T over T | null) (#9946)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Aura
2023-11-12 22:45:02 +01:00
committed by GitHub
parent 4bc1dae36f
commit 1e4ef35436
8 changed files with 12 additions and 12 deletions

View File

@@ -93,7 +93,7 @@ class GuildMemberManager extends CachedManager {
* <info>This method requires the {@link PermissionFlagsBits.CreateInstantInvite} permission. * <info>This method requires the {@link PermissionFlagsBits.CreateInstantInvite} permission.
* @param {UserResolvable} user The user to add to the guild * @param {UserResolvable} user The user to add to the guild
* @param {AddGuildMemberOptions} options Options for adding the user to the guild * @param {AddGuildMemberOptions} options Options for adding the user to the guild
* @returns {Promise<GuildMember|null>} * @returns {Promise<?GuildMember>}
*/ */
async add(user, options) { async add(user, options) {
const userId = this.client.users.resolveId(user); const userId = this.client.users.resolveId(user);
@@ -326,9 +326,9 @@ class GuildMemberManager extends CachedManager {
* @property {Collection<Snowflake, Role>|RoleResolvable[]} [roles] The roles or role ids to apply * @property {Collection<Snowflake, Role>|RoleResolvable[]} [roles] The roles or role ids to apply
* @property {boolean} [mute] Whether or not the member should be muted * @property {boolean} [mute] Whether or not the member should be muted
* @property {boolean} [deaf] Whether or not the member should be deafened * @property {boolean} [deaf] Whether or not the member should be deafened
* @property {GuildVoiceChannelResolvable|null} [channel] Channel to move the member to * @property {?GuildVoiceChannelResolvable} [channel] Channel to move the member to
* (if they are connected to voice), or `null` if you want to disconnect them from voice * (if they are connected to voice), or `null` if you want to disconnect them from voice
* @property {DateResolvable|null} [communicationDisabledUntil] The date or timestamp * @property {?DateResolvable} [communicationDisabledUntil] The date or timestamp
* for the member's communication to be disabled until. Provide `null` to enable communication again. * for the member's communication to be disabled until. Provide `null` to enable communication again.
* @property {GuildMemberFlagsResolvable} [flags] The flags to set for the member * @property {GuildMemberFlagsResolvable} [flags] The flags to set for the member
* @property {string} [reason] Reason for editing this user * @property {string} [reason] Reason for editing this user
@@ -400,7 +400,7 @@ class GuildMemberManager extends CachedManager {
/** /**
* Prunes members from the guild based on how long they have been inactive. * Prunes members from the guild based on how long they have been inactive.
* @param {GuildPruneMembersOptions} [options] Options for pruning * @param {GuildPruneMembersOptions} [options] Options for pruning
* @returns {Promise<number|null>} The number of members that were/will be kicked * @returns {Promise<?number>} The number of members that were/will be kicked
* @example * @example
* // See how many members will be pruned * // See how many members will be pruned
* guild.members.prune({ dry: true }) * guild.members.prune({ dry: true })

View File

@@ -144,7 +144,7 @@ class ApplicationCommand extends Base {
/** /**
* Whether the command can be used in DMs * Whether the command can be used in DMs
* <info>This property is always `null` on guild commands</info> * <info>This property is always `null` on guild commands</info>
* @type {boolean|null} * @type {?boolean}
*/ */
this.dmPermission = data.dm_permission; this.dmPermission = data.dm_permission;
} else { } else {

View File

@@ -404,7 +404,7 @@ class GuildMember extends Base {
/** /**
* Times this guild member out. * Times this guild member out.
* @param {DateResolvable|null} communicationDisabledUntil The date or timestamp * @param {?DateResolvable} communicationDisabledUntil The date or timestamp
* for the member's communication to be disabled until. Provide `null` to remove the timeout. * for the member's communication to be disabled until. Provide `null` to remove the timeout.
* @param {string} [reason] The reason for this timeout. * @param {string} [reason] The reason for this timeout.
* @returns {Promise<GuildMember>} * @returns {Promise<GuildMember>}
@@ -425,7 +425,7 @@ class GuildMember extends Base {
/** /**
* Times this guild member out. * Times this guild member out.
* @param {number|null} timeout The duration in milliseconds * @param {?number} timeout The duration in milliseconds
* for the member's communication to be disabled. Provide `null` to remove the timeout. * for the member's communication to be disabled. Provide `null` to remove the timeout.
* @param {string} [reason] The reason for this timeout. * @param {string} [reason] The reason for this timeout.
* @returns {Promise<GuildMember>} * @returns {Promise<GuildMember>}

View File

@@ -310,7 +310,7 @@ class ThreadChannel extends BaseChannel {
* or when the original message in the parent channel is deleted. * or when the original message in the parent channel is deleted.
* If you just need the id of that message, use {@link ThreadChannel#id} instead.</info> * If you just need the id of that message, use {@link ThreadChannel#id} instead.</info>
* @param {BaseFetchOptions} [options] Additional options for this fetch * @param {BaseFetchOptions} [options] Additional options for this fetch
* @returns {Promise<Message<true>|null>} * @returns {Promise<?Message<true>>}
*/ */
// eslint-disable-next-line require-await // eslint-disable-next-line require-await
async fetchStarterMessage(options) { async fetchStarterMessage(options) {

View File

@@ -197,7 +197,7 @@ class VoiceState extends Base {
/** /**
* Moves the member to a different channel, or disconnects them from the one they're in. * Moves the member to a different channel, or disconnects them from the one they're in.
* @param {GuildVoiceChannelResolvable|null} channel Channel to move the member to, or `null` if you want to * @param {?GuildVoiceChannelResolvable} channel Channel to move the member to, or `null` if you want to
* disconnect them from voice. * disconnect them from voice.
* @param {string} [reason] Reason for moving member to another channel or disconnecting * @param {string} [reason] Reason for moving member to another channel or disconnecting
* @returns {Promise<GuildMember>} * @returns {Promise<GuildMember>}

View File

@@ -81,7 +81,7 @@ class Collector extends EventEmitter {
/** /**
* The reason the collector ended * The reason the collector ended
* @type {string|null} * @type {?string}
* @private * @private
*/ */
this._endReason = null; this._endReason = null;

View File

@@ -55,7 +55,7 @@ class TextBasedChannel {
/** /**
* The base message options for messages. * The base message options for messages.
* @typedef {Object} BaseMessageOptions * @typedef {Object} BaseMessageOptions
* @property {string|null} [content=''] The content for the message. This can only be `null` when editing a message. * @property {?string} [content=''] The content for the message. This can only be `null` when editing a message.
* @property {Array<(EmbedBuilder|Embed|APIEmbed)>} [embeds] The embeds for the message * @property {Array<(EmbedBuilder|Embed|APIEmbed)>} [embeds] The embeds for the message
* @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content * @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content
* (see [here](https://discord.com/developers/docs/resources/channel#allowed-mentions-object) for more details) * (see [here](https://discord.com/developers/docs/resources/channel#allowed-mentions-object) for more details)

View File

@@ -7,7 +7,7 @@ const { DiscordjsTypeError, ErrorCodes } = require('../errors');
/** /**
* @typedef {Function} GlobalSweepFilter * @typedef {Function} GlobalSweepFilter
* @returns {Function|null} Return `null` to skip sweeping, otherwise a function passed to `sweep()`, * @returns {?Function} Return `null` to skip sweeping, otherwise a function passed to `sweep()`,
* See {@link [Collection#sweep](https://discord.js.org/docs/packages/collection/stable/Collection:Class#sweep)} * See {@link [Collection#sweep](https://discord.js.org/docs/packages/collection/stable/Collection:Class#sweep)}
* for the definition of this function. * for the definition of this function.
*/ */