Skip to content

Commit

Permalink
update jsdoc comments for typings
Browse files Browse the repository at this point in the history
  • Loading branch information
Starman3787 committed Dec 22, 2024
1 parent 2cd1996 commit 77cb8d9
Show file tree
Hide file tree
Showing 30 changed files with 145 additions and 121 deletions.
2 changes: 1 addition & 1 deletion src/managers/BaseCacheManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ class BaseCacheManager {

/**
* Returns the JSON representation of this structure.
* @param {Number} format The format to return the data in.
* @param {Number} [format] The format to return the data in.
* @returns {Object}
* @public
* @method
Expand Down
2 changes: 1 addition & 1 deletion src/managers/ChannelCacheOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class ChannelCacheOptions {

/**
* Returns the JSON representation of this structure.
* @param {Number} format The format to return the data in.
* @param {Number} [format] The format to return the data in.
* @returns {Object}
* @public
* @method
Expand Down
2 changes: 1 addition & 1 deletion src/managers/GuildCacheOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ class GuildCacheOptions {

/**
* Returns the JSON representation of this structure.
* @param {Number} format The format to return the data in.
* @param {Number} [format] The format to return the data in.
* @returns {Object}
* @public
* @method
Expand Down
2 changes: 1 addition & 1 deletion src/managers/MessagePollManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class MessagePollManager {

/**
* Returns the JSON representation of this structure.
* @param {Number} format The format to return the data in.
* @param {Number} [format] The format to return the data in.
* @returns {Object}
* @public
* @method
Expand Down
2 changes: 1 addition & 1 deletion src/managers/MessageReactionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class MessageReactionManager {

/**
* Returns the JSON representation of this structure.
* @param {Number} format The format to return the data in.
* @param {Number} [format] The format to return the data in.
* @returns {Object}
* @public
* @method
Expand Down
2 changes: 1 addition & 1 deletion src/structures/Attachment.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class Attachment {

/**
* Returns the JSON representation of this structure.
* @param {Number} format The format to return the data in.
* @param {Number} [format] The format to return the data in.
* @returns {Object}
* @public
* @method
Expand Down
2 changes: 1 addition & 1 deletion src/structures/AuditLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ class AuditLog {

/**
* Returns the JSON representation of this structure.
* @param {Number} format The format to return the data in.
* @param {Number} [format] The format to return the data in.
* @returns {Object}
* @public
* @method
Expand Down
2 changes: 1 addition & 1 deletion src/structures/ButtonClick.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class ButtonClick extends Interaction {

/**
* Returns the JSON representation of this structure.
* @param {Number} format The format to return the data in.
* @param {Number} [format] The format to return the data in.
* @returns {Object}
* @public
* @method
Expand Down
2 changes: 1 addition & 1 deletion src/structures/CategoryChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class CategoryChannel {

/**
* Returns the JSON representation of this structure.
* @param {Number} format The format to return the data in.
* @param {Number} [format] The format to return the data in.
* @returns {Object}
* @public
* @method
Expand Down
14 changes: 7 additions & 7 deletions src/structures/Channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ class Channel {

/**
* Sends a message to this channel.
* @param {Object} data Embeds, components and files to include with the message.
* @param {String?} data.content The content of the message.
* @param {Array<Embed>?} data.embeds The embeds to include with the message.
* @param {Array<MessageComponents>?} data.components The components to include with the message.
* @param {Array<FileUpload>?} data.files The files to include with the message.
* @param {Boolean} data.suppressMentions Whether to suppress mentions in the message.
* @param {Object} [data] Embeds, components and files to include with the message.
* @param {String?} [data.content] The content of the message.
* @param {Array<Embed>?} [data.embeds] The embeds to include with the message.
* @param {Array<MessageComponents>?} [data.components] The components to include with the message.
* @param {Array<FileUpload>?} [data.files] The files to include with the message.
* @param {Boolean} [data.suppressMentions] Whether to suppress mentions in the message.
* @returns {Promise<Message>}
* @see {@link https://discord.com/developers/docs/resources/channel#create-message}
* @method
Expand Down Expand Up @@ -496,7 +496,7 @@ class Channel {

/**
* Returns the JSON representation of this structure.
* @param {Number} format The format to return the data in.
* @param {Number} [format] The format to return the data in.
* @returns {Object}
* @public
* @method
Expand Down
4 changes: 2 additions & 2 deletions src/structures/Emoji.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class Emoji {
/**
* Returns the url for an emoji.
* @param {String} id The id of the emoji.
* @param {Boolean} animated Whether the emoji is animated.
* @param {Boolean} [animated] Whether the emoji is animated.
* @returns {String}
* @public
* @static
Expand Down Expand Up @@ -292,7 +292,7 @@ class Emoji {

/**
* Returns the JSON representation of this structure.
* @param {Number} format The format to return the data in.
* @param {Number} [format] The format to return the data in.
* @returns {Object}
* @public
* @method
Expand Down
34 changes: 25 additions & 9 deletions src/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import GluonCacheOptions from "../managers/GluonCacheOptions.js";
import util from "util";
import Client from "../Client.js";
import Message from "./Message.js";
import { Embed } from "../util.js";

/**
* Represents a Discord guild.
Expand Down Expand Up @@ -1078,7 +1079,9 @@ class Guild {
/**
* Bans a user with the given id from the guild.
* @param {String} user_id The id of the user to ban.
* @param {Object?} options Ban options.
* @param {Object?} [options] Ban options.
* @param {String?} [options.reason] The reason for banning the user.
* @param {Number?} [options.seconds] The number of seconds to delete messages for.
* @returns {Promise<void?>}
* @async
* @public
Expand Down Expand Up @@ -1122,7 +1125,8 @@ class Guild {
/**
* Unbans a user with the given id from the guild.
* @param {String} user_id The id of the user to unban.
* @param {Object?} options Unban options.
* @param {Object?} [options] Unban options.
* @param {String?} [options.reason] The reason for unbanning the user.
* @returns {Promise<void?>}
* @async
* @public
Expand Down Expand Up @@ -1158,7 +1162,8 @@ class Guild {
/**
* Kicks a user with the given id from the guild.
* @param {String} user_id The id of the user to kick.
* @param {Object?} options Kick options.
* @param {Object?} [options] Kick options.
* @param {String?} [options.reason] The reason for kicking the user.
* @returns {Promise<void?>}
* @async
* @public
Expand Down Expand Up @@ -1195,7 +1200,8 @@ class Guild {
* Removes the given role from the given member.
* @param {String} user_id The id of the user.
* @param {String} role_id The id of the role.
* @param {Object?} options Remove role options.
* @param {Object?} [options] Remove role options.
* @param {String?} [options.reason] The reason for removing the role.
* @returns {Promise<void?>}
* @async
* @public
Expand Down Expand Up @@ -1233,7 +1239,12 @@ class Guild {

/**
* Fetches audit logs.
* @param {Object?} options Audit log fetch options.
* @param {Object?} [options] Audit log fetch options.
* @param {Number?} [options.limit] The number of entries to fetch.
* @param {Number?} [options.type] The type of audit log to fetch.
* @param {String?} [options.user_id] The id of the user to fetch the audit log for.
* @param {String?} [options.before] The id of the audit log entry to fetch before.
* @param {String?} [options.after] The id of the audit log entry to fetch after
* @returns {Promise<AuditLog[]?>}
* @async
* @public
Expand Down Expand Up @@ -1433,8 +1444,8 @@ class Guild {
* Creates a webhook in the given channel with the name "Gluon".
* @param {Client} client The client instance.
* @param {String} channelId The id of the channel to create the webhook in.
* @param {Object} options The options for creating the webhook.
* @param {String} options.name The name of the webhook.
* @param {Object} [options] The options for creating the webhook.
* @param {String} [options.name] The name of the webhook.
* @returns {Promise<Object>}
* @public
* @method
Expand Down Expand Up @@ -1508,8 +1519,13 @@ class Guild {
* Posts a webhook with the provided webhook id and token.
* @param {Client} client The client instance.
* @param {Object} referenceData An object with the webhook id and token.
* @param {String} referenceData.id The id of the webhook.
* @param {String} referenceData.token The token of the webhook.
* @param {String?} content The message to send with the webhook.
* @param {Object?} options Embeds, components and files to attach to the webhook.
* @param {Object?} [options] Embeds, components and files to attach to the webhook.
* @param {Embed[]} [options.embeds] The embeds to attach to the webhook.
* @param {MessageComponent[]} [options.components] The components to attach to the webhook.
* @param {File[]} [options.files] The files to attach to the webhook.
* @returns {Promise<void>}
* @public
* @method
Expand Down Expand Up @@ -1613,7 +1629,7 @@ class Guild {

/**
* Returns the JSON representation of this structure.
* @param {Number} format The format to return the data in.
* @param {Number} [format] The format to return the data in.
* @returns {Object}
* @public
* @method
Expand Down
39 changes: 22 additions & 17 deletions src/structures/Interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { TO_JSON_TYPES_ENUM } from "../constants.js";
import util from "util";
import Message from "./Message.js";
import Client from "../Client.js";
import { CommandChoice } from "../util.js";

/**
* Represents an interaction received over the gateway.
Expand Down Expand Up @@ -167,6 +168,9 @@ class Interaction {
/**
* Prompts a user to enter text using a modal.
* @param {Object} options Modal options.
* @param {String} options.title The title of the modal.
* @param {String} options.customId The custom id of the modal.
* @param {TextInput} options.textInputModal The text input modal.
* @returns {Promise<void>}
* @public
* @async
Expand Down Expand Up @@ -207,6 +211,7 @@ class Interaction {
/**
* Responds to autocomplete interactions.
* @param {Object} options Autocompletion options.
* @param {Array<CommandChoice>} options.choices The choices to send back.
* @returns {Promise<Interaction>}
* @public
* @async
Expand All @@ -233,12 +238,12 @@ class Interaction {

/**
* Replies to an interaction.
* @param {Object?} options An embed, components, and whether the response should be as an ephemeral message.
* @param {String?} options.content The content of the interaction response.
* @param {Array<FileUpload>?} options.files The files to send with the interaction response.
* @param {Array<Embed>?} options.embeds The embeds to send with the interaction response.
* @param {Array<ActionRow>?} options.components The components to send with the interaction response.
* @param {Boolean?} options.quiet Whether the response should be an ephemeral message.
* @param {Object?} [options] An embed, components, and whether the response should be as an ephemeral message.
* @param {String?} [options.content] The content of the interaction response.
* @param {Array<FileUpload>?} [options.files] The files to send with the interaction response.
* @param {Array<Embed>?} [options.embeds] The embeds to send with the interaction response.
* @param {Array<ActionRow>?} [options.components] The components to send with the interaction response.
* @param {Boolean?} [options.quiet] Whether the response should be an ephemeral message.
* @returns {Promise<Interaction>}
* @public
* @async
Expand Down Expand Up @@ -300,11 +305,11 @@ class Interaction {

/**
* Edits a response to an interaction. Works up to 15 minutes after the response was sent.
* @param {Object?} options The new interaction response options.
* @param {String?} options.content The new content of the interaction response.
* @param {Array<FileUpload>?} options.files The new files to send with the interaction response.
* @param {Array<Embed>?} options.embeds The new embeds to send with the interaction response.
* @param {Array<ActionRow>?} options.components The new components to send with the interaction response.
* @param {Object?} [options] The new interaction response options.
* @param {String?} [options.content] The new content of the interaction response.
* @param {Array<FileUpload>?} [options.files] The new files to send with the interaction response.
* @param {Array<Embed>?} [options.embeds] The new embeds to send with the interaction response.
* @param {Array<ActionRow>?} [options.components] The new components to send with the interaction response.
* @returns {Promise<Interaction>}
* @public
* @async
Expand All @@ -324,11 +329,11 @@ class Interaction {
* Edits a response to an interaction. Works up to 15 minutes after the response was sent.
* @param {Client} client The client instance.
* @param {String} interactionToken The interaction token.
* @param {Object?} options The new interaction response options.
* @param {String?} options.content The new content of the interaction response.
* @param {Array<FileUpload>?} options.files The new files to send with the interaction response.
* @param {Array<Embed>?} options.embeds The new embeds to send with the interaction response.
* @param {Array<ActionRow>?} options.components The new components to send with the interaction response.
* @param {Object?} [options] The new interaction response options.
* @param {String?} [options.content] The new content of the interaction response.
* @param {Array<FileUpload>?} [options.files] The new files to send with the interaction response.
* @param {Array<Embed>?} [options.embeds] The new embeds to send with the interaction response.
* @param {Array<ActionRow>?} [options.components] The new components to send with the interaction response.
* @returns {Promise<Interaction>}
* @public
* @async
Expand Down Expand Up @@ -380,7 +385,7 @@ class Interaction {

/**
* Returns the JSON representation of this structure.
* @param {Number} format The format to return the data in.
* @param {Number} [format] The format to return the data in.
* @returns {Object}
* @public
* @method
Expand Down
2 changes: 1 addition & 1 deletion src/structures/Invite.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class Invite {

/**
* Returns the JSON representation of this structure.
* @param {Number} format The format to return the data in.
* @param {Number} [format] The format to return the data in.
* @returns {Object}
* @public
* @method
Expand Down
Loading

0 comments on commit 77cb8d9

Please sign in to comment.