Skip to content

Commit

Permalink
docs: Typos, consistency and grammar fixes (#6811)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite authored Oct 13, 2021
1 parent 046f44b commit c44ea50
Show file tree
Hide file tree
Showing 42 changed files with 81 additions and 80 deletions.
2 changes: 1 addition & 1 deletion src/client/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>} Token of the account used
* @example
Expand Down
2 changes: 1 addition & 1 deletion src/client/WebhookClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/client/websocket/WebSocketShard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/errors/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}.`,
Expand Down Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions src/managers/ApplicationCommandManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/managers/ApplicationCommandPermissionsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
* <warn>The `command` parameter is not optional when the managers `commandId` is `null`</warn>
* @typedef {BaseApplicationCommandPermissionsOptions} HasApplicationCommandPermissionsOptions
* @param {UserResolvable|RoleResolvable} permissionId The user or role to check if a permission exists for
Expand Down
2 changes: 1 addition & 1 deletion src/managers/GuildEmojiManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class GuildEmojiManager extends BaseGuildEmojiManager {
* @param {GuildEmojiCreateOptions} [options] Options for creating the emoji
* @returns {Promise<Emoji>} 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);
Expand Down
2 changes: 1 addition & 1 deletion src/managers/GuildManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/managers/GuildMemberManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion src/managers/GuildStickerManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class GuildStickerManager extends CachedManager {
* @param {GuildStickerCreateOptions} [options] Options
* @returns {Promise<Sticker>} 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);
Expand Down
2 changes: 1 addition & 1 deletion src/rest/RateLimitError.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/rest/RequestHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/sharding/ShardingManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/structures/BaseGuildTextChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/structures/CategoryChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<Snowflake, OverwriteResolvable>} [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.
* <info>You cannot create a channel of type `GUILD_CATEGORY` inside a CategoryChannel.</info>
* @param {string} name The name of the new channel
* @param {CategoryCreateChannelOptions} options Options for creating the new channel
Expand Down
2 changes: 1 addition & 1 deletion src/structures/Emoji.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
4 changes: 2 additions & 2 deletions src/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vanity>}
* @example
* // Fetch invite data
Expand Down
12 changes: 6 additions & 6 deletions src/structures/GuildChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Snowflake, GuildMember>}
* @readonly
*/
Expand All @@ -270,7 +270,7 @@ class GuildChannel extends Channel {
* Lock the permissions of the channel to what the parent's permissions are
* @property {OverwriteResolvable[]|Collection<Snowflake, OverwriteResolvable>} [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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/structures/GuildMember.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
*/
Expand Down
6 changes: 3 additions & 3 deletions src/structures/GuildTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ 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);
}

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);
Expand Down Expand Up @@ -105,7 +105,7 @@ class GuildTemplate extends Base {
}

/**
* Creates a guild based from this template.
* Creates a guild based on this template.
* <warn>This is only available to bots in fewer than 10 guilds.</warn>
* @param {string} name The name of the guild
* @param {BufferResolvable|Base64Resolvable} [icon] The icon for the guild
Expand Down
6 changes: 3 additions & 3 deletions src/structures/IntegrationApplication.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/structures/InteractionCollector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<Snowflake, User>}
*/
this.users = new Collection();
Expand Down
2 changes: 1 addition & 1 deletion src/structures/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/structures/MessageEmbed.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions src/structures/MessagePayload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
/**
Expand Down Expand Up @@ -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 = {}) {
Expand Down
4 changes: 2 additions & 2 deletions src/structures/Presence.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 } = {}) {
Expand All @@ -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 } = {}) {
Expand Down
2 changes: 1 addition & 1 deletion src/structures/ReactionCollector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/structures/Role.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit c44ea50

Please sign in to comment.