### APIGuildOnboardingPrompt Interface Source: https://discord.js.org/docs/packages/discord.js/14.26.4/APIGuildOnboardingPrompt%3AInterface Represents a prompt within the guild onboarding flow. This interface defines the structure for prompts that guide new users through server setup. ```APIDOC ## APIGuildOnboardingPrompt Interface This interface defines the structure for a guild onboarding prompt. ### Properties - **id** (Snowflake) - Required - The unique identifier for the prompt. - **in_onboarding** (boolean) - Required - Indicates if the prompt is part of the main onboarding flow. If false, it appears only in the Channels & Roles tab. - **options** (APIGuildOnboardingPromptOption[]) - Required - An array of available options for this prompt. - **required** (boolean) - Required - Specifies if a user must answer this prompt to complete onboarding. - **single_select** (boolean) - Required - Determines if users can select only one option or multiple options. - **title** (string) - Required - The text displayed as the title of the prompt. - **type** (GuildOnboardingPromptType) - Required - The type of prompt, dictating its behavior and presentation. ``` -------------------------------- ### Install discord.js Source: https://discord.js.org/docs Install discord.js using npm, yarn, pnpm, or bun. Ensure Node.js 22.12.0 or newer is installed. ```bash npm install discord.js yarn add discord.js pnpm add discord.js bun add discord.js ``` -------------------------------- ### Define APIGuildOnboardingPrompt Interface Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/APIGuildOnboardingPrompt%3AInterface Defines the structure for an onboarding prompt in a Discord guild. This interface is used to represent prompts that guide new users through server setup. ```typescript export interface APIGuildOnboardingPrompt ``` -------------------------------- ### Get Guild Onboarding Information Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/RESTGetAPIGuildOnboardingResult%3ATypeAlias This endpoint retrieves the onboarding information for a specific guild. The response includes details about the guild's onboarding setup, such as prompts and default channels. ```APIDOC ## GET /api/guilds/{guild.id}/onboarding ### Description Retrieves the onboarding information for a specific guild. ### Method GET ### Endpoint `/api/guilds/{guild.id}/onboarding` ### Parameters #### Path Parameters - **guild.id** (snowflake) - Required - The ID of the guild to retrieve onboarding information for. ### Response #### Success Response (200) - **APIGuildOnboarding** (object) - The guild's onboarding object. ### Response Example ```json { "prompts": [ { "id": "908724070241401856", "type": 0, "options": [ { "id": "908724071560167454", "title": "a role", "description": "", "emoji_id": null, "emoji_name": null } ], "title": "Do you want to be a part of this community?", "single_select": true, "required": true } ], "default_channel_ids": [ "908724070241401856" ], "version": 3 } ``` See also: https://discord.com/developers/docs/resources/guild#get-guild-onboarding ``` -------------------------------- ### Install discord-api-types Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10 Install the discord-api-types package using npm, yarn, or pnpm. ```bash npm install discord-api-types yarn add discord-api-types pnpm add discord-api-types ``` -------------------------------- ### APIApplicationInstallParams Interface Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/APIApplicationInstallParams%3AInterface Details the parameters for application installations within the Discord API. ```APIDOC ## Interface APIApplicationInstallParams ### Description Represents the parameters used when installing an application. ### Properties - **permissions** (Permissions) - Required - The permissions required for the application. - **scopes** (OAuth2Scopes[]) - Required - The OAuth2 scopes the application requests. ``` -------------------------------- ### clientReady Source: https://discord.js.org/docs/packages/discord.js/14.26.4/Client%3AClass Emitted when the client becomes ready to start working. ```APIDOC ## clientReady ### Description Emitted when the client becomes ready to start working. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method None (Event) ### Endpoint None (Event) ### Request Example None ### Response #### Success Response None #### Response Example None ``` -------------------------------- ### Install @discordjs/collection Source: https://discord.js.org/docs/packages/collection/2.1.1 Install the @discordjs/collection package using npm, yarn, or pnpm. Node.js 22.12.0 or newer is required. ```bash npm install @discordjs/collection ``` ```bash yarn add @discordjs/collection ``` ```bash pnpm add @discordjs/collection ``` -------------------------------- ### IntegrationTypesConfigurationContext Source: https://discord.js.org/docs/packages/discord.js/14.26.4/IntegrationTypesConfigurationContext%3AInterface Represents the application's supported installation context data. It includes OAuth2 installation parameters which define the scopes and permissions related to the installation context. ```APIDOC ## Interface: IntegrationTypesConfigurationContext ### Description The application's supported installation context data. ### Properties #### oauth2InstallParams - **oauth2InstallParams** (IntegrationTypesConfigurationParameters | null) - Scopes and permissions regarding the installation context. ``` -------------------------------- ### ClientApplicationInstallParams Source: https://discord.js.org/docs/packages/discord.js/14.26.4/ClientApplicationInstallParams%3AInterface Represents the parameters used when installing a Discord application. It specifies the permissions and scopes that will be requested. ```APIDOC ## Interface: ClientApplicationInstallParams ### Description Defines the parameters for installing a Discord application, including the permissions and scopes to be requested. ### Properties #### permissions - **permissions** (Readonly) - Required - Permissions that will be requested for the integrated role. #### scopes - **scopes** (readonly OAuth2Scopes[]) - Required - Scopes that will be set upon adding this application. ``` -------------------------------- ### APIApplicationInstallParams Source: https://discord.js.org/docs/packages/discord.js/14.26.4/APIApplicationInstallParams%3AInterface Represents the parameters used when installing an application, including required permissions and OAuth2 scopes. ```APIDOC ## Interface: APIApplicationInstallParams This interface defines the parameters that can be provided when installing an application. ### Properties - **permissions** (Permissions) - Required - The permissions your application needs to function. - **scopes** (OAuth2Scopes[]) - Required - The OAuth2 scopes your application is requesting. ``` -------------------------------- ### typingStart Source: https://discord.js.org/docs/packages/discord.js/14.26.4/ClientEvents%3AInterface Emitted when a user starts typing in a channel. This event provides the Typing object. ```APIDOC ## typingStart ### Description Emitted when a user starts typing in a channel. ### Parameters #### Path Parameters - **typing** (Typing) - The typing object representing the user's typing activity. ``` -------------------------------- ### APIApplicationInstallParams Interface Definition Source: https://discord.js.org/docs/packages/discord.js/14.26.4/APIApplicationInstallParams%3AInterface Defines the structure of parameters for application installations. ```typescript export interface APIApplicationInstallParams ``` -------------------------------- ### RPCStartPurchaseArgs Interface Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/RPCStartPurchaseArgs%3AInterface Defines the arguments required for starting a purchase through the RPC interface. ```APIDOC ## POST /rpc/startPurchase ### Description Initiates a purchase process for a given SKU ID. ### Method POST ### Endpoint /rpc/startPurchase ### Parameters #### Request Body - **sku_id** (Snowflake) - Required - The ID of the SKU to purchase. ### Request Example ```json { "sku_id": "123456789012345678" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the purchase initiation. - **message** (string) - A message providing details about the operation. #### Response Example ```json { "status": "success", "message": "Purchase initiated successfully." } ``` ``` -------------------------------- ### TeamMember toString Example Source: https://discord.js.org/docs/packages/discord.js/14.26.4/TeamMember%3AClass Demonstrates how the toString method of a TeamMember object can be used to get a user mention when concatenated with a string. ```javascript // Logs: Team Member's mention: <@123456789012345678> console.log(`Team Member's mention: ${teamMember}`); ``` -------------------------------- ### APIGuildOnboardingPromptOption Interface Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/APIGuildOnboardingPromptOption%3AInterface Defines the structure for an option within a guild's onboarding prompt. ```APIDOC ## APIGuildOnboardingPromptOption Interface ### Description Represents an option within a guild's onboarding prompt. ### Fields - **channel_ids** (Snowflake[]) - Required - IDs for channels a member is added to when the option is selected. - **description** (string | null) - Optional - Description of the option. - **emoji** (APIPartialEmoji) - Required - Emoji of the option. - **id** (Snowflake) - Required - ID of the prompt option. - **role_ids** (Snowflake[]) - Required - IDs for roles assigned to a member when the option is selected. - **title** (string) - Required - Title of the option. ### See Also - https://discord.com/developers/docs/resources/guild#guild-onboarding-object-prompt-option-structure ``` -------------------------------- ### GET /gateway/bot Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/APIGatewayBotInfo%3AInterface Retrieves information about the Discord API Gateway, including session start limits, recommended shard count, and the gateway URL. ```APIDOC ## GET /gateway/bot ### Description Retrieves information about the Discord API Gateway, including session start limits, recommended shard count, and the gateway URL. ### Method GET ### Endpoint /gateway/bot ### Response #### Success Response (200) - **session_start_limit** (APIGatewaySessionStartLimit) - Information on the current session start limit. - **shards** (number) - The recommended number of shards to use when connecting. - **url** (string) - The WSS URL that can be used for connecting to the gateway. #### Response Example { "session_start_limit": { "total": 100, "remaining": 99, "reset_after": 14400, "max_concurrency": 1 }, "shards": 1, "url": "wss://gateway.discord.gg/" } ``` -------------------------------- ### APIGuildOnboardingPromptOption Interface Source: https://discord.js.org/docs/packages/discord.js/14.26.4/APIGuildOnboardingPromptOption%3AInterface Represents an option within a guild onboarding prompt. This interface defines the structure for individual choices users can make during the onboarding process, including associated channel and role assignments, and display elements like title, description, and emoji. ```APIDOC ## Interface: APIGuildOnboardingPromptOption This interface defines the structure for an option within a guild onboarding prompt. ### Properties - **channel_ids** (Snowflake[]) - Required - IDs for channels a member is added to when the option is selected. - **description** (string | null) - Required - Description of the option. - **emoji** (APIPartialEmoji) - Required - Emoji of the option. - **id** (Snowflake) - Required - ID of the prompt option. - **role_ids** (Snowflake[]) - Required - IDs for roles assigned to a member when the option is selected. - **title** (string) - Required - Title of the option. ### See Also - [Guild Onboarding Object: Prompt Option Structure](https://discord.com/developers/docs/resources/guild#guild-onboarding-object-prompt-option-structure) ``` -------------------------------- ### reply Source: https://discord.js.org/docs/packages/discord.js/14.26.4/ModalMessageModalSubmitInteraction%3AInterface Creates a reply to this interaction. Use the `withResponse` option to get the interaction callback response. Examples are provided for replying with content and with an embed. ```APIDOC ## reply(options: InteractionReplyOptions & { withResponse: true }) ### Description Creates a reply to this interaction. Use the `withResponse` option to get the interaction callback response. ### Method `reply` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **options** (`InteractionReplyOptions & { withResponse: true }`) - Required - Options for the reply, must include `withResponse: true`. ### Request Example ```javascript // Reply to the interaction and fetch the response interaction.reply({ content: 'Pong!', withResponse: true }) .then((response) => console.log(`Reply sent with content ${response.resource.message.content}`)) .catch(console.error); // Create an ephemeral reply with an embed const embed = new EmbedBuilder().setDescription('Pong!'); interaction.reply({ embeds: [embed], flags: MessageFlags.Ephemeral }) .then(() => console.log('Reply sent.')) .catch(console.error); ``` ### Returns `Promise>>` ``` -------------------------------- ### Getting the First Value from a Collection Source: https://discord.js.org/docs/packages/discord.js/14.26.4/Collection%3AClass Retrieves the first value in the collection. Can also retrieve multiple values starting from the end if a negative amount is provided. ```javascript collection.first(); ``` -------------------------------- ### fetchOnboarding Source: https://discord.js.org/docs/packages/discord.js/14.26.4/Guild%3AClass Fetches the guild's onboarding data. This allows retrieval of the current onboarding configuration. ```APIDOC ## fetchOnboarding ### Description Fetches the guild onboarding data for this guild. ### Method GET ### Endpoint `/guilds/{guild.id}/onboarding` ### Response #### Success Response (200) - **GuildOnboarding** - The guild onboarding object. ``` -------------------------------- ### GuildMemberFlags: StartedHomeActions Source: https://discord.js.org/docs/packages/discord.js/14.26.4/GuildMemberFlags%3AEnum Represents a flag indicating that a member has started Server Guide new member actions. This flag tracks members who have begun the initial onboarding tasks. ```typescript StartedHomeActions = 32 ``` -------------------------------- ### Configuring REST Instance Options Source: https://discord.js.org/docs/packages/discord.js/14.26.4/RESTOptions%3AInterface Illustrates how to configure various options for the REST instance, such as API path, authorization prefix, CDN path, request limits, and timeouts. ```typescript agent : Dispatcher | null api : string = 'https://discord.com/api' authPrefix : 'Bearer' | 'Bot' = 'Bot' cdn : string = 'https://cdn.discordapp.com' globalRequestsPerSecond : number = 50 handlerSweepInterval : number = 3_600_000 hashLifetime : number = 86_400_000 hashSweepInterval : number = 14_400_000 headers : Record = {} invalidRequestWarningInterval : number = 0 mediaProxy : string = 'https://media.discordapp.net' offset : GetRateLimitOffsetFunction | number = 50 rejectOnRateLimit : RateLimitQueueFilter | string[] | null = null retries : number = 3 timeout : number = 15_000 userAgentAppendix : string = DefaultUserAgentAppendix version : string = '10' ``` -------------------------------- ### APIGuildOnboardingPrompt Structure Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/APIGuildOnboardingPrompt%3AInterface Defines the structure of an onboarding prompt for a Discord guild. ```APIDOC ## APIGuildOnboardingPrompt Structure ### Description Represents a prompt within the guild's onboarding flow. ### Fields - **id** (Snowflake) - Required - The unique identifier for the prompt. - **in_onboarding** (boolean) - Required - Indicates if the prompt is part of the active onboarding flow. If false, it will only appear in the Channels & Roles tab. - **options** (APIGuildOnboardingPromptOption[]) - Required - An array of available options for the user to select from. - **required** (boolean) - Required - Specifies whether this prompt is mandatory for users to complete the onboarding. - **single_select** (boolean) - Required - Determines if users can select only one option or multiple options for this prompt. - **title** (string) - Required - The text displayed as the title of the prompt. - **type** (GuildOnboardingPromptType) - Required - The type of prompt, dictating its presentation and behavior. ``` -------------------------------- ### APIGuildOnboardingPromptOption Interface Definition Source: https://discord.js.org/docs/packages/discord.js/14.26.4/APIGuildOnboardingPromptOption%3AInterface Defines the structure for an onboarding prompt option within a Discord guild. This interface outlines the available fields for configuring channel IDs, descriptions, emojis, role IDs, and titles for each option. ```typescript export interface APIGuildOnboardingPromptOption ``` -------------------------------- ### APIGatewaySessionStartLimit Object Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/APIGatewaySessionStartLimit%3AInterface Represents the session start limit information for the Discord Gateway. ```APIDOC ## APIGatewaySessionStartLimit Object ### Description Represents the session start limit information for the Discord Gateway. ### Interface Definition ```typescript export interface APIGatewaySessionStartLimit ``` ### Properties #### max_concurrency (number) - Required: Yes - Description: The number of identify requests allowed per 5 seconds. #### remaining (number) - Required: Yes - Description: The remaining number of session starts the current user is allowed. #### reset_after (number) - Required: Yes - Description: The number of milliseconds after which the limit resets. #### total (number) - Required: Yes - Description: The total number of session starts the current user is allowed. ### See Also - https://discord.com/developers/docs/topics/gateway#session-start-limit-object ``` -------------------------------- ### GET /guilds/{guild.id}/roles Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/RESTGetAPIGuildRolesResult%3ATypeAlias Retrieves all roles in a guild. The roles are returned in descending order of their position. This endpoint can be used to get the roles of a guild, or to get the roles of a guild that the bot is in. ```APIDOC ## GET /guilds/{guild.id}/roles ### Description Retrieves all roles in a guild. The roles are returned in descending order of their position. ### Method GET ### Endpoint `/guilds/{guild.id}/roles` ### Parameters #### Path Parameters - **guild.id** (snowflake) - Required - The ID of the guild to get the roles from. ### Response #### Success Response (200) - **APIRole[]** - An array of APIRole objects, representing the roles in the guild. ### Response Example ```json [ { "id": "1073741824", "name": "@everyone", "color": 0, "hoist": false, "position": 0, "permissions": "0", "managed": false, "mentionable": false, "tags": {} } ] ``` ``` -------------------------------- ### APIGatewaySessionStartLimit Interface Source: https://discord.js.org/docs/packages/discord.js/14.26.4/APIGatewaySessionStartLimit%3AInterface The APIGatewaySessionStartLimit interface defines the limits for starting gateway sessions. It includes properties for maximum concurrency, remaining session starts, the reset timer, and the total allowed session starts. ```APIDOC ## Interface: APIGatewaySessionStartLimit This interface represents the limits for gateway session starts. ### Properties - **max_concurrency** (number) - The number of identify requests allowed per 5 seconds. - **remaining** (number) - The remaining number of session starts the current user is allowed. - **reset_after** (number) - The number of milliseconds after which the limit resets. - **total** (number) - The total number of session starts the current user is allowed. ``` -------------------------------- ### Client Constructor Source: https://discord.js.org/docs/packages/discord.js/14.26.4/Client%3AClass Initializes a new Client instance. The options object can be used to configure various aspects of the client's behavior, such as intents, API rate limits, and more. ```APIDOC ## constructor(options: ClientOptions) ### Parameters * **options** (ClientOptions) - The options to pass to the client constructor. ``` -------------------------------- ### RESTAPIGuildOnboardingPromptOption Interface Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/RESTAPIGuildOnboardingPromptOption%3AInterface Defines the structure for an onboarding prompt option within a Discord guild, extending base properties and including specific fields like title, emoji details, and optional flags. ```APIDOC ## Interface RESTAPIGuildOnboardingPromptOption ### Description Represents an option within a guild's onboarding prompt. ### Extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface>>, Pick ### Properties - **emoji_animated** (boolean | null | undefined) - Optional - Whether this emoji is animated. - **emoji_id** (Snowflake | null | undefined) - Optional - The ID of the emoji. - **emoji_name** (string | null | undefined) - Optional - The name of the emoji. - **title** (string) - Required - The title of the prompt option. ``` -------------------------------- ### ShardRange Start Property Source: https://discord.js.org/docs/packages/discord.js/14.26.4/ShardRange%3AInterface Represents the starting shard ID of the range. This property is a number. ```typescript start : number ``` -------------------------------- ### Stage Start Message Type Source: https://discord.js.org/docs/packages/discord.js/14.26.4/MessageType%3AEnum Indicates a message generated when a stage channel event starts. ```typescript StageStart = 27 ``` -------------------------------- ### ready Source: https://discord.js.org/docs/packages/discord.js/14.26.4/Client%3AClass Use clientReady instead. Deprecated. Emitted when the client becomes ready to start working. ```APIDOC ## ready ### Description Use clientReady instead. Deprecated. Emitted when the client becomes ready to start working. ### Parameters #### Path Parameters - **client** (Client) - Description not available ``` -------------------------------- ### RPC Get User Arguments Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/RPCGetUserArgs%3AInterface Defines the arguments required for the RPC method to get user information. ```APIDOC ## RPCGetUserArgs ### Description Arguments for the RPC method to retrieve user information. ### Method Not specified (likely internal RPC call) ### Endpoint Not specified ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **id** (Snowflake) - Required - Id of the user to get ### Request Example ```json { "id": "123456789012345678" } ``` ### Response #### Success Response (200) - **User object** (object) - The user object corresponding to the provided ID. #### Response Example ```json { "id": "123456789012345678", "username": "ExampleUser", "discriminator": "1234", "avatar": "a_hash" } ``` ``` -------------------------------- ### create Source: https://discord.js.org/docs/packages/discord.js/14.26.4/GuildApplicationCommandManager%3AClass Creates a new application command for the guild. You can provide the command details such as name, description, and options. ```APIDOC ## create ### Description Creates an application command. ### Method POST ### Endpoint `/applications/@me/guilds/{guild.id}/commands` ### Parameters #### Request Body - **command** (ApplicationCommandDataResolvable) - Required - The data for the command to create. ### Request Example ```json { "name": "test", "description": "A test command" } ``` ### Response #### Success Response (200 or 201) - **ApplicationCommand** - The created application command object. ``` -------------------------------- ### Get Guilds Response Structure Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/RPCGetGuildsResultData%3AInterface Details the structure of the response when calling the Get Guilds RPC method. ```APIDOC ## Get Guilds Response Structure ### Description This endpoint returns a list of guilds the user is currently in. ### Method GET ### Endpoint /rpc/v10/guilds ### Response #### Success Response (200) - **guilds** (APIPartialGuild[]) - The guilds the user is in. ### Response Example ```json { "guilds": [ { "id": "123456789012345678", "name": "My Awesome Server", "icon": "a_hash_string" } ] } ``` ``` -------------------------------- ### APIGuildOnboarding Interface Source: https://discord.js.org/docs/packages/discord.js/14.26.4/APIGuildOnboarding%3AInterface Represents the structure for guild onboarding settings, including enabled status, default channels, prompts, and the guild ID. ```APIDOC ## Interface APIGuildOnboarding Represents the structure for guild onboarding settings. ### Fields - **default_channel_ids** (Snowflake[]) - Channel ids that members get opted into automatically. - **enabled** (boolean) - Whether onboarding is enabled in the guild. - **guild_id** (Snowflake) - Id of the guild this onboarding is part of. - **mode** (GuildOnboardingMode) - Current mode of onboarding. - **prompts** (APIGuildOnboardingPrompt[]) - Prompts shown during onboarding and in customize community. ``` -------------------------------- ### Invite toString Method Example Source: https://discord.js.org/docs/packages/discord.js/14.26.4/Invite%3AClass Demonstrates how the `toString` method of the Invite class automatically provides the invite URL when concatenated with a string. ```javascript // Logs: Invite: https://discord.gg/A1b2C3 console.log(`Invite: ${invite}`); ``` -------------------------------- ### RPC Get Channel Response Structure Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/RPCGetChannelResultData%3AInterface This section describes the data structure returned by the RPC Get Channel endpoint. ```APIDOC ## GET /channels/{channel.id} ### Description Retrieves information about a specific channel. ### Method GET ### Endpoint `/channels/{channel.id}` ### Parameters #### Path Parameters - **channel.id** (Snowflake) - Required - The ID of the channel to retrieve. ### Response #### Success Response (200) - **id** (Snowflake) - The unique identifier for the channel. - **guild_id** (Snowflake) - The ID of the guild the channel belongs to. - **name** (string) - The name of the channel. - **type** (ChannelType) - The type of the channel (e.g., text, voice). - **position** (number) - The position of the channel in the channel list. - **topic** (string) - Optional - The topic of the channel (for text channels). - **user_limit** (number) - Optional - The maximum number of users allowed in the channel (for voice channels, 0 for no limit). - **bitrate** (number) - Optional - The bitrate of the voice channel. - **messages** (APIMessage[]) - Optional - An array of messages in the channel (for text channels). - **voice_states** (APIVoiceState[]) - Optional - An array of voice states for users in the channel (for voice channels). ### Response Example ```json { "id": "123456789012345678", "guild_id": "987654321098765432", "name": "general", "type": 0, "position": 1, "topic": "General discussion", "user_limit": 0, "bitrate": 64000, "messages": [ { "id": "111111111111111111", "channel_id": "123456789012345678", "author": { "id": "222222222222222222", "username": "TestUser", "discriminator": "1234", "avatar": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6" }, "content": "Hello world!", "timestamp": "2023-01-01T12:00:00.000Z", "edited_timestamp": null, "tts": false, "mention_everyone": false, "mentions": [], "attachments": [], "embeds": [], "reactions": [] } ], "voice_states": [ { "guild_id": "987654321098765432", "channel_id": "123456789012345678", "user_id": "222222222222222222", "member": { "user": { "id": "222222222222222222", "username": "TestUser", "discriminator": "1234", "avatar": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6" }, "roles": [], "deaf": false, "mute": false, "self_deaf": false, "self_mute": false, "suppress": false }, "session_id": "session123", "deaf": false, "mute": false, "self_deaf": false, "self_mute": false, "suppress": false } ] } ``` ``` -------------------------------- ### Get Current User Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/RESTGetAPICurrentUserResult%3ATypeAlias This snippet shows the TypeScript type definition for the result of the Get Current User API endpoint. ```APIDOC ## GET /users/@me ### Description Retrieves the current user's profile. ### Method GET ### Endpoint /users/@me ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **APIUser** (object) - The user object. ### Response Example ```json { "id": "123456789012345678", "username": "exampleUser", "discriminator": "1234", "public_flags": 1, "flags": 0, "locale": "en-US", "mfa_enabled": false, "premium_type": 0 } ``` ``` -------------------------------- ### WelcomeScreen Class Source: https://discord.js.org/docs/packages/discord.js/14.26.4/WelcomeScreen%3AClass Represents a welcome screen configuration for a Discord guild. It includes properties for the client, description, enabled status, guild, and welcome channels. ```APIDOC ## Class: WelcomeScreen Represents a welcome screen. ### Properties * **client** (Client): The client that instantiated this WelcomeScreen. * **description** (string | null): The description of this welcome screen. * **enabled** (boolean): Whether the welcome screen is enabled on the guild. * **guild** (Guild | InviteGuild): The guild associated with this welcome screen. * **welcomeChannels** (Collection): A collection of welcome channels belonging to this welcome screen. ### Methods * **toJSON(...props: Record[]): unknown** Inherited from Base. * **valueOf(): string** Inherited from Base. ``` -------------------------------- ### Activity Start Timestamp Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/GatewayActivityTimestamps%3AInterface Represents the Unix time in milliseconds when an activity started. This is an optional field within the GatewayActivityTimestamps interface. ```typescript start? : number ``` -------------------------------- ### REST GET Request Source: https://discord.js.org/docs/packages/discord.js/14.26.4/REST%3AClass Executes a GET request to a specified API route. This is commonly used for fetching data from the Discord API. ```typescript get(fullRoute: RouteLike, options?: RequestData): Promise ``` -------------------------------- ### connect Source: https://discord.js.org/docs/packages/discord.js/14.26.4/WorkerShardingStrategy%3AClass Initializes all the WebSocket shards managed by this strategy. ```APIDOC ## connect() ### Description Initializes all the shards. ### Method `connect` ### Returns * `Promise` - A promise that resolves when all shards have been initialized. ``` -------------------------------- ### RGB Array Color Example Source: https://discord.js.org/docs/packages/discord.js/14.26.4/ColorResolvable%3ATypeAlias An example of specifying a color using an RGB array. This format is useful for custom color values. ```javascript [255, 0, 255] // purple ``` -------------------------------- ### fetchWelcomeScreen Source: https://discord.js.org/docs/packages/discord.js/14.26.4/Guild%3AClass Fetches the guild's welcome screen configuration. This provides details about the channels and messages shown to new members. ```APIDOC ## fetchWelcomeScreen ### Description Fetches the welcome screen for this guild. ### Method GET ### Endpoint `/guilds/{guild.id}/welcome-screen` ### Response #### Success Response (200) - **WelcomeScreen** - The welcome screen object. ``` -------------------------------- ### WelcomeChannelData Interface Source: https://discord.js.org/docs/packages/discord.js/14.26.4/WelcomeChannelData%3AInterface Represents the data structure for configuring a welcome channel, including the target channel, a description, and an optional emoji. ```APIDOC ## Interface: WelcomeChannelData ### Description Represents the data structure for configuring a welcome channel. This includes the channel to link, a description to display, and an optional emoji. ### Properties - **channel** (TextChannel | NewsChannel | ForumChannel | MediaChannel | Snowflake) - Required - The channel to link for this welcome channel. - **description** (string) - Required - The description to show for this welcome channel. - **emoji** (EmojiIdentifierResolvable) - Optional - The emoji to display for this welcome channel. ``` -------------------------------- ### lastKey() Source: https://discord.js.org/docs/packages/discord.js/14.26.4/Collection%3AClass Obtains the last key(s) in this collection. Returns a single key if no amount is provided or an array of keys, starting from the start if amount is negative. ```APIDOC ## lastKey() : K | undefined ### Description Obtains the last key(s) in this collection. ### Returns A single key if no amount is provided or an array of keys, starting from the start if amount is negative. ``` -------------------------------- ### last() Source: https://discord.js.org/docs/packages/discord.js/14.26.4/Collection%3AClass Obtains the last value(s) in this collection. Returns a single value if no amount is provided or an array of values, starting from the start if amount is negative. ```APIDOC ## last() : V | undefined ### Description Obtains the last value(s) in this collection. ### Returns A single value if no amount is provided or an array of values, starting from the start if amount is negative. ``` -------------------------------- ### WelcomeScreenEditOptions Source: https://discord.js.org/docs/packages/discord.js/14.26.4/WelcomeScreenEditOptions%3AInterface Represents the options available for editing a welcome screen. This includes setting a description, enabling/disabling the screen, and configuring welcome channels. ```APIDOC ## Interface: WelcomeScreenEditOptions ### Description Options for editing a welcome screen. ### Properties #### description - **description** (string) - Optional - The description for the welcome screen. #### enabled - **enabled** (boolean) - Optional - Whether the welcome screen is enabled. #### welcomeChannels - **welcomeChannels** (readonly WelcomeChannelData[]) - Optional - The welcome channel data for the welcome screen. ``` -------------------------------- ### Get Application Command Route Source: https://discord.js.org/docs/packages/discord.js/14.26.4/RoutesDeclarations%3AInterface Defines the route for retrieving a specific application command. Used for GET, PATCH, and DELETE operations on a single command. ```typescript applicationCommand( applicationId: Snowflake, commandId: Snowflake ) : `/applications/${string}/commands/${string}` ``` -------------------------------- ### TypingStart Event Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/GatewayDispatchEvents%3AEnum Fired when a user starts typing in a channel. Use this to display typing indicators. ```typescript TypingStart = "TYPING_START" ``` -------------------------------- ### REST Get Current User Guild Member Result Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/RESTGetCurrentUserGuildMemberResult%3ATypeAlias Defines the result type for the Get Current User Guild Member API endpoint. ```APIDOC ## GET /users/@me/guilds/{guild.id}/member ### Description Retrieves the current user's guild member object for a specific guild. ### Method GET ### Endpoint `/users/@me/guilds/{guild.id}/member` ### Parameters #### Path Parameters - **guild.id** (snowflake) - Required - The ID of the guild to get the member information for. ### Response #### Success Response (200) - **APIGuildMember** (object) - The guild member object. ### See Also - https://discord.com/developers/docs/resources/user#get-current-user-guild-member - APIGuildMember ``` -------------------------------- ### Get Specific Application Emoji Route Source: https://discord.js.org/docs/packages/discord.js/14.26.4/RoutesDeclarations%3AInterface Defines the route for retrieving, updating, or deleting a specific application emoji. Supports GET, PATCH, and DELETE operations. ```typescript applicationEmoji( applicationId: Snowflake, emojiId: Snowflake ) : `/applications/${string}/emojis/${string}` ``` -------------------------------- ### APIGuildWelcomeScreen Interface Source: https://discord.js.org/docs/packages/discord.js/14.26.4/APIGuildWelcomeScreen%3AInterface Represents the welcome screen configuration for a Discord guild. It includes a short welcome message and an array of suggested channels. ```APIDOC ## Interface: APIGuildWelcomeScreen ### Description Represents the welcome screen configuration for a Discord guild. It includes a short welcome message and an array of suggested channels. ### Properties - **description** (string | null) - The welcome screen short message. - **welcome_channels** (APIGuildWelcomeScreenChannel[]) - Array of suggested channels. ``` -------------------------------- ### create Source: https://discord.js.org/docs/packages/discord.js/14.26.4/GuildSoundboardSoundManager%3AClass Creates a new guild soundboard sound. You can provide a file path and a name for the new sound. ```APIDOC ## create Creates a new guild soundboard sound. ### Method POST ### Endpoint `/guilds/:guild/soundboard-sounds` ### Parameters #### Path Parameters - **guild** (Snowflake) - Required - The ID of the guild to create the sound in. #### Request Body - **file** (BufferResolvable) - Required - The sound file to upload. - **name** (string) - Required - The name of the sound. - **reason** (string) - Optional - The reason for creating the sound. ### Request Example ```javascript guild.soundboardSounds.create({ file: './sound.mp3', name: 'sound' }) .then(sound => console.log(`Created new soundboard sound with name ${sound.name}!`)) .catch(console.error); ``` ### Response #### Success Response (200) - **GuildSoundboardSound** - The created soundboard sound. ``` -------------------------------- ### Get Guild Application Commands Permissions Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/RESTGetAPIGuildApplicationCommandsPermissionsResult%3ATypeAlias This snippet defines the TypeScript type for the result of the `GET /guild/{guild.id}/commands/permissions` endpoint, which returns an array of `APIGuildApplicationCommandPermissions`. ```APIDOC ## GET /guild/{guild.id}/commands/permissions ### Description Retrieves the permissions for all application commands in a guild. ### Method GET ### Endpoint `/guild/{guild.id}/commands/permissions` ### Parameters #### Path Parameters - **guild.id** (snowflake) - Required - The ID of the guild to get permissions for. ### Response #### Success Response (200) - **APIGuildApplicationCommandPermissions[]** - An array of objects representing the permissions for application commands in the guild. ### Response Example ```json [ { "id": "123456789012345678", "type": 1, "permissions": [ { "type": 1, "id": "987654321098765432", "permission": true } ] } ] ``` See also: https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions ``` -------------------------------- ### Get Thread Member Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/RESTGetAPIChannelThreadMemberResult%3ATypeAlias This snippet defines the TypeScript type for the result of the Get Thread Member API endpoint. It indicates that the result conforms to the APIThreadMember structure. ```APIDOC ## GET /channels/{channel.id}/thread-members/{user.id} ### Description Retrieves a thread member from a channel. ### Method GET ### Endpoint `/channels/{channel.id}/thread-members/{user.id}` ### Parameters #### Path Parameters - **channel.id** (snowflake) - Required - The ID of the channel the thread is in. - **user.id** (snowflake) - Required - The ID of the user to retrieve. ### Response #### Success Response (200) - **APIThreadMember** (object) - The thread member object. #### Response Example ```json { "id": "123456789012345678", "username": "ExampleUser", "avatar": "a_hash", "discriminator": "0001", "public_flags": 1, "flags": 0, "bot": false, "guild_id": "987654321098765432", "joined_at": "2021-01-01T00:00:00.000Z", "permissions": "0", "timeout_until": null } ``` See also: https://discord.com/developers/docs/resources/channel#get-thread-member ``` -------------------------------- ### WebhookClient Constructor Source: https://discord.js.org/docs/packages/discord.js/14.26.4/WebhookClient%3AClass Instantiates a new WebhookClient. **Parameters:** * `data`: The data to construct the client with. This should be a `WebhookClientData` object. * `options`: Optional. Options for the webhook client. ```APIDOC ## constructor(data: WebhookClientData, options?: WebhookClientOptions) Instantiates a new WebhookClient. **Parameters:** * `data`: The data to construct the client with. This should be a `WebhookClientData` object. * `options`: Optional. Options for the webhook client. ``` -------------------------------- ### Start Thread in Forum Channel Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/RESTPostAPIGuildForumThreadsFormDataBody%3ATypeAlias This endpoint is used to start a new thread in a forum or media channel. It requires a message to be provided, which will be the first message in the thread. ```APIDOC ## POST /channels/{channel.id}/threads ### Description Starts a new thread in a forum or media channel. ### Method POST ### Endpoint `/channels/{channel.id}/threads` ### Parameters #### Path Parameters - **channel.id** (snowflake) - Required - The ID of the channel to create the thread in. #### Request Body - **message** (string) - Required - The content of the first message in the thread. - **name** (string) - Required - The name of the thread. - **auto_archive_duration** (integer) - Optional - Duration in minutes after which the thread is automatically archived. Defaults to 60. - **rate_limit_per_user** (integer) - Optional - Amount of seconds a user has to wait before sending another message. Set to 0 to disable. ### Request Example ```json { "message": "This is the first message in the thread.", "name": "New Discussion", "auto_archive_duration": 1440 } ``` ### Response #### Success Response (201) - **id** (snowflake) - The ID of the created thread. - **name** (string) - The name of the thread. - **type** (integer) - The type of the channel. - **last_message_id** (snowflake) - The ID of the last message in the thread. - **rate_limit_per_user** (integer) - Amount of seconds a user has to wait before sending another message. - **channel_id** (snowflake) - The ID of the channel the thread belongs to. - **owner_id** (snowflake) - The ID of the user who created the thread. - **thread_metadata** (object) - The metadata of the thread. - **archived** (boolean) - Whether the thread is archived. - **archive_timestamp** (ISO8601 timestamp) - Timestamp when the thread was archived. - **auto_archive_duration** (integer) - Duration in minutes after which the thread is automatically archived. - **locked** (boolean) - Whether the thread is locked. #### Response Example ```json { "id": "123456789012345678", "name": "New Discussion", "type": 15, "last_message_id": null, "rate_limit_per_user": 0, "channel_id": "098765432109876543", "owner_id": "112233445566778899", "thread_metadata": { "archived": false, "archive_timestamp": "2023-01-01T12:00:00.000Z", "auto_archive_duration": 1440, "locked": false } } ``` ``` -------------------------------- ### Start Thread from Message Source: https://discord.js.org/docs/packages/discord-api-types/0.38.40/v10/RESTPostAPIChannelMessagesThreadsResult%3ATypeAlias This snippet shows the TypeScript type definition for the result of starting a thread from an existing message. It indicates that the operation returns an APIChannel object. ```APIDOC ## POST /channels/{channel.id}/messages/{message.id}/threads ### Description Starts a new thread from an existing message. The message must be in a guild with the `THREAD_CHANNEL_MEMBERSHIP` feature enabled. ### Method POST ### Endpoint `/channels/{channel.id}/messages/{message.id}/threads` ### Parameters #### Path Parameters - **channel.id** (snowflake) - Required - The ID of the channel to create the thread in. - **message.id** (snowflake) - Required - The ID of the message to create the thread from. #### Query Parameters - **name** (string) - Required - The name of the thread (1-100 characters). - **auto_archive_duration** (integer) - Optional - Duration in minutes after which the thread is automatically archived. One of `60`, `1440`, `4320`, `10080`. - **rate_limit_per_user** (integer) - Optional - The rate limit per user for the thread in seconds. Defaults to 0. ### Request Body This endpoint does not require a request body. ### Response #### Success Response (200 OK) - **RESTPostAPIChannelMessagesThreadsResult** (APIChannel) - The created thread object. #### Response Example ```json { "id": "123456789012345678", "guild_id": "987654321098765432", "name": "My New Thread", "type": 10, "last_message_id": null, "rate_limit_per_user": 0, "position": 0, "topic": null, "last_pin_timestamp": null, "default_auto_archive_duration": 60, "flags": 0, "member_count": 2, "is_archived": false, "is_private": false, "created_timestamp": "2023-10-27T10:00:00.000Z" } ``` ### See Also - [Discord API Documentation](https://discord.com/developers/docs/resources/channel#start-thread-from-message) - [APIChannel Type](https://discord.com/developers/docs/resources/channel#channel-object-channel-structure) ``` -------------------------------- ### GuildOnboardingPromptOption Properties Source: https://discord.js.org/docs/packages/discord.js/14.26.4/GuildOnboardingPromptOption%3AClass Represents the data of an option from a prompt of a guild's onboarding. ```APIDOC ## Class: GuildOnboardingPromptOption Represents the data of an option from a prompt of a guild's onboarding. ### Properties * **channels**: Collection The channels a member is added to when the option is selected. * **client**: Client The client that instantiated this. *Inherited from: Base* * **description**: string | null The description of the option. * **emoji**: Emoji | GuildEmoji | null The emoji of this onboarding prompt option. * **guild**: Guild The guild this onboarding prompt option is from. * **guildId**: Snowflake The id of the guild this onboarding prompt option is from. * **id**: Snowflake The id of the option. * **roles**: Collection The roles assigned to a member when the option is selected. * **title**: string The title of the option. ### Methods * **toJSON(...props: Record[])**: unknown *Inherited from: Base* * **valueOf()**: string *Inherited from: Base* ``` -------------------------------- ### BaseGuildVoiceChannel Constructor Source: https://discord.js.org/docs/packages/discord.js/14.26.4/BaseGuildVoiceChannel%3AClass Initializes a new instance of the BaseGuildVoiceChannel class. ```APIDOC ## constructor(guild: Guild, data?: RawGuildChannelData) Constructs a new instance of the `BaseGuildVoiceChannel` class. ```