From c44ea50157cecc9495df44a952fc0400a6f56e26 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Wed, 13 Oct 2021 11:20:44 +0100 Subject: [PATCH] docs: Typos, consistency and grammar fixes (#6811) --- src/client/Client.js | 2 +- src/client/WebhookClient.js | 2 +- src/client/websocket/WebSocketShard.js | 2 +- src/errors/Messages.js | 4 ++-- src/managers/ApplicationCommandManager.js | 4 ++-- .../ApplicationCommandPermissionsManager.js | 2 +- src/managers/GuildEmojiManager.js | 2 +- src/managers/GuildManager.js | 2 +- src/managers/GuildMemberManager.js | 2 +- src/managers/GuildStickerManager.js | 2 +- src/rest/RateLimitError.js | 2 +- src/rest/RequestHandler.js | 4 ++-- src/sharding/ShardingManager.js | 2 +- src/structures/BaseGuildTextChannel.js | 2 +- src/structures/CategoryChannel.js | 6 +++--- src/structures/Emoji.js | 2 +- src/structures/Guild.js | 4 ++-- src/structures/GuildChannel.js | 12 ++++++------ src/structures/GuildMember.js | 4 ++-- src/structures/GuildTemplate.js | 6 +++--- src/structures/IntegrationApplication.js | 6 +++--- src/structures/InteractionCollector.js | 2 +- src/structures/Message.js | 2 +- src/structures/MessageEmbed.js | 2 +- src/structures/MessagePayload.js | 6 +++--- src/structures/Presence.js | 4 ++-- src/structures/ReactionCollector.js | 2 +- src/structures/Role.js | 2 +- src/structures/StageChannel.js | 2 +- src/structures/Sticker.js | 2 +- src/structures/TextChannel.js | 8 ++++---- src/structures/ThreadChannel.js | 10 +++++----- src/structures/Webhook.js | 2 +- src/structures/Widget.js | 2 +- src/structures/interfaces/Collector.js | 2 +- src/util/BitField.js | 2 +- src/util/Constants.js | 4 ++-- src/util/Formatters.js | 2 +- src/util/Intents.js | 2 +- src/util/Options.js | 15 ++++++++------- src/util/SystemChannelFlags.js | 4 ++-- src/util/Util.js | 10 +++++----- 42 files changed, 81 insertions(+), 80 deletions(-) diff --git a/src/client/Client.js b/src/client/Client.js index c0e980ac8..b79f1683b 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -218,7 +218,7 @@ class Client extends BaseClient { } /** - * Logs the client in, establishing a websocket connection to Discord. + * Logs the client in, establishing a WebSocket connection to Discord. * @param {string} [token=this.token] Token of the account to log in with * @returns {Promise} Token of the account used * @example diff --git a/src/client/WebhookClient.js b/src/client/WebhookClient.js index dd51ecbe3..ce458a71a 100644 --- a/src/client/WebhookClient.js +++ b/src/client/WebhookClient.js @@ -15,7 +15,7 @@ class WebhookClient extends BaseClient { * @typedef {Object} WebhookClientData * @property {Snowflake} [id] The id of the webhook * @property {string} [token] The token of the webhook - * @property {string} [url] The full url for the webhook client + * @property {string} [url] The full URL for the webhook client */ /** diff --git a/src/client/websocket/WebSocketShard.js b/src/client/websocket/WebSocketShard.js index 425e561f6..11283345e 100644 --- a/src/client/websocket/WebSocketShard.js +++ b/src/client/websocket/WebSocketShard.js @@ -743,7 +743,7 @@ class WebSocketShard extends EventEmitter { this.sessionId = null; } - // Step 6: reset the ratelimit data + // Step 6: reset the rate limit data this.ratelimit.remaining = this.ratelimit.total; this.ratelimit.queue.length = 0; if (this.ratelimit.timer) { diff --git a/src/errors/Messages.js b/src/errors/Messages.js index 2e5eb6c6b..9a2a61de2 100644 --- a/src/errors/Messages.js +++ b/src/errors/Messages.js @@ -13,7 +13,7 @@ const Messages = { WS_CLOSE_REQUESTED: 'WebSocket closed due to user request.', WS_CONNECTION_EXISTS: 'There is already an existing WebSocket connection.', - WS_NOT_OPEN: (data = 'data') => `Websocket not open to send ${data}`, + WS_NOT_OPEN: (data = 'data') => `WebSocket not open to send ${data}`, MANAGER_DESTROYED: 'Manager was destroyed.', BITFIELD_INVALID: bit => `Invalid bitfield flag or number: ${bit}.`, @@ -47,7 +47,7 @@ const Messages = { EMBED_AUTHOR_NAME: 'MessageEmbed author name must be a string.', BUTTON_LABEL: 'MessageButton label must be a string', - BUTTON_URL: 'MessageButton url must be a string', + BUTTON_URL: 'MessageButton URL must be a string', BUTTON_CUSTOM_ID: 'MessageButton customId must be a string', SELECT_MENU_CUSTOM_ID: 'MessageSelectMenu customId must be a string', diff --git a/src/managers/ApplicationCommandManager.js b/src/managers/ApplicationCommandManager.js index c053382f3..3c154a838 100644 --- a/src/managers/ApplicationCommandManager.js +++ b/src/managers/ApplicationCommandManager.js @@ -54,14 +54,14 @@ class ApplicationCommandManager extends CachedManager { */ /** - * Options used to fetch data from discord + * Options used to fetch data from Discord * @typedef {Object} BaseFetchOptions * @property {boolean} [cache=true] Whether to cache the fetched data if it wasn't already * @property {boolean} [force=false] Whether to skip the cache check and request the API */ /** - * Options used to fetch Application Commands from discord + * Options used to fetch Application Commands from Discord * @typedef {BaseFetchOptions} FetchApplicationCommandOptions * @property {Snowflake} [guildId] The guild's id to fetch commands for, for when the guild is not cached */ diff --git a/src/managers/ApplicationCommandPermissionsManager.js b/src/managers/ApplicationCommandPermissionsManager.js index 8d9805f5c..b014131a0 100644 --- a/src/managers/ApplicationCommandPermissionsManager.js +++ b/src/managers/ApplicationCommandPermissionsManager.js @@ -328,7 +328,7 @@ class ApplicationCommandPermissionsManager extends BaseManager { } /** - * Options used to check existance of permissions on a command + * Options used to check the existence of permissions on a command * The `command` parameter is not optional when the managers `commandId` is `null` * @typedef {BaseApplicationCommandPermissionsOptions} HasApplicationCommandPermissionsOptions * @param {UserResolvable|RoleResolvable} permissionId The user or role to check if a permission exists for diff --git a/src/managers/GuildEmojiManager.js b/src/managers/GuildEmojiManager.js index 6c1c689db..58ffa6242 100644 --- a/src/managers/GuildEmojiManager.js +++ b/src/managers/GuildEmojiManager.js @@ -38,7 +38,7 @@ class GuildEmojiManager extends BaseGuildEmojiManager { * @param {GuildEmojiCreateOptions} [options] Options for creating the emoji * @returns {Promise} The created emoji * @example - * // Create a new emoji from a url + * // Create a new emoji from a URL * guild.emojis.create('https://i.imgur.com/w3duR07.png', 'rip') * .then(emoji => console.log(`Created new emoji with name ${emoji.name}!`)) * .catch(console.error); diff --git a/src/managers/GuildManager.js b/src/managers/GuildManager.js index 6ed1c586e..0a492aa35 100644 --- a/src/managers/GuildManager.js +++ b/src/managers/GuildManager.js @@ -93,7 +93,7 @@ class GuildManager extends CachedManager { * @property {number} [userLimit] The user limit of the channel * @property {PartialOverwriteData[]} [permissionOverwrites] * Overwrites of the channel - * @property {number} [rateLimitPerUser] The rate limit per user of the channel in seconds + * @property {number} [rateLimitPerUser] The rate limit per user (slowmode) of the channel in seconds */ /** diff --git a/src/managers/GuildMemberManager.js b/src/managers/GuildMemberManager.js index c6f855c79..d0a4386d5 100644 --- a/src/managers/GuildMemberManager.js +++ b/src/managers/GuildMemberManager.js @@ -76,7 +76,7 @@ class GuildMemberManager extends CachedManager { * (requires `MANAGE_ROLES`) * @property {boolean} [mute] Whether the member should be muted (requires `MUTE_MEMBERS`) * @property {boolean} [deaf] Whether the member should be deafened (requires `DEAFEN_MEMBERS`) - * @property {boolean} [force] Whehter to skip the cache check and call the API directly + * @property {boolean} [force] Whether to skip the cache check and call the API directly * @property {boolean} [fetchWhenExisting=true] Whether to fetch the user if not cached and already a member */ diff --git a/src/managers/GuildStickerManager.js b/src/managers/GuildStickerManager.js index 24a61f616..99192e227 100644 --- a/src/managers/GuildStickerManager.js +++ b/src/managers/GuildStickerManager.js @@ -46,7 +46,7 @@ class GuildStickerManager extends CachedManager { * @param {GuildStickerCreateOptions} [options] Options * @returns {Promise} The created sticker * @example - * // Create a new sticker from a url + * // Create a new sticker from a URL * guild.stickers.create('https://i.imgur.com/w3duR07.png', 'rip') * .then(sticker => console.log(`Created new sticker with name ${sticker.name}!`)) * .catch(console.error); diff --git a/src/rest/RateLimitError.js b/src/rest/RateLimitError.js index f551539e3..494954c7d 100644 --- a/src/rest/RateLimitError.js +++ b/src/rest/RateLimitError.js @@ -45,7 +45,7 @@ class RateLimitError extends Error { this.global = global; /** - * The maximum amount of requests of this end point + * The maximum amount of requests of this endpoint * @type {number} */ this.limit = limit; diff --git a/src/rest/RequestHandler.js b/src/rest/RequestHandler.js index 6ad8fdfa7..8ec808224 100644 --- a/src/rest/RequestHandler.js +++ b/src/rest/RequestHandler.js @@ -167,7 +167,7 @@ class RequestHandler { * @typedef {Object} APIRequest * @property {HTTPMethod} method The HTTP method used in this request * @property {string} path The full path used to make the request - * @property {string} route The API route identifying the ratelimit for this request + * @property {string} route The API route identifying the rate limit for this request * @property {Object} options Additional options for this request * @property {number} retries The number of times this request has been attempted */ @@ -248,7 +248,7 @@ class RequestHandler { let retryAfter = res.headers.get('retry-after'); retryAfter = retryAfter ? Number(retryAfter) * 1_000 : -1; if (retryAfter > 0) { - // If the global ratelimit header is set, that means we hit the global rate limit + // If the global rate limit header is set, that means we hit the global rate limit if (res.headers.get('x-ratelimit-global')) { this.manager.globalRemaining = 0; this.manager.globalReset = Date.now() + retryAfter; diff --git a/src/sharding/ShardingManager.js b/src/sharding/ShardingManager.js index 85bfd628a..248bacaa9 100644 --- a/src/sharding/ShardingManager.js +++ b/src/sharding/ShardingManager.js @@ -166,7 +166,7 @@ class ShardingManager extends EventEmitter { } /** - * Option used to spawn multiple shards. + * Options used to spawn multiple shards. * @typedef {Object} MultipleShardSpawnOptions * @property {number|string} [amount=this.totalShards] Number of shards to spawn * @property {number} [delay=5500] How long to wait in between spawning each shard (in milliseconds) diff --git a/src/structures/BaseGuildTextChannel.js b/src/structures/BaseGuildTextChannel.js index c48ffd49f..abb407563 100644 --- a/src/structures/BaseGuildTextChannel.js +++ b/src/structures/BaseGuildTextChannel.js @@ -129,7 +129,7 @@ class BaseGuildTextChannel extends GuildChannel { } /** - * Options used to create a {@link Webhook} for {@link TextChannel} and {@link NewsChannel}. + * Options used to create a {@link Webhook} in a {@link TextChannel} or a {@link NewsChannel}. * @typedef {Object} ChannelWebhookCreateOptions * @property {?(BufferResolvable|Base64Resolvable)} [avatar] Avatar for the webhook * @property {string} [reason] Reason for creating the webhook diff --git a/src/structures/CategoryChannel.js b/src/structures/CategoryChannel.js index b6b198f1b..d23c6e4df 100644 --- a/src/structures/CategoryChannel.js +++ b/src/structures/CategoryChannel.js @@ -32,18 +32,18 @@ class CategoryChannel extends GuildChannel { * @typedef {Object} CategoryCreateChannelOptions * @property {ChannelType|number} [type='GUILD_TEXT'] The type of the new channel. * @property {string} [topic] The topic for the new channel - * @property {boolean} [nsfw] Whether the new channel is nsfw + * @property {boolean} [nsfw] Whether the new channel is NSFW * @property {number} [bitrate] Bitrate of the new channel in bits (only voice) * @property {number} [userLimit] Maximum amount of users allowed in the new channel (only voice) * @property {OverwriteResolvable[]|Collection} [permissionOverwrites] * Permission overwrites of the new channel * @property {number} [position] Position of the new channel - * @property {number} [rateLimitPerUser] The ratelimit per user for the new channel + * @property {number} [rateLimitPerUser] The rate limit per user (slowmode) for the new channel in seconds * @property {string} [reason] Reason for creating the new channel */ /** - * Creates a new channel on this category. + * Creates a new channel within this category. * You cannot create a channel of type `GUILD_CATEGORY` inside a CategoryChannel. * @param {string} name The name of the new channel * @param {CategoryCreateChannelOptions} options Options for creating the new channel diff --git a/src/structures/Emoji.js b/src/structures/Emoji.js index 5c94d2673..317cf5695 100644 --- a/src/structures/Emoji.js +++ b/src/structures/Emoji.js @@ -54,7 +54,7 @@ class Emoji extends Base { } /** - * The URL to the emoji file if its a custom emoji + * The URL to the emoji file if it's a custom emoji * @type {?string} * @readonly */ diff --git a/src/structures/Guild.js b/src/structures/Guild.js index b56ebf343..4bcbc52f8 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -646,8 +646,8 @@ class Guild extends AnonymousGuild { */ /** - * Fetches the vanity url invite object to this guild. - * Resolves with an object containing the vanity url invite code and the use count + * Fetches the vanity URL invite object to this guild. + * Resolves with an object containing the vanity URL invite code and the use count * @returns {Promise} * @example * // Fetch invite data diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index b12b4ee55..7ff6ce182 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -58,7 +58,7 @@ class GuildChannel extends Channel { if ('position' in data) { /** - * The raw position of the channel from discord + * The raw position of the channel from Discord * @type {number} */ this.rawPosition = data.position; @@ -246,8 +246,8 @@ class GuildChannel extends Channel { /** * A collection of cached members of this channel, mapped by their ids. - * Members that can view this channel, if the channel is text based. - * Members in the channel, if the channel is voice based. + * Members that can view this channel, if the channel is text-based. + * Members in the channel, if the channel is voice-based. * @type {Collection} * @readonly */ @@ -270,7 +270,7 @@ class GuildChannel extends Channel { * Lock the permissions of the channel to what the parent's permissions are * @property {OverwriteResolvable[]|Collection} [permissionOverwrites] * Permission overwrites for the channel - * @property {number} [rateLimitPerUser] The ratelimit per user for the channel in seconds + * @property {number} [rateLimitPerUser] The rate limit per user (slowmode) for the channel in seconds * @property {ThreadAutoArchiveDuration} [defaultAutoArchiveDuration] * The default auto archive duration for all new threads in this channel * @property {?string} [rtcRegion] The RTC region of the channel @@ -363,7 +363,7 @@ class GuildChannel extends Channel { } /** - * Options used to set parent of a channel. + * Options used to set the parent of a channel. * @typedef {Object} SetParentOptions * @property {boolean} [lockPermissions=true] Whether to lock the permissions to what the parent's permissions are * @property {string} [reason] The reason for modifying the parent of the channel @@ -391,7 +391,7 @@ class GuildChannel extends Channel { } /** - * Options used to set position of a channel. + * Options used to set the position of a channel. * @typedef {Object} SetChannelPositionOptions * @param {boolean} [relative=false] Whether or not to change the position relative to its current value * @param {string} [reason] The reason for changing the position diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index 2414f08ff..53d66a16d 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -29,7 +29,7 @@ class GuildMember extends Base { this.joinedTimestamp = null; /** - * The timestamp of when the member used their Nitro boost on the guild, if it was used + * The last timestamp this member started boosting the guild * @type {?number} */ this.premiumSinceTimestamp = null; @@ -146,7 +146,7 @@ class GuildMember extends Base { } /** - * The time of when the member used their Nitro boost on the guild, if it was used + * The last time this member started boosting the guild * @type {?Date} * @readonly */ diff --git a/src/structures/GuildTemplate.js b/src/structures/GuildTemplate.js index 42bd76750..c1040eb34 100644 --- a/src/structures/GuildTemplate.js +++ b/src/structures/GuildTemplate.js @@ -65,7 +65,7 @@ class GuildTemplate extends Base { if ('created_at' in data) { /** - * The time of when this template was created at + * The time when this template was created at * @type {Date} */ this.createdAt = new Date(data.created_at); @@ -73,7 +73,7 @@ class GuildTemplate extends Base { if ('updated_at' in data) { /** - * The time of when this template was last synced to the guild + * The time when this template was last synced to the guild * @type {Date} */ this.updatedAt = new Date(data.updated_at); @@ -105,7 +105,7 @@ class GuildTemplate extends Base { } /** - * Creates a guild based from this template. + * Creates a guild based on this template. * This is only available to bots in fewer than 10 guilds. * @param {string} name The name of the guild * @param {BufferResolvable|Base64Resolvable} [icon] The icon for the guild diff --git a/src/structures/IntegrationApplication.js b/src/structures/IntegrationApplication.js index 25e6a7d70..1a81df1f0 100644 --- a/src/structures/IntegrationApplication.js +++ b/src/structures/IntegrationApplication.js @@ -22,7 +22,7 @@ class IntegrationApplication extends Application { if ('terms_of_service_url' in data) { /** - * The url of the application's terms of service + * The URL of the application's terms of service * @type {?string} */ this.termsOfServiceURL = data.terms_of_service_url; @@ -32,7 +32,7 @@ class IntegrationApplication extends Application { if ('privacy_policy_url' in data) { /** - * The url of the application's privacy policy + * The URL of the application's privacy policy * @type {?string} */ this.privacyPolicyURL = data.privacy_policy_url; @@ -42,7 +42,7 @@ class IntegrationApplication extends Application { if ('rpc_origins' in data) { /** - * The Array of RPC origin urls + * The Array of RPC origin URLs * @type {string[]} */ this.rpcOrigins = data.rpc_origins; diff --git a/src/structures/InteractionCollector.js b/src/structures/InteractionCollector.js index 4a87ccf3b..837876db5 100644 --- a/src/structures/InteractionCollector.js +++ b/src/structures/InteractionCollector.js @@ -75,7 +75,7 @@ class InteractionCollector extends Collector { : options.componentType ?? null; /** - * The users which have interacted to this collector + * The users that have interacted with this collector * @type {Collection} */ this.users = new Collection(); diff --git a/src/structures/Message.js b/src/structures/Message.js index 144ac9ef2..e3a6ee464 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -424,7 +424,7 @@ class Message extends Base { } /** - * The url to jump to this message + * The URL to jump to this message * @type {string} * @readonly */ diff --git a/src/structures/MessageEmbed.js b/src/structures/MessageEmbed.js index 557709f0a..f2fc9785f 100644 --- a/src/structures/MessageEmbed.js +++ b/src/structures/MessageEmbed.js @@ -452,7 +452,7 @@ class MessageEmbed { /** * Normalizes field input and resolves strings. - * @param {...EmbedFieldData|EmbedFieldData[]} fields Fields to normalize + * @param {...EmbedFieldData|EmbedFieldData[]} fields Fields to normalize * @returns {EmbedField[]} */ static normalizeFields(...fields) { diff --git a/src/structures/MessagePayload.js b/src/structures/MessagePayload.js index 1512970ed..db43b8a88 100644 --- a/src/structures/MessagePayload.js +++ b/src/structures/MessagePayload.js @@ -12,8 +12,8 @@ const Util = require('../util/Util'); */ class MessagePayload { /** - * @param {MessageTarget} target - The target for this message to be sent to - * @param {MessageOptions|WebhookMessageOptions} options - Options passed in from send + * @param {MessageTarget} target The target for this message to be sent to + * @param {MessageOptions|WebhookMessageOptions} options Options passed in from send */ constructor(target, options) { /** @@ -245,7 +245,7 @@ class MessagePayload { * Creates a {@link MessagePayload} from user-level arguments. * @param {MessageTarget} target Target to send to * @param {string|MessageOptions|WebhookMessageOptions} options Options or content to use - * @param {MessageOptions|WebhookMessageOptions} [extra={}] - Extra options to add onto specified options + * @param {MessageOptions|WebhookMessageOptions} [extra={}] Extra options to add onto specified options * @returns {MessagePayload} */ static create(target, options, extra = {}) { diff --git a/src/structures/Presence.js b/src/structures/Presence.js index 032e40072..ee1f2fc7e 100644 --- a/src/structures/Presence.js +++ b/src/structures/Presence.js @@ -347,7 +347,7 @@ class RichPresenceAssets { /** * Gets the URL of the small image asset - * @param {StaticImageURLOptions} [options] Options for the image url + * @param {StaticImageURLOptions} [options] Options for the image URL * @returns {?string} */ smallImageURL({ format, size } = {}) { @@ -362,7 +362,7 @@ class RichPresenceAssets { /** * Gets the URL of the large image asset - * @param {StaticImageURLOptions} [options] Options for the image url + * @param {StaticImageURLOptions} [options] Options for the image URL * @returns {?string} */ largeImageURL({ format, size } = {}) { diff --git a/src/structures/ReactionCollector.js b/src/structures/ReactionCollector.js index e7701ce66..f581cea75 100644 --- a/src/structures/ReactionCollector.js +++ b/src/structures/ReactionCollector.js @@ -32,7 +32,7 @@ class ReactionCollector extends Collector { this.message = message; /** - * The users which have reacted to this message + * The users that have reacted to this message * @type {Collection} */ this.users = new Collection(); diff --git a/src/structures/Role.js b/src/structures/Role.js index e701b5be1..5e5ae88db 100644 --- a/src/structures/Role.js +++ b/src/structures/Role.js @@ -348,7 +348,7 @@ class Role extends Base { } /** - * Options used to set position of a role. + * Options used to set the position of a role. * @typedef {Object} SetRolePositionOptions * @property {boolean} [relative=false] Whether to change the position relative to its current value or not * @property {string} [reason] The reason for changing the position diff --git a/src/structures/StageChannel.js b/src/structures/StageChannel.js index bce5e76c7..f5fb4d88d 100644 --- a/src/structures/StageChannel.js +++ b/src/structures/StageChannel.js @@ -29,7 +29,7 @@ class StageChannel extends BaseGuildVoiceChannel { } /** - * Creates a stage instance associated to this stage channel. + * Creates a stage instance associated with this stage channel. * @param {StageInstanceCreateOptions} options The options to create the stage instance * @returns {Promise} */ diff --git a/src/structures/Sticker.js b/src/structures/Sticker.js index 7db1f9874..b699721be 100644 --- a/src/structures/Sticker.js +++ b/src/structures/Sticker.js @@ -157,7 +157,7 @@ class Sticker extends Base { /** * A link to the sticker - * If the sticker's format is LOTTIE, it returns the URL of the Lottie json file. + * If the sticker's format is LOTTIE, it returns the URL of the Lottie JSON file. * @type {string} */ get url() { diff --git a/src/structures/TextChannel.js b/src/structures/TextChannel.js index 2a342fff1..97040a2ab 100644 --- a/src/structures/TextChannel.js +++ b/src/structures/TextChannel.js @@ -12,7 +12,7 @@ class TextChannel extends BaseGuildTextChannel { if ('rate_limit_per_user' in data) { /** - * The ratelimit per user for this channel in seconds + * The rate limit per user (slowmode) for this channel in seconds * @type {number} */ this.rateLimitPerUser = data.rate_limit_per_user; @@ -20,9 +20,9 @@ class TextChannel extends BaseGuildTextChannel { } /** - * Sets the rate limit per user for this channel. - * @param {number} rateLimitPerUser The new ratelimit in seconds - * @param {string} [reason] Reason for changing the channel's ratelimits + * Sets the rate limit per user (slowmode) for this channel. + * @param {number} rateLimitPerUser The new rate limit in seconds + * @param {string} [reason] Reason for changing the channel's rate limit * @returns {Promise} */ setRateLimitPerUser(rateLimitPerUser, reason) { diff --git a/src/structures/ThreadChannel.js b/src/structures/ThreadChannel.js index f8fe7d86f..dc8be9a29 100644 --- a/src/structures/ThreadChannel.js +++ b/src/structures/ThreadChannel.js @@ -140,7 +140,7 @@ class ThreadChannel extends Channel { if ('rate_limit_per_user' in data || !partial) { /** - * The ratelimit per user for this thread (in seconds) + * The rate limit per user (slowmode) for this thread in seconds * @type {?number} */ this.rateLimitPerUser = data.rate_limit_per_user ?? 0; @@ -268,7 +268,7 @@ class ThreadChannel extends Channel { * @property {boolean} [archived] Whether the thread is archived * @property {ThreadAutoArchiveDuration} [autoArchiveDuration] The amount of time (in minutes) after which the thread * should automatically archive in case of no recent activity - * @property {number} [rateLimitPerUser] The ratelimit per user for the thread in seconds + * @property {number} [rateLimitPerUser] The rate limit per user (slowmode) for the thread in seconds * @property {boolean} [locked] Whether the thread is locked * @property {boolean} [invitable] Whether non-moderators can add other non-moderators to a thread * Can only be edited on `GUILD_PRIVATE_THREAD` @@ -387,9 +387,9 @@ class ThreadChannel extends Channel { } /** - * Sets the rate limit per user for this thread. - * @param {number} rateLimitPerUser The new ratelimit in seconds - * @param {string} [reason] Reason for changing the thread's ratelimits + * Sets the rate limit per user (slowmode) for this thread. + * @param {number} rateLimitPerUser The new rate limit in seconds + * @param {string} [reason] Reason for changing the thread's rate limit * @returns {Promise} */ setRateLimitPerUser(rateLimitPerUser, reason) { diff --git a/src/structures/Webhook.js b/src/structures/Webhook.js index a3854492a..0bffaa110 100644 --- a/src/structures/Webhook.js +++ b/src/structures/Webhook.js @@ -377,7 +377,7 @@ class Webhook { } /** - * The url of this webhook + * The URL of this webhook * @type {string} * @readonly */ diff --git a/src/structures/Widget.js b/src/structures/Widget.js index fc7f89220..7373d0a4d 100644 --- a/src/structures/Widget.js +++ b/src/structures/Widget.js @@ -65,7 +65,7 @@ class Widget extends Base { if ('presence_count' in data) { /** - * The number of the members online. + * The number of members online. * @type {number} */ this.presenceCount = data.presence_count; diff --git a/src/structures/interfaces/Collector.js b/src/structures/interfaces/Collector.js index d5126a264..40c851367 100644 --- a/src/structures/interfaces/Collector.js +++ b/src/structures/interfaces/Collector.js @@ -198,7 +198,7 @@ class Collector extends EventEmitter { } /** - * Options used to reset timeout and idle timer of a {@link Collector}. + * Options used to reset the timeout and idle timer of a {@link Collector}. * @typedef {Object} CollectorResetTimerOptions * @property {number} [time] How long to run the collector for (in milliseconds) * @property {number} [idle] How long to wait to stop the collector after inactivity (in milliseconds) diff --git a/src/util/BitField.js b/src/util/BitField.js index 75ae7eff4..c34f36246 100644 --- a/src/util/BitField.js +++ b/src/util/BitField.js @@ -137,7 +137,7 @@ class BitField { /** * Resolves bitfields to their numeric form. - * @param {BitFieldResolvable} [bit] - bit(s) to resolve + * @param {BitFieldResolvable} [bit] bit(s) to resolve * @returns {number|bigint} */ static resolve(bit) { diff --git a/src/util/Constants.js b/src/util/Constants.js index d9ae7e626..1cda229fb 100644 --- a/src/util/Constants.js +++ b/src/util/Constants.js @@ -216,7 +216,7 @@ exports.ShardEvents = { exports.PartialTypes = keyMirror(['USER', 'CHANNEL', 'GUILD_MEMBER', 'MESSAGE', 'REACTION']); /** - * The type of a websocket message event, e.g. `MESSAGE_CREATE`. Here are the available events: + * The type of a WebSocket message event, e.g. `MESSAGE_CREATE`. Here are the available events: * * READY * * RESUMED * * APPLICATION_COMMAND_CREATE @@ -1103,5 +1103,5 @@ function createEnum(keys) { * @property {StickerType} StickerTypes The value set for a sticker's type. * @property {VerificationLevel} VerificationLevels The value set for the verification levels for a guild. * @property {WebhookType} WebhookTypes The value set for a webhook's type. - * @property {WSEventType} WSEvents The type of a websocket message event. + * @property {WSEventType} WSEvents The type of a WebSocket message event. */ diff --git a/src/util/Formatters.js b/src/util/Formatters.js index b611bfaa5..94c14b15f 100644 --- a/src/util/Formatters.js +++ b/src/util/Formatters.js @@ -54,7 +54,7 @@ Formatters.bold = bold; Formatters.channelMention = channelMention; /** - * Wraps the content inside a codeblock with an optional language. + * Wraps the content inside a code block with an optional language. * @method codeBlock * @memberof Formatters * @param {string} contentOrLanguage The language to use, content if a second parameter isn't provided. diff --git a/src/util/Intents.js b/src/util/Intents.js index a47ca7555..a96628c55 100644 --- a/src/util/Intents.js +++ b/src/util/Intents.js @@ -24,7 +24,7 @@ class Intents extends BitField {} */ /** - * Numeric websocket intents. All available properties: + * Numeric WebSocket intents. All available properties: * * `GUILDS` * * `GUILD_MEMBERS` * * `GUILD_BANS` diff --git a/src/util/Options.js b/src/util/Options.js index 206bc59f5..b31397977 100644 --- a/src/util/Options.js +++ b/src/util/Options.js @@ -5,7 +5,7 @@ * @typedef {Object} RateLimitData * @property {number} timeout Time until this rate limit ends, in ms * @property {number} limit The maximum amount of requests of this endpoint - * @property {string} method The http method of this request + * @property {string} method The HTTP method of this request * @property {string} path The path of the request relative to the HTTP endpoint * @property {string} route The route of the request relative to the HTTP endpoint * @property {boolean} global Whether this is a global rate limit @@ -51,7 +51,7 @@ * [guide](https://discordjs.guide/popular-topics/partials.html) for some * important usage information, as partials require you to put checks in place when handling data. * @property {number} [restWsBridgeTimeout=5000] Maximum time permitted between REST responses and their - * corresponding websocket events + * corresponding WebSocket events * @property {number} [restTimeOffset=500] Extra time in milliseconds to wait before continuing to make REST * requests (higher values will reduce rate-limiting errors on bad connections) * @property {number} [restRequestTimeout=15000] Time to wait before cancelling a REST request, in milliseconds @@ -63,7 +63,8 @@ * should be handled. If this option is an array containing the prefix of the request route (e.g. /channels to match any * route starting with /channels, such as /channels/222197033908436994/messages) or a function returning true, a * {@link RateLimitError} will be thrown. Otherwise the request will be queued for later - * @property {number} [retryLimit=1] How many times to retry on 5XX errors (Infinity for indefinite amount of retries) + * @property {number} [retryLimit=1] How many times to retry on 5XX errors + * (Infinity for an indefinite amount of retries) * @property {boolean} [failIfNotExists=true] Default value for {@link ReplyMessageOptions#failIfNotExists} * @property {string[]} [userAgentSuffix] An array of additional bot info to be appended to the end of the required * [User Agent](https://discord.com/developers/docs/reference#user-agent) header @@ -92,10 +93,10 @@ * @typedef {Object} HTTPOptions * @property {number} [version=9] API version to use * @property {AgentOptions} [agent={}] HTTPS Agent options - * @property {string} [api='https://discord.com/api'] Base url of the API - * @property {string} [cdn='https://cdn.discordapp.com'] Base url of the CDN - * @property {string} [invite='https://discord.gg'] Base url of invites - * @property {string} [template='https://discord.new'] Base url of templates + * @property {string} [api='https://discord.com/api'] Base URL of the API + * @property {string} [cdn='https://cdn.discordapp.com'] Base URL of the CDN + * @property {string} [invite='https://discord.gg'] Base URL of invites + * @property {string} [template='https://discord.new'] Base URL of templates * @property {Object} [headers] Additional headers to send for all API requests */ diff --git a/src/util/SystemChannelFlags.js b/src/util/SystemChannelFlags.js index 2979ac024..d790bef82 100644 --- a/src/util/SystemChannelFlags.js +++ b/src/util/SystemChannelFlags.js @@ -24,9 +24,9 @@ class SystemChannelFlags extends BitField {} */ /** - * Data that can be resolved to give a sytem channel flag bitfield. This can be: + * Data that can be resolved to give a system channel flag bitfield. This can be: * * A string (see {@link SystemChannelFlags.FLAGS}) - * * A sytem channel flag + * * A system channel flag * * An instance of SystemChannelFlags * * An Array of SystemChannelFlagsResolvable * @typedef {string|number|SystemChannelFlags|SystemChannelFlagsResolvable[]} SystemChannelFlagsResolvable diff --git a/src/util/Util.js b/src/util/Util.js index 072e4217d..79884ecbe 100644 --- a/src/util/Util.js +++ b/src/util/Util.js @@ -57,7 +57,7 @@ class Util extends null { * Options for splitting a message. * @typedef {Object} SplitOptions * @property {number} [maxLength=2000] Maximum character length per message piece - * @property {string|string[]|RegExp|RegExp[]} [char='\n'] Character(s) or Regex(s) to split the message with, + * @property {string|string[]|RegExp|RegExp[]} [char='\n'] Character(s) or Regex(es) to split the message with, * an array can be used to split multiple times * @property {string} [prepend=''] Text to prepend to every piece except the first * @property {string} [append=''] Text to append to every piece except the last @@ -477,7 +477,7 @@ class Util extends null { /** * Sorts by Discord's position and id. - * @param {Collection} collection Collection of objects to sort + * @param {Collection} collection Collection of objects to sort * @returns {Collection} */ static discordSort(collection) { @@ -522,7 +522,7 @@ class Util extends null { /** * Transforms a snowflake from a decimal string to a bit string. - * @param {Snowflake} num Snowflake to be transformed + * @param {Snowflake} num Snowflake to be transformed * @returns {string} * @private */ @@ -543,7 +543,7 @@ class Util extends null { /** * Transforms a snowflake from a bit string to a decimal string. - * @param {string} num Bit string to be transformed + * @param {string} num Bit string to be transformed * @returns {Snowflake} * @private */ @@ -616,7 +616,7 @@ class Util extends null { } /** - * The content to put in a codeblock with all codeblock fences replaced by the equivalent backticks. + * The content to put in a code block with all code block fences replaced by the equivalent backticks. * @param {string} text The string to be converted * @returns {string} */