### Fetch Integrations Example Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Guild Fetches a collection of integrations associated with the guild. It resolves with a Collection mapping integrations by their IDs. ```javascript guild.fetchIntegrations() .then(integrations => console.log(`Fetched ${integrations.size} integrations`)) .catch(console.error); ``` -------------------------------- ### Fetch Webhooks Example Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Guild Fetches all webhooks configured for the guild. It resolves with a Collection mapping webhooks by their Snowflake IDs. ```javascript guild.fetchWebhooks() .then(webhooks => console.log(`Fetched ${webhooks.size} webhooks`)) .catch(console.error); ``` -------------------------------- ### Example: Fetching Total Guilds Across Shards Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/ShardingManager An example demonstrating how to use `fetchClientValues` to get the total number of guilds across all shards. It fetches the 'guilds.cache.size' property from each shard and sums the results. ```javascript manager.fetchClientValues('guilds.cache.size') .then(results => console.log(`${results.reduce((prev, val) => prev + val, 0)} total guilds`)) .catch(console.error); ``` -------------------------------- ### StartThreadOptions Object Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/typedef/StartThreadOptions Configuration options for starting a new thread on a message. ```APIDOC ## StartThreadOptions Object Options for starting a thread on a message. ### Type Object ### Properties #### name - **name** (string) - Optional - The name of the new thread. #### autoArchiveDuration - **autoArchiveDuration** (ThreadAutoArchiveDuration) - Optional - The amount of time (in minutes) after which the thread should automatically archive in case of no recent activity. Defaults to `this.channel.defaultAutoArchiveDuration`. #### reason - **reason** (string) - Optional - Reason for creating the thread. #### rateLimitPerUser - **rateLimitPerUser** (number) - Optional - The rate limit per user (slowmode) for the thread in seconds. ``` -------------------------------- ### Fetch Guild Widget Example Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Guild Fetches the guild widget data. This requires the widget to be enabled on the guild. It resolves with a Widget object. ```javascript guild.fetchWidget() .then(widget => console.log(`The widget shows ${widget.channels.size} channels`)) .catch(console.error); ``` -------------------------------- ### Basic Discord Selfbot Login Example Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/general/welcome A simple Node.js example demonstrating how to log in a Discord selfbot using discord.js-selfbot-v13. It logs a message when the client is ready. ```javascript const { Client } = require('discord.js-selfbot-v13'); const client = new Client(); client.on('ready', async () => { console.log(`${client.user.username} is ready!`); }) client.login('token'); ``` -------------------------------- ### Fetch Vanity Data Example Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Guild Fetches the vanity URL invite data for the guild. It resolves with an object containing the vanity URL code and its use count. ```javascript guild.fetchVanityData() .then(res => { console.log(`Vanity URL: https://discord.gg/${res.code} with ${res.uses} uses`); }) .catch(console.error); ``` -------------------------------- ### Edit Guild Welcome Screen Example Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Guild Updates the guild's welcome screen with a new description, enabled status, and welcome channels. This method takes a WelcomeScreenEditData object and returns a Promise resolving with the updated WelcomeScreen. ```javascript guild.editWelcomeScreen({ description: 'Hello World', enabled: true, welcomeChannels: [ { description: 'foobar', channel: '222197033908436994', } ], }) ``` -------------------------------- ### Initialize DiscordAuthWebsocket Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/DiscordAuthWebsocket Instantiates a new DiscordAuthWebsocket object. This is the starting point for establishing a WebSocket connection for Discord authentication. ```javascript new Discord.DiscordAuthWebsocket(); ``` -------------------------------- ### Fetch Audit Logs Example Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Guild Fetches audit logs for the guild. This method can take options for filtering and returns a Promise that resolves with GuildAuditLogs. ```javascript guild.fetchAuditLogs() .then(audit => console.log(audit.entries.first())) .catch(console.error); ``` -------------------------------- ### GuildPreview toString() Example Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/GuildPreview Demonstrates how the GuildPreview object automatically converts to its name when concatenated with a string, as implemented by the toString() method. ```javascript console.log(`Hello from ${previewGuild}!`); ``` -------------------------------- ### Instantiate Discord.js MessageButton Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/MessageButton Creates a new MessageButton instance, which can be configured using provided data. This is the primary way to start building a button component for Discord messages. ```javascript new Discord.MessageButton(data); ``` -------------------------------- ### GuildTemplate toString() Example Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/GuildTemplate Demonstrates how to use the toString() method of a GuildTemplate object to get its code when concatenated with a string. This method automatically returns the template's code. ```javascript console.log(`Template: ${guildTemplate}!`); ``` -------------------------------- ### Install User Applications Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Client Installs user applications on Discord. This function requires a Discord Application ID and returns a Promise that resolves with void upon successful installation. ```javascript client.installUserApps('applicationId'); ``` -------------------------------- ### InviteGuild Object Documentation Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/InviteGuild Documentation for the InviteGuild object, representing a guild received from an invite, including welcome screen data. ```APIDOC ## InviteGuild Object Represents a guild received from an invite, includes welcome screen data if available. ### Properties * **banner** (?string) - The hash of the guild banner * **client** (Client) - Read-only. The client that instantiated this * **createdAt** (Date) - Read-only. The time this guild was created at * **createdTimestamp** (number) - Read-only. The timestamp this guild was created at * **description** (?string) - The description of the guild, if any * **features** (Array) - An array of features available to this guild * **icon** (?string) - The icon hash of this guild * **id** (Snowflake) - The guild's id * **name** (string) - The name of this guild * **nameAcronym** (string) - Read-only. The acronym that shows up in place of a guild icon * **nsfwLevel** (NSFWLevel) - The NSFW level of this guild * **partnered** (boolean) - Read-only. Whether this guild is partnered * **premiumSubscriptionCount** (?number) - The total number of boosts for this server * **splash** (?string) - The hash of the guild invite splash image * **vanityURLCode** (?string) - The vanity invite code of the guild, if any * **verificationLevel** (VerificationLevel) - The verification level of the guild * **verified** (boolean) - Read-only. Whether this guild is verified * **welcomeScreen** (?WelcomeScreen) - The welcome screen for this invite guild ### Methods * **.bannerURL(options?: StaticImageURLOptions): ?string** The URL to this guild's banner. * `options` (StaticImageURLOptions) - Optional. Options for the Image URL. Defaults to `{}`. * **.fetch(): Promise** Fetches this guild. * **.iconURL(options?: ImageURLOptions): ?string** The URL to this guild's icon. * `options` (ImageURLOptions) - Optional. Options for the Image URL. Defaults to `{}`. * **.splashURL(options?: StaticImageURLOptions): ?string** The URL to this guild's invite splash image. * `options` (StaticImageURLOptions) - Optional. Options for the Image URL. Defaults to `{}`. * **.toString(): string** When concatenated with a string, this automatically returns the guild's name instead of the Guild object. ``` -------------------------------- ### Install User Apps Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Client Installs applications for the current user. ```APIDOC ## POST /applications/{application.id}/users/@me/applications ### Description Installs applications for the current user. ### Method POST ### Endpoint `/applications/{applicationId}/users/@me/applications` ### Parameters #### Path Parameters - **applicationId** (Snowflake) - Required - Discord Application id ### Response #### Success Response (200) - **void** (Promise) - Indicates successful installation. ``` -------------------------------- ### WelcomeScreen Object Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/WelcomeScreen Represents a welcome screen in a Discord guild. This object provides access to various properties related to the welcome screen's configuration. ```APIDOC ## WelcomeScreen Object ### Description Represents a welcome screen in a Discord guild. This object provides access to various properties related to the welcome screen's configuration. ### Properties #### .client Read-only The client that instantiated this WelcomeScreen object. - **Type**: `Client` #### .description The description text for the welcome screen. - **Type**: `?string` (Optional string) #### .enabled Indicates whether the welcome screen is currently enabled for the guild. - **Type**: `boolean` #### .guild The guild object to which this welcome screen belongs. - **Type**: `Guild` #### .welcomeChannels A collection of welcome channels associated with this welcome screen. - **Type**: `Collection` ``` -------------------------------- ### Install discord.js-selfbot-v13 Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/general/welcome Installs the latest version of the discord.js-selfbot-v13 package using npm. Requires Node.js 20.18.0 or newer. ```bash npm install discord.js-selfbot-v13@latest ``` -------------------------------- ### ChannelWebhookCreateOptions Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/typedef/ChannelWebhookCreateOptions Options used to create a Webhook in a guild text-based channel. ```APIDOC ## ChannelWebhookCreateOptions ### Description Options used to create a Webhook in a guild text-based channel. ### Properties #### avatar - **Type**: BufferResolvable | Base64Resolvable - **Optional**: True - **Description**: Avatar for the webhook #### reason - **Type**: string - **Optional**: True - **Description**: Reason for creating the webhook ``` -------------------------------- ### Sweep Messages Example Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Sweepers Example of how to use the `sweepMessages` method to remove messages older than a specified duration from the cache. ```APIDOC ## POST /sweepMessages ### Description Sweeps all text-based channels' messages and removes the ones which are indicated by the filter. ### Method POST ### Endpoint `/sweepMessages` ### Parameters #### Query Parameters - **filter** (Function) - Required - The function used to determine which messages will be removed from the caches. ### Request Example ```json { "filter": "(message) => message.editedTimestamp ?? message.createdTimestamp < Date.now() - 1800000" } ``` ### Response #### Success Response (200) - **amount** (number) - Amount of messages that were removed from the caches. #### Response Example ```json { "amount": 150 } ``` ### Example Usage ```javascript // Remove all messages older than 1800 seconds from the messages cache const amount = sweepers.sweepMessages( Sweepers.filterByLifetime({ lifetime: 1800, getComparisonTimestamp: m => m.editedTimestamp ?? m.createdTimestamp, })(), ); console.log(`Successfully removed ${amount} messages from the cache.`); ``` ``` -------------------------------- ### Set Guild Scheduled Event Start Time (JavaScript) Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/GuildScheduledEvent Sets a new start time for a guild scheduled event. This method requires a DateResolvable for the new start time and accepts an optional reason string. It returns a Promise that resolves with the updated GuildScheduledEvent object. ```javascript guildScheduledEvent.setScheduledStartTime('2022-09-24T00:00:00+05:30', 'Adjusting event start') .then(updatedEvent => console.log(`Set the start time to: ${updatedEvent.scheduledStartTime}`)) .catch(console.error); ``` -------------------------------- ### Instantiate Discord.js Client Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Client Demonstrates how to create a new instance of the Discord.js Client. This is the starting point for any bot, allowing it to connect to Discord and interact with the API. It accepts an optional `ClientOptions` object for configuration. ```javascript const Discord = require('discord.js'); const client = new Discord.Client(options); ``` -------------------------------- ### FetchGuildsOptions Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/typedef/FetchGuildsOptions Options used to fetch multiple guilds. This object allows you to specify parameters like 'before', 'after', and 'limit' to control the guild fetching process. ```APIDOC ## FetchGuildsOptions ### Description Options used to fetch multiple guilds. This object allows you to specify parameters like 'before', 'after', and 'limit' to control the guild fetching process. ### Method GET (Implied, as it's for fetching options) ### Endpoint (Not specified, this is a data structure) ### Parameters #### Query Parameters - **before** (Snowflake) - Optional - Get guilds before this guild id - **after** (Snowflake) - Optional - Get guilds after this guild id - **limit** (number) - Optional - Maximum number of guilds to request (1-200) - Default: `200` ### Request Example ```json { "before": "123456789012345678", "after": "987654321098765432", "limit": 100 } ``` ### Response #### Success Response (200) (Not applicable for options, this describes the structure of the options object itself) #### Response Example ```json { "before": "string", "after": "string", "limit": "number" } ``` ``` -------------------------------- ### GET /messages/{message_id}/reactions/{emoji} Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Message Gets a list of users who reacted with a specific emoji to a message. This is typically accessed via `MessageReaction#users`. ```APIDOC ## GET /messages/{message_id}/reactions/{emoji} ### Description Gets a list of users who reacted with a specific emoji to a message. This is typically accessed via `MessageReaction#users`. ### Method GET ### Endpoint `/messages/{message_id}/reactions/{emoji}` ### Parameters #### Path Parameters - **message_id** (Snowflake) - Required - The ID of the message. - **emoji** (string) - Required - The emoji to get users for (URL-encoded). #### Query Parameters - **limit** (integer) - Optional - Number of users to retrieve (max 100). - **after** (Snowflake) - Optional - Get users after this user ID. - **before** (Snowflake) - Optional - Get users before this user ID. #### Request Body None ### Request Example (This action is usually performed via a client-side method, not a direct HTTP request) ### Response #### Success Response (200) - **users** (array) - A list of users who reacted with the emoji. - **after** (Snowflake) - The ID of the last user in the list, if more users are available. - **before** (Snowflake) - The ID of the first user in the list, if more users are available. #### Response Example ```json { "users": [ { "id": "123456789012345678", "username": "ExampleUser", "discriminator": "0001", "avatar": "a_hash" } ], "after": "123456789012345678", "before": "123456789012345678" } ``` ``` -------------------------------- ### Get GuildChannel Permissions (Discord.js) Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/StoreChannel Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites. It can optionally check if the 'ADMINISTRATOR' permission should return all permissions. ```javascript /** * Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites. * @param {GuildMemberResolvable|RoleResolvable} memberOrRole - The member or role to obtain the overall permissions for. * @param {boolean} [checkAdmin=true] - Whether having ADMINISTRATOR will return all permissions. * @returns {?Readonly} The overall permissions for the member or role. */ channel.permissionsFor(memberOrRole, checkAdmin) ``` -------------------------------- ### BaseClient - Options Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/BaseClient The BaseClient class has an 'options' property that holds the client's configuration. ```APIDOC ## BaseClient - Options ### Description Stores the options the client was instantiated with. ### Method N/A (Property) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response #### Success Response (200) - **options** (ClientOptions) - The client configuration options. ### Response Example ```json { "options": { "someOption": "value" } } ``` ``` -------------------------------- ### Create Invite Options Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/typedef/CreateInviteOptions Options used to create an invite to a guild channel. ```APIDOC ## CreateInviteOptions ### Description Options used to create an invite to a guild channel. ### Properties #### Request Body - **temporary** (boolean) - Optional - Default: `false` - Whether members that joined via the invite should be automatically kicked after 24 hours if they have not yet received a role - **maxAge** (number) - Optional - Default: `86400` - How long the invite should last (in seconds, 0 for forever) - **maxUses** (number) - Optional - Default: `0` - Maximum number of uses - **unique** (boolean) - Optional - Default: `false` - Create a unique invite, or use an existing one with similar settings - **targetUser** (UserResolvable) - Optional - Description: The user whose stream to display for this invite, required if `targetType` is 1, the user must be streaming in the channel - **targetApplication** (ApplicationResolvable) - Optional - Description: The embedded application to open for this invite, required if `targetType` is 2, the application must have the `EMBEDDED` flag - **targetType** (TargetType) - Optional - Description: The type of the target for this voice channel invite - **reason** (string) - Optional - Description: The reason for creating the invite ``` -------------------------------- ### Discord.js Selfbot v13 Modal Reply Example Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Modal Demonstrates how to reply to a modal interaction in Discord.js Selfbot v13. This example shows how to set values for text inputs within the modal and then call the reply method. ```javascript client.on('interactionModalCreate', modal => { // Modal > ActionRow > TextInput modal.components[0].components[0].setValue('1+1'); modal.components[1].components[0].setValue('hello'); modal.reply(); }) ``` -------------------------------- ### FetchGuildOptions Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/typedef/FetchGuildOptions Options used to fetch a single guild. This includes parameters to specify the guild and whether to include approximate member and presence counts. ```APIDOC ## FetchGuildOptions ### Description Options used to fetch a single guild. This includes parameters to specify the guild and whether to include approximate member and presence counts. ### Properties #### Parameter - **guild** (GuildResolvable) - Optional - The guild to fetch. - **withCounts** (boolean) - Optional - Defaults to `true`. Whether the approximate member and presence counts should be returned. ``` -------------------------------- ### Delete Invite Example (Discord.js) Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Invite Example of how to delete an invite using the delete() method of the Invite class in Discord.js. This method takes an optional reason string and returns a Promise that resolves with the deleted Invite object. ```javascript // Assuming 'invite' is an instance of the Invite class invite.delete('Reason for deletion') .then(deletedInvite => { console.log(`Invite ${deletedInvite.code} deleted successfully.`); }) .catch(console.error); ``` -------------------------------- ### FetchApplicationCommandOptions Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/typedef/FetchApplicationCommandOptions Options used to fetch Application Commands from Discord. This includes parameters for specifying guild ID, locale, and whether to fetch localizations. ```APIDOC ## FetchApplicationCommandOptions ### Description Options used to fetch Application Commands from Discord. This includes parameters for specifying guild ID, locale, and whether to fetch localizations. ### Method GET (Assumed, as it's for fetching options) ### Endpoint /websites/discordjs-self-v13_netlify_app/api/commands (Hypothetical endpoint based on context) ### Parameters #### Query Parameters - **guildId** (Snowflake) - Optional - The guild's id to fetch commands for, for when the guild is not cached - **locale** (LocaleString) - Optional - The locale to use when fetching this command - **withLocalizations** (boolean) - Optional - Whether to fetch all localization data ### Request Example ```json { "guildId": "123456789012345678", "locale": "en-US", "withLocalizations": true } ``` ### Response #### Success Response (200) - **(Structure not defined in provided text)** #### Response Example ```json { "example": "Response structure not detailed in the provided text." } ``` ``` -------------------------------- ### SnowflakeUtil - EPOCH Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/SnowflakeUtil Provides access to Discord's epoch value, which is the starting timestamp for Discord snowflakes. ```APIDOC ## GET /util/snowflake/epoch ### Description Retrieves Discord's epoch value. ### Method GET ### Endpoint /util/snowflake/epoch ### Parameters None ### Response #### Success Response (200) - **epoch** (number) - Discord's epoch value (2015-01-01T00:00:00.000Z). #### Response Example ```json { "epoch": 1420070400000 } ``` ``` -------------------------------- ### MediaGalleryItem Constructor Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/MediaGalleryItem Initializes a new MediaGalleryItem instance. ```APIDOC ## MediaGalleryItem Constructor ### Description Initializes a new MediaGalleryItem instance. ### Method `new Discord.MediaGalleryItem(data)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **data** (MediaGalleryItemAPIMediaGalleryItem) - Optional - The data for the MediaGalleryItem. ### Request Example ```json { "data": {} } ``` ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### DiscordAuthWebsocket Constructor Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/DiscordAuthWebsocket Initializes a new instance of the DiscordAuthWebsocket class. ```APIDOC ## new Discord.DiscordAuthWebsocket() ### Description Initializes a new instance of the DiscordAuthWebsocket class. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters None ### Request Example ```javascript new Discord.DiscordAuthWebsocket(); ``` ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Activity Object Documentation Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Activity Documentation for the Activity object, including its properties and methods. ```APIDOC ## Activity Object Represents an activity that is part of a user's presence. ### Properties * **applicationId** (?Snowflake) - The id of the application associated with this activity. * **assets** (?RichPresenceAssets) - Assets for rich presence. * **buttons** (Array) - The labels of the buttons of this rich presence. * **createdAt** (Date) - Read-only. The time the activity was created at. * **createdTimestamp** (number) - Creation date of the activity. * **details** (?string) - Details about the activity. * **emoji** (?EmojiIdentifierResolvable) - Emoji for a custom activity. * **flags** (Readonly) - Flags that describe the activity. * **id** (string) - The activity's id. * **name** (string) - The activity's name. * **party** (?ActivityParty) - Party of the activity. * **platform** (?ActivityPlatform) - The platform the game is being played on. * **presence** (Presence) - Read-only. The presence of the Activity. * **sessionId** (?string) - The game's or Spotify session's id. * **state** (?string) - State of the activity. * **syncId** (?string) - The sync id of the activity. This property is not documented by Discord and represents the track id in spotify activities. * **timestamps** (?ActivityTimestamps) - Timestamps for the activity. * **type** (ActivityType) - The activity status's type. * **url** (?string) - If the activity is being streamed, a link to the stream. ### Methods * **.equals(activity: Activity): boolean** - Whether this activity is equal to another activity. * **.toString(): string** - When concatenated with a string, this automatically returns the activities' name instead of the Activity object. ``` -------------------------------- ### Ready Event Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Client Emitted when the client becomes ready to start working. ```APIDOC ## ready ### Description Emitted when the client becomes ready to start working. ### Method EVENT ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ### Event Data - **client** (Client) - The client ``` -------------------------------- ### BaseDispatcher Events Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/BaseDispatcher Information about the events emitted by the BaseDispatcher class, signaling debug information, errors, or playback start. ```APIDOC ## BaseDispatcher Events ### `debug` Emitted whenever the dispatcher has debug information. #### Parameters - **info** (string) - The debug info ### `error` Emitted when the dispatcher encounters an error. ### `start` Emitted once the stream has started to play. ``` -------------------------------- ### ClientPresence Methods Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/ClientPresence This section details the methods available on the ClientPresence object, used for interacting with and modifying the client's presence. ```APIDOC ## ClientPresence Methods ### .equals(presence) Whether this presence is equal to another. Parameter| Type| Description ---|---|--- presence| Presence| The presence to compare with Returns: boolean ### .set(presence) Sets the client's presence Parameter| Type| Description ---|---|--- presence| PresenceData| The data to set the presence to Returns: ClientPresence ``` -------------------------------- ### Message String Representation Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Message Method to get the string representation of a message. ```APIDOC ## toString() ### Description When concatenated with a string, this automatically concatenates the message's content instead of the object. ### Returns - **string** - The content of the message. ``` -------------------------------- ### GET /fetchVoiceRegions Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Client Obtains a collection of available voice regions from Discord. ```APIDOC ## GET /fetchVoiceRegions ### Description Obtains the available voice regions from Discord. ### Method GET ### Endpoint `/fetchVoiceRegions` ### Parameters None ### Request Example ```javascript client.fetchVoiceRegions() .then(regions => console.log(`Available regions are: ${regions.map(region => region.name).join(', ')}`)) .catch(console.error); ``` ### Response #### Success Response (200) - **Collection ** (object) - A collection of voice regions, keyed by their names. #### Response Example ```json { "us-east": { "id": "us-east", "name": "us-east", "optimal": true, "deprecated": false, "custom": false }, "eu-central": { "id": "eu-central", "name": "eu-central", "optimal": true, "deprecated": false, "custom": false } } ``` ``` -------------------------------- ### GET /fetchSticker Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Client Obtains a specific sticker from Discord using its ID. ```APIDOC ## GET /fetchSticker ### Description Obtains a sticker from Discord. ### Method GET ### Endpoint `/fetchSticker` ### Parameters #### Path Parameters None #### Query Parameters - **id** (Snowflake) - Required - The sticker's id. ### Request Example ```javascript client.fetchSticker('id') .then(sticker => console.log(`Obtained sticker with name: ${sticker.name}`)) .catch(console.error); ``` ### Response #### Success Response (200) - **Sticker** (object) - The sticker data. #### Response Example ```json { "id": "123456789012345678", "name": "Example Sticker", "formatType": 2, "asset": "a_hash", "packId": "123456789012345678", "available": true, "guildId": null, "sortValue": 1 } ``` ``` -------------------------------- ### WelcomeChannel Properties Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/WelcomeChannel Details the properties available for the WelcomeChannel class, representing a channel link in a guild's welcome screen. ```APIDOC ## WelcomeChannel Properties ### Description Represents a channel link in a guild's welcome screen. ### Properties #### .channel - **Type**: `TextChannel | NewsChannel | StoreChannel | ForumChannel | MediaChannel` - **Description**: The channel of this welcome channel. #### .channelId - **Type**: `Snowflake` - **Description**: The id of this welcome channel. #### .client - **Read-only**: true - **Type**: `Client` - **Description**: The client that instantiated this. #### .description - **Type**: `string` - **Description**: The description of this welcome channel. #### .emoji - **Type**: `GuildEmoji | Emoji` - **Description**: The emoji of this welcome channel. #### .guild - **Type**: `Guild | InviteGuild` - **Description**: The guild for this welcome channel. ``` -------------------------------- ### GET /fetchGuildTemplate Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Client Obtains a guild template from Discord using its code or URL. ```APIDOC ## GET /fetchGuildTemplate ### Description Obtains a template from Discord. ### Method GET ### Endpoint `/fetchGuildTemplate` ### Parameters #### Path Parameters None #### Query Parameters - **template** (GuildTemplateResolvable) - Required - Template code or URL. ### Request Example ```javascript client.fetchGuildTemplate('https://discord.new/FKvmczH2HyUf') .then(template => console.log(`Obtained template with code: ${template.code}`)) .catch(console.error); ``` ### Response #### Success Response (200) - **GuildTemplate** (object) - The guild template data. #### Response Example ```json { "code": "FKvmczH2HyUf", "name": "Example Template", "description": "A template for a new server.", "creatorId": "123456789012345678", "creator": { "id": "123456789012345678", "username": "ExampleUser", "discriminator": "0001", "avatar": "a_hash" }, "channelId": "123456789012345678", "guildId": "123456789012345678", "isDirty": false, "createdAt": "2023-01-01T12:00:00.000Z", "updatedAt": "2023-01-01T12:00:00.000Z", "sourceGuildId": "123456789012345678", "serializedSourceGuild": { "name": "Example Guild", "icon": "a_hash", "verificationLevel": 1, "defaultMessageNotifications": 0, "explicitContentFilter": 0, "preferredLocale": "en-US", "systemChannelFlags": 0, "premiumProgressBarEnabled": false }, "tags": [], "usageCount": 10, "isPrime": false } ``` ``` -------------------------------- ### ThumbnailComponent Constructor Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/ThumbnailComponent Initializes a new ThumbnailComponent with provided data. ```APIDOC ## new Discord.ThumbnailComponent(data) ### Description Initializes a new ThumbnailComponent with provided data. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```javascript new Discord.ThumbnailComponent(data); ``` ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Delete Guild Example Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Guild Deletes the guild. This is a destructive action and should be used with caution. It returns a Promise that resolves with the deleted Guild object. ```javascript guild.delete() .then(g => console.log(`Deleted the guild ${g}`)) .catch(console.error); ``` -------------------------------- ### StageInstanceCreateOptions Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/typedef/StageInstanceCreateOptions Defines the properties required to create a stage instance. ```APIDOC ## StageInstanceCreateOptions ### Description Options used to create a stage instance. ### Properties #### topic - **topic** (string) - Optional - The topic of the stage instance. #### privacyLevel - **privacyLevel** (PrivacyLevelnumber) - Optional - The privacy level of the stage instance. #### sendStartNotification - **sendStartNotification** (boolean) - Optional - Whether to notify `@everyone` that the stage instance has started. #### guildScheduledEvent - **guildScheduledEvent** (GuildScheduledEventResolvable) - Optional - The guild scheduled event associated with the stage instance. ### Request Example ```json { "topic": "Discussion about API documentation", "privacyLevel": 1, "sendStartNotification": true, "guildScheduledEvent": "123456789012345678" } ``` ### Response #### Success Response (200) - **stageInstance** (Object) - The created stage instance object. #### Response Example ```json { "stageInstance": { "id": "987654321098765432", "guildId": "111111111111111111", "channelId": "222222222222222222", "topic": "Discussion about API documentation", "privacyLevel": 1, "discoverableDisabled": false, "guildScheduledEventId": "123456789012345678" } } ``` ``` -------------------------------- ### FetchPollVotersOptions Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/typedef/FetchPollVotersOptions Options for fetching poll voters. This object allows you to specify the maximum number of voters to retrieve and a starting point for the fetch. ```APIDOC ## FetchPollVotersOptions ### Description Options for fetching poll voters. This object allows you to specify the maximum number of voters to retrieve and a starting point for the fetch. ### Method N/A (This is an options object, not an endpoint) ### Endpoint N/A ### Parameters #### Properties - **limit** (number) - Optional - The maximum number of voters to fetch - **after** (Snowflake) - Optional - The user id to fetch voters after ### Request Example ```json { "limit": 50, "after": "123456789012345678" } ``` ### Response This is an options object and does not have a direct response. The results of using these options would be a list of voters. ``` -------------------------------- ### FetchRecommendedShardsOptions Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/typedef/FetchRecommendedShardsOptions Options for fetching recommended shards, including guilds per shard and multiple of shard count. ```APIDOC ## FetchRecommendedShardsOptions ### Description Options for fetching recommended shards, specifying the number of guilds per shard and a multiple for shard count rounding. ### Method N/A (This is a type definition, not an endpoint) ### Endpoint N/A ### Parameters #### Query Parameters N/A #### Request Body ##### Properties - **guildsPerShard** (number) - Optional - Number of guilds assigned per shard. Defaults to `1000`. - **multipleOf** (number) - Optional - The multiple the shard count should round up to. (16 for large bot sharding). Defaults to `1`. ``` -------------------------------- ### BaseGuild Methods Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/BaseGuild Details about the methods available on the BaseGuild class, used for interacting with guild data. ```APIDOC ## BaseGuild Methods ### .fetch() Fetches this guild. Returns: `Promise` ### .iconURL(options) The URL to this guild's icon. **Parameters** | Parameter | Type | Optional | Default | Description | |---|---|---|---|---| | options | ImageURLOptions | True | `{}` | Options for the Image URL | Returns: `?string` ### .toString() When concatenated with a string, this automatically returns the guild's name instead of the Guild object. Returns: `string` ``` -------------------------------- ### Create Discord Friend Invite (JavaScript) Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/ClientUser Demonstrates how to create a friend invite for a Discord user using the `createFriendInvite` method. This method returns a Promise that resolves with an Invite object. Ensure you handle potential errors during the invite creation process. ```javascript client.user.createFriendInvite() .then(console.log) .catch(console.error); ``` -------------------------------- ### GET /fetchPremiumStickerPacks Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Client Obtains the list of sticker packs available to Nitro subscribers from Discord. ```APIDOC ## GET /fetchPremiumStickerPacks ### Description Obtains the list of sticker packs available to Nitro subscribers from Discord. ### Method GET ### Endpoint `/fetchPremiumStickerPacks` ### Parameters None ### Request Example ```javascript client.fetchPremiumStickerPacks() .then(packs => console.log(`Available sticker packs are: ${packs.map(pack => pack.name).join(', ')}`)) .catch(console.error); ``` ### Response #### Success Response (200) - **Collection ** (object) - A collection of sticker packs, keyed by their Snowflake IDs. #### Response Example ```json { "123456789012345678": { "id": "123456789012345678", "name": "Example Pack", "skuId": "123456789012345678", "available": true, "stickers": [ { "id": "123456789012345678", "name": "Sticker 1", "formatType": 2, "asset": "a_hash" } ] } } ``` ``` -------------------------------- ### ClientFetchInviteOptions Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/typedef/ClientFetchInviteOptions Options for fetching a Discord invite, including an optional guild scheduled event ID. ```APIDOC ## ClientFetchInviteOptions ### Description Options used when fetching an invite from Discord. ### Properties #### guildScheduledEventId - **guildScheduledEventId** (Snowflake) - Optional - The id of the guild scheduled event to include with the invite ``` -------------------------------- ### GET /authorizedApplications Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Client Retrieves a list of applications authorized by the bot via OAuth2 tokens. ```APIDOC ## GET /authorizedApplications ### Description Retrieves the list of authorized applications (OAuth2 tokens). ### Method GET ### Endpoint `/authorizedApplications` ### Parameters None ### Request Example None ### Response #### Success Response (200) - **Collection ** (object) - A collection of authorized applications, keyed by their Snowflake IDs. #### Response Example ```json { "123456789012345678": { "id": "123456789012345678", "name": "Example App" } } ``` ``` -------------------------------- ### Channel Permissions For Member/Role API Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/BaseGuildTextChannel Gets the overall set of permissions for a member or role in this channel. ```APIDOC ## GET /channels/{channel.id}/permissions ### Description Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites. ### Method GET ### Endpoint `/channels/{channel.id}/permissions` ### Parameters #### Path Parameters - **channel.id** (string) - Required - The ID of the channel. #### Query Parameters - **memberOrRole** (string) - Required - The ID of the member or role to obtain permissions for. - **checkAdmin** (boolean) - Optional - Whether having `ADMINISTRATOR` will return all permissions. Defaults to `true`. ### Request Example ``` GET /channels/channel-id/permissions?memberOrRole=member-id&checkAdmin=false ``` ### Response #### Success Response (200) - **Permissions** (object) - An object representing the permissions. #### Response Example ```json { "bitfield": "2147483647", "permissions": [ "ADMINISTRATOR", "VIEW_CHANNEL", // ... other permissions ] } ``` ``` -------------------------------- ### AnonymousGuild Methods Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/AnonymousGuild This section details the methods available for Guild and InviteGuild objects. ```APIDOC ## AnonymousGuild Methods ### .bannerURL(options) The URL to this guild's banner. **Parameters** - **options** (StaticImageURLOptions) - Optional - Options for the Image URL **Returns** - ?string ### .fetch() Fetches this guild. **Returns** - Promise ### .iconURL(options) The URL to this guild's icon. **Parameters** - **options** (ImageURLOptions) - Optional - Options for the Image URL **Returns** - ?string ### .splashURL(options) The URL to this guild's invite splash image. **Parameters** - **options** (StaticImageURLOptions) - Optional - Options for the Image URL **Returns** - ?string ### .toString() When concatenated with a string, this automatically returns the guild's name instead of the Guild object. **Returns** - string ``` -------------------------------- ### TextChannel Methods Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/TextChannel This section outlines the available methods for interacting with a TextChannel object, such as sending messages, creating invites, and managing threads. ```APIDOC ## TextChannel Methods ### awaitMessages Waits for messages to be sent to this channel. ### clone Clones a channel. ### createInvite Creates an invite to this channel. ### createMessageCollector Creates a message collector for this channel. ### createWebhook Creates a webhook for this channel. ### delete Deletes this channel. ### edit Edits this channel. ### equals Checks if this channel is equal to another. ### fetch Fetches the channel from Discord. ### fetchInvites Fetches invites to this channel. ### fetchWebhooks Fetches webhooks for this channel. ### isDirectory Checks if this channel is a directory. ### isText Checks if this channel is a text channel. ### isThread Checks if this channel is a thread. ### isThreadOnly Checks if this channel is a thread-only channel. ### isVoice Checks if this channel is a voice channel. ### lockPermissions Locks the permissions of this channel. ### permissionsFor Gets the permissions of a member in this channel. ### send Sends a message to this channel. ### sendTyping Sends a typing indicator to this channel. ### setDefaultAutoArchiveDuration Sets the default auto archive duration for newly created threads in this channel. ### setName Sets the name of this channel. ### setNSFW Sets the NSFW status of this channel. ### setParent Sets the parent of this channel. ### setPosition Sets the position of this channel. ### setRateLimitPerUser Sets the rate limit per user for this channel. ### setTopic Sets the topic of this channel. ### setType Sets the type of this channel. ### toString Returns a string representation of this channel. ``` -------------------------------- ### Sortable Channel Group Types Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/class/Util Gets an array of channel types that can be moved within a channel group, based on the provided channel type. ```APIDOC ## .getSortableGroupTypes(type) ### Description Gets an array of the channel types that can be moved in the channel group. For example, a GuildText channel would return an array containing the types that can be ordered within the text channels (always at the top), and a voice channel would return an array containing the types that can be ordered within the voice channels (always at the bottom). ### Method Static ### Parameters #### Path Parameters - **type** (ChannelType) - The type of the channel. ### Returns Array ``` -------------------------------- ### ActivitiesOptions Source: https://discordjs-self-v13.netlify.app/#/docs/docs/main/index_/docs/docs/main/typedef/ActivitiesOptions Options for setting user activities. This includes properties like name, state, type, and URL. ```APIDOC ## ActivitiesOptions ### Description Options for setting activities. ### Method Not applicable (this describes an object structure). ### Endpoint Not applicable (this describes an object structure). ### Parameters #### Properties - **name** (string) - Optional - Name of the activity - **state** (string) - Optional - State of the activity - **type** (ActivityType | number) - Optional - Type of the activity - **url** (string) - Optional - Twitch / YouTube stream URL ### Request Example ```json { "name": "Playing a game", "state": "In a custom status", "type": 0, "url": "https://www.twitch.tv/example" } ``` ### Response #### Success Response (200) This object structure is used in requests, not typically returned as a success response. #### Response Example ```json { "name": "Playing a game", "state": "In a custom status", "type": 0, "url": "https://www.twitch.tv/example" } ``` ```