### Install oceanic.js development build Source: https://docs.oceanic.ws/v1.15.0 Install the development build of oceanic.js. The documentation under `dev` is always for the latest commit. ```bash npm i https://pkg.pr.new/oceanic.js@dev ``` -------------------------------- ### typingStart Source: https://docs.oceanic.ws/v1.15.0/interfaces/ClientEvents.html Emitted when a user starts typing. Provides the channel, user or member, and the start timestamp. ```APIDOC ## typingStart ### Description Emitted when a user starts typing. ### Arguments - **channel** (PrivateChannel | Uncached | AnyTextableGuildChannel | Uncached) - The channel where typing started. - **user** (User | Uncached) or **member** (Member) - The user or member who started typing. - **startTimestamp** (Date) - The timestamp when typing started. ``` -------------------------------- ### get Source: https://docs.oceanic.ws/v1.15.0/classes/REST_Lobbies.html Get a lobby. ```APIDOC ## get ### Description Get a lobby. ### Method get ### Parameters - **lobbyID** (string) - Required - The ID of the lobby to retrieve. ### Returns Promise ``` -------------------------------- ### get mention() Source: https://docs.oceanic.ws/v1.15.0/classes/Channel.html Gets a string that will mention this channel. ```APIDOC ## get mention() ### Description Gets a string that will mention this channel. ### Returns string ``` -------------------------------- ### startThread Source: https://docs.oceanic.ws/v1.15.0/classes/MediaChannel.html Starts a thread in the media channel. ```APIDOC ## startThread ### Description Starts a thread in this media channel. ``` -------------------------------- ### getEventListeners: Retrieve listeners from EventEmitter and EventTarget Source: https://docs.oceanic.ws/v1.15.0/classes/Client.html Shows how to use getEventListeners to get a copy of the listeners for an event on both an EventEmitter and an EventTarget. For EventTarget, this is the only way to retrieve listeners. The example logs the listener array for each. ```javascript import { getEventListeners, EventEmitter } from 'node:events'; { const ee = new EventEmitter(); const listener = () => console.log('Events are fun'); ee.on('foo', listener); getEventListeners(ee, 'foo'); // [listener] } { const et = new EventTarget(); const listener = () => console.log('Events are fun'); et.addEventListener('foo', listener); getEventListeners(et, 'foo'); // [listener] } ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/Soundboard.html Creates a new Soundboard instance. ```APIDOC ## constructor ### Description Creates a new Soundboard instance. ### Parameters - **data** (RawSoundboard) - Required - The raw soundboard data. - **client** (Client) - Required - The client instance. ### Returns Soundboard ``` -------------------------------- ### listenerCount: Count listeners for an event on an EventEmitter Source: https://docs.oceanic.ws/v1.15.0/classes/Client.html Shows how to use the static listenerCount method to get the number of listeners registered for a given event name on an EventEmitter. The example registers two listeners for 'event' and prints 2. ```javascript import { EventEmitter, listenerCount } from 'node:events'; const myEmitter = new EventEmitter(); myEmitter.on('event', () => {}); myEmitter.on('event', () => {}); console.log(listenerCount(myEmitter, 'event')); // Prints: 2 ``` -------------------------------- ### new Client(options?) Source: https://docs.oceanic.ws/v1.15.0/classes/Client.html Creates a new Client instance with optional client options. ```APIDOC ## new Client(options?) ### Description Creates a new Client instance with the provided options. ### Constructor `new Client(options?)` ### Parameters - `options` (ClientOptions) - Optional - The options to create the client with. ### Returns `Client` ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/ClientApplication.html Constructs a new ClientApplication instance with the provided raw data and client. ```APIDOC ## constructor ### Description Creates a new ClientApplication instance. ### Parameters - **data** (RawClientApplication) - Required - The raw application data. - **client** (Client) - Required - The client instance. ### Returns ClientApplication ``` -------------------------------- ### getGuildCommand Source: https://docs.oceanic.ws/v1.15.0/classes/Application.html Gets a global application command. ```APIDOC ## getGuildCommand ### Description Get a global application command. ### Method SDK Method ### Endpoint getGuildCommand(guildID, commandID, options?): Promise ### Parameters #### Path Parameters - **guildID** (string) - Required - The ID of the guild. - **commandID** (string) - Required - The ID of the command. #### Query Parameters - **options** (GetApplicationCommandOptions) - Optional - The options for getting the command. ### Returns Promise ``` -------------------------------- ### get(key) Source: https://docs.oceanic.ws/v1.15.0/classes/ShardManager.html Gets a shard by key. ```APIDOC ## get(key) ### Description Gets a shard by key. ### Parameters - **key** (number) - Required - The key of the shard to get. ### Returns Shard | undefined - The shard, or undefined if not found. ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/SKU.html Creates a new SKU instance with the provided data and client. ```APIDOC ## constructor ### Description Creates a new SKU instance. ### Method constructor ### Parameters - **data** (RawSKU) - Required - The raw SKU data. - **client** (Client) - Required - The client instance. ### Returns SKU ``` -------------------------------- ### get(channelID) Source: https://docs.oceanic.ws/v1.15.0/classes/REST_Channels.html Gets a channel by its ID. ```APIDOC ## get(channelID) ### Description Gets a channel by its ID. ### Method get ### Parameters - **channelID** (string) - Required - The ID of the channel to get. ### Returns Promise ### Caching This method **may** cache its result. The result will not be cached if the guild is not cached. ### Caches Guild#channels, Guild#threads, Client#privateChannels, Client#groupChannels ``` -------------------------------- ### getOnboarding Source: https://docs.oceanic.ws/v1.15.0/classes/Guild.html Retrieves the onboarding information for the guild. ```APIDOC ## getOnboarding ### Description Get the onboarding information for this guild. ### Method Promise ### Parameters None ### Returns Promise ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/Util.html Creates a new Util instance. ```APIDOC ## constructor ### Description Creates a new Util instance. ### Method constructor ### Parameters - **client** (Client) - Required - The client instance. ### Returns Util ``` -------------------------------- ### get channel() Source: https://docs.oceanic.ws/v1.15.0/classes/ModalSubmitInteraction.html Gets the channel this interaction was sent from. ```APIDOC ## get channel() ### Description Gets the channel this interaction was sent from. ### Returns T extends AnyInteractionChannel ? T : undefined ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/Channel.html Creates a new Channel instance. ```APIDOC ## new Channel(data, client) ### Description Creates a new Channel instance. ### Parameters - **data** (RawChannel) - Required - The raw channel data. - **client** (Client) - Required - The client instance. ### Returns Channel ``` -------------------------------- ### get deny() Source: https://docs.oceanic.ws/v1.15.0/classes/PermissionOverwrite.html Gets the denied permissions as a bigint. ```APIDOC ## get deny() ### Description Gets the denied permissions as a bigint. ### Accessor `get deny(): bigint` ### Returns - **bigint** - The denied permissions. ``` -------------------------------- ### get createdAt() Source: https://docs.oceanic.ws/v1.15.0/classes/PermissionOverwrite.html Gets the creation date of the overwrite. ```APIDOC ## get createdAt() ### Description Gets the creation date of the overwrite. ### Accessor `get createdAt(): Date` ### Returns - **Date** - The creation date. ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/Invite.html Creates a new Invite instance with the provided raw data and client. ```APIDOC ## constructor ### Description Creates a new Invite instance. ### Method constructor ### Signature `new Invite(data, client): Invite` ### Type Parameters - `CH extends InviteChannel = InviteChannel` ### Parameters - `data` (RawInvite) - Required - The raw invite data. - `client` (Client) - Required - The client instance. ### Returns `Invite` ``` -------------------------------- ### get allow() Source: https://docs.oceanic.ws/v1.15.0/classes/PermissionOverwrite.html Gets the allowed permissions as a bigint. ```APIDOC ## get allow() ### Description Gets the allowed permissions as a bigint. ### Accessor `get allow(): bigint` ### Returns - **bigint** - The allowed permissions. ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/VoiceChannel.html Creates a new VoiceChannel instance. ```APIDOC ## constructor ### Description Creates a new VoiceChannel instance. ### Method constructor ### Parameters - **data** (RawVoiceChannel) - Required - The raw channel data. - **client** (Client) - Required - The client instance. ### Returns VoiceChannel ``` -------------------------------- ### get guild() Source: https://docs.oceanic.ws/v1.15.0/classes/GuildJoinRequest.html Gets the guild this join request is for. ```APIDOC ## ACCESSOR ### Name get guild() ### Description The guild this join request is for. ### Returns - **Guild** - The guild. ``` -------------------------------- ### get headers() Source: https://docs.oceanic.ws/v1.15.0/classes/DiscordRESTError.html Gets the HTTP headers of the response. ```APIDOC ## Accessor ### get headers() Returns the HTTP headers of the response. #### Returns - **Headers** - The response headers. ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/Webhook.html Creates a new Webhook instance. ```APIDOC ## new Webhook(data, client) ### Description Creates a new Webhook instance. ### Parameters - **data** (RawWebhook) - Required - The raw webhook data. - **client** (Client) - Required - The client instance. ### Returns - **Webhook** - The created Webhook instance. ``` -------------------------------- ### ready Source: https://docs.oceanic.ws/v1.15.0/interfaces/ClientEvents.html Emitted when the client is ready. No arguments are provided. ```APIDOC ## ready ### Description Emitted when the client is ready. ### Arguments None. ``` -------------------------------- ### get statusText Source: https://docs.oceanic.ws/v1.15.0/classes/DiscordHTTPError.html Gets the HTTP status text. ```APIDOC ## get statusText ### Description Returns the HTTP status text. ### Method get ### Returns string ``` -------------------------------- ### get status Source: https://docs.oceanic.ws/v1.15.0/classes/DiscordHTTPError.html Gets the HTTP status code. ```APIDOC ## get status ### Description Returns the HTTP status code. ### Method get ### Returns number ``` -------------------------------- ### new PartialApplication(data, client) Source: https://docs.oceanic.ws/v1.15.0/classes/PartialApplication.html Constructs a new PartialApplication instance with the provided raw data and client. ```APIDOC ## new PartialApplication(data, client) ### Description Creates a new PartialApplication instance. ### Constructor `new PartialApplication(data, client)` ### Parameters - **data** (RawPartialApplication) - Required - The raw data for the partial application. - **client** (Client) - Required - The client instance. ### Returns PartialApplication ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/OAuthGuild.html Creates a new OAuthGuild instance. ```APIDOC ## Constructor ### new OAuthGuild(data, client) Creates a new OAuthGuild instance. #### Parameters - **data** (RawOAuthGuild) - Required - The raw OAuth guild data. - **client** (Client) - Required - The client instance. #### Returns - **OAuthGuild** - The new OAuthGuild instance. ``` -------------------------------- ### get path Source: https://docs.oceanic.ws/v1.15.0/classes/DiscordHTTPError.html Gets the path of the HTTP request. ```APIDOC ## get path ### Description Returns the path of the HTTP request. ### Method get ### Returns string ``` -------------------------------- ### get headers Source: https://docs.oceanic.ws/v1.15.0/classes/DiscordHTTPError.html Gets the headers of the HTTP response. ```APIDOC ## get headers ### Description Returns the headers of the HTTP response. ### Method get ### Returns Headers ``` -------------------------------- ### InstallParams Source: https://docs.oceanic.ws/v1.15.0/interfaces/Types_OAuth.InstallParams.html Interface defining the parameters for an OAuth installation, including required permissions and scopes. ```APIDOC ## InstallParams ### Description Interface representing the parameters for installing an OAuth application. ### Properties #### permissions - **Type**: Array of permission strings - **Required**: Yes - **Description**: The permissions the application requests. Each permission is a string from the Discord permission flags. #### scopes - **Type**: Array of strings - **Required**: Yes - **Description**: The OAuth2 scopes the application requests. ### Example ```typescript interface InstallParams { permissions: ("CREATE_INSTANT_INVITE" | "KICK_MEMBERS" | "BAN_MEMBERS" | "ADMINISTRATOR" | "MANAGE_CHANNELS" | "MANAGE_GUILD" | "ADD_REACTIONS" | "VIEW_AUDIT_LOG" | "PRIORITY_SPEAKER" | "STREAM" | "VIEW_CHANNEL" | "SEND_MESSAGES" | "SEND_TTS_MESSAGES" | "MANAGE_MESSAGES" | "EMBED_LINKS" | "ATTACH_FILES" | "READ_MESSAGE_HISTORY" | "MENTION_EVERYONE" | "USE_EXTERNAL_EMOJIS" | "VIEW_GUILD_INSIGHTS" | "CONNECT" | "SPEAK" | "MUTE_MEMBERS" | "DEAFEN_MEMBERS" | "MOVE_MEMBERS" | "USE_VAD" | "CHANGE_NICKNAME" | "MANAGE_NICKNAMES" | "MANAGE_ROLES" | "MANAGE_WEBHOOKS" | "MANAGE_GUILD_EXPRESSIONS" | "USE_APPLICATION_COMMANDS" | "REQUEST_TO_SPEAK" | "MANAGE_EVENTS" | "MANAGE_THREADS" | "CREATE_PUBLIC_THREADS" | "CREATE_PRIVATE_THREADS" | "USE_EXTERNAL_STICKERS" | "SEND_MESSAGES_IN_THREADS" | "USE_EMBEDDED_ACTIVITIES" | "MODERATE_MEMBERS" | "VIEW_CREATOR_MONETIZATION_ANALYTICS" | "USE_SOUNDBOARD" | "CREATE_GUILD_EXPRESSIONS" | "CREATE_EVENTS" | "USE_EXTERNAL_SOUNDS" | "SEND_VOICE_MESSAGES" | "USE_CLYDE_AI" | "SET_VOICE_CHANNEL_STATUS" | "SEND_POLLS" | "USE_EXTERNAL_APPS" | "PIN_MESSAGES" | "BYPASS_SLOWMODE" | "MANAGE_OFFICIAL_MESSAGES")[]; scopes: string[]; } ``` ``` -------------------------------- ### get createdAt() Source: https://docs.oceanic.ws/v1.15.0/classes/Channel.html Gets the creation date of this channel. ```APIDOC ## get createdAt() ### Description Gets the creation date of this channel. ### Returns Date ``` -------------------------------- ### TYPING_START(data, shard): Promise Source: https://docs.oceanic.ws/v1.15.0/functions/TYPING_START.html The TYPING_START function handles the typing start event. It takes a data object containing channel and user information, and a shard object, and returns a Promise that resolves to void. ```APIDOC ## TYPING_START(data, shard): Promise ### Description Handles the typing start event. ### Parameters - **data** (object) - Required - The data object containing typing event details. - **channel_id** (string) - Required - The ID of the channel where typing occurred. - **guild_id** (string) - Optional - The ID of the guild where typing occurred. - **member** (RawMember) - Optional - The member who started typing. - **timestamp** (number) - Required - The timestamp of the typing event. - **user_id** (string) - Required - The ID of the user who started typing. - **shard** (Shard) - Required - The shard associated with the event. ### Returns - **Promise** - A promise that resolves when the operation is complete. ``` -------------------------------- ### get createdAt() Source: https://docs.oceanic.ws/v1.15.0/classes/GuildJoinRequest.html Gets the creation date of the join request. ```APIDOC ## ACCESSOR ### Name get createdAt() ### Description When the join request was created. ### Returns - **Date** - The creation date. ``` -------------------------------- ### launchActivity Source: https://docs.oceanic.ws/v1.15.0/classes/CommandInteraction.html Launches the bot's activity as an initial response. ```APIDOC ## launchActivity ### Description Launch the bot's activity. This is an initial response, and more than one initial response cannot be used. ### Method Promise> ### Returns Promise> ``` -------------------------------- ### get mention(): string Source: https://docs.oceanic.ws/v1.15.0/classes/ExtendedUser.html Gets a string that will mention this user. ```APIDOC ## get mention(): string ### Description Gets a string that will mention this user. ### Returns - **Type**: string ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/PrimaryGuild.html Creates a new PrimaryGuild instance with the provided data and client. ```APIDOC ## constructor ### Description Creates a new PrimaryGuild instance. ### Method constructor ### Endpoint new PrimaryGuild(data, client) ### Parameters #### Path Parameters - **data** (RawClan) - Required - The raw data for the primary guild. - **client** (Client) - Required - The client instance. ### Returns PrimaryGuild ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/CategoryChannel.html Creates a new CategoryChannel instance. ```APIDOC ## constructor ### Description Creates a new CategoryChannel instance. ### Method constructor ### Parameters - **data** (RawCategoryChannel) - Required - The raw category channel data. - **client** (Client) - Required - The client instance. ### Returns CategoryChannel ``` -------------------------------- ### get createdAt(): Date Source: https://docs.oceanic.ws/v1.15.0/classes/ExtendedUser.html Gets the creation date of this user. ```APIDOC ## get createdAt(): Date ### Description Gets the creation date of this user. ### Returns - **Type**: Date ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/GuildPreview.html Creates a new GuildPreview instance. ```APIDOC ## constructor ### Description Creates a new GuildPreview instance. ### Method constructor ### Parameters - **data** (RawGuildPreview) - Required - The raw guild preview data. - **client** (Client) - Required - The client instance. ### Returns GuildPreview ``` -------------------------------- ### get statusText() Source: https://docs.oceanic.ws/v1.15.0/classes/DiscordRESTError.html Gets the HTTP status text of the response. ```APIDOC ## Accessor ### get statusText() Returns the HTTP status text. #### Returns - **string** - The HTTP status text. ``` -------------------------------- ### get status() Source: https://docs.oceanic.ws/v1.15.0/classes/DiscordRESTError.html Gets the HTTP status code of the response. ```APIDOC ## Accessor ### get status() Returns the HTTP status code. #### Returns - **number** - The HTTP status code. ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/REST_Webhooks.html Creates a new Webhooks instance. ```APIDOC ## constructor ### Description Creates a new Webhooks instance. ### Method constructor ### Endpoint new Webhooks(manager) ### Parameters #### Path Parameters - **manager** (RESTManager) - Required - The REST manager. ### Returns REST/Webhooks ``` -------------------------------- ### RawOnboardingPrompt Source: https://docs.oceanic.ws/v1.15.0/interfaces/Types_Guilds.RawOnboardingPrompt.html The RawOnboardingPrompt interface defines the structure of an onboarding prompt. It includes the prompt's ID, title, options, and flags indicating whether it is required, single-select, or part of onboarding. ```APIDOC ## RawOnboardingPrompt ### Description Interface for an onboarding prompt. ### Properties - **id** (string) - The identifier of the prompt. - **in_onboarding** (boolean) - Whether the prompt is shown during onboarding. - **options** (RawOnboardingPromptOption[]) - The options available for the prompt. - **required** (boolean) - Whether the prompt is required. - **single_select** (boolean) - Whether the prompt allows only one selection. - **title** (string) - The title of the prompt. ``` -------------------------------- ### get path() Source: https://docs.oceanic.ws/v1.15.0/classes/DiscordRESTError.html Gets the request path that caused the error. ```APIDOC ## Accessor ### get path() Returns the request path. #### Returns - **string** - The request path. ``` -------------------------------- ### mention(sub?) Source: https://docs.oceanic.ws/v1.15.0/classes/ApplicationCommand.html Gets a mention for this command. ```APIDOC ## GET mention ### Description Gets a mention for this command. ### Method GET ### Endpoint mention ### Parameters #### Query Parameters - **sub** ([subcommand: string] | [subcommandGroup: string, subcommand: string]) - Optional - The subcommand group and/or subcommand to include (["subcommand"] or ["subcommand-group", "subcommand"]). ### Returns - **string** - The mention string. ``` -------------------------------- ### SequentialBucket Source: https://docs.oceanic.ws/v1.15.0/classes/SequentialBucket.html Documentation for the SequentialBucket class, including its constructor, properties, and queue method. ```APIDOC ## Class SequentialBucket ### Description A ratelimit bucket. ### Constructor #### new SequentialBucket(limit, latencyRef) ##### Parameters - **limit** (number) - Required - The limit for the bucket. - **latencyRef** (LatencyRef) - Required - A reference to the latency. ##### Returns - **SequentialBucket** - A new SequentialBucket instance. ### Properties - **last** (number) - The last recorded value. - **latencyRef** (LatencyRef) - A reference to the latency. - **limit** (number) - The limit for the bucket. - **processing** (boolean | Timeout) - Default: `false` - Indicates whether the bucket is currently processing. - **remaining** (number) - The remaining number of requests allowed. - **reset** (number) - The time when the bucket resets. ### Methods #### queue(func, priority?) Add an item to the queue. ##### Parameters - **func** (function) - Required - The function to queue. The function receives a callback `cb` that must be called when the operation completes. - **cb** (function) - A callback function that signals completion. - **priority** (boolean) - Optional - Default: `false` - Whether the item should be queued with priority. ##### Returns - **void** - This method does not return a value. ``` -------------------------------- ### get createdAt() Source: https://docs.oceanic.ws/v1.15.0/classes/Attachment.html Gets the creation date of the attachment from its ID. ```APIDOC ## get createdAt() ### Description Returns the creation date of the attachment. ### Returns - **Date** - The creation date. ``` -------------------------------- ### from Source: https://docs.oceanic.ws/v1.15.0/classes/AnnouncementChannel.html Creates an AnnouncementChannel from raw data. ```APIDOC ## from ### Description Creates an AnnouncementChannel from raw data. ### Method from ### Parameters - **data** (RawAnnouncementChannel) - Required - The raw data. - **client** (Client) - Required - The client instance. ### Returns AnnouncementChannel ``` -------------------------------- ### getPinsIterator(options?) Source: https://docs.oceanic.ws/v1.15.0/classes/AnnouncementChannel.html Gets an async iterator for getting pins in this channel. ```APIDOC ## getPinsIterator(options?) ### Description Get an async iterator for getting pins in this channel. ### Method getPinsIterator ### Parameters - **options** (GetChannelPinsIteratorOptions) - Optional - The options for getting pins. ### Returns MessagePinsIterator ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/PrivateChannel.html Creates a new PrivateChannel instance. ```APIDOC ## constructor ### Description Creates a new PrivateChannel instance. ### Parameters - **data** (RawPrivateChannel) - Required - The raw data for the channel. - **client** (Client) - Required - The client instance. ### Returns PrivateChannel ``` -------------------------------- ### get createdAt(): Date Source: https://docs.oceanic.ws/v1.15.0/classes/GuildScheduledEvent.html Gets the creation date of the scheduled event. ```APIDOC ## get createdAt(): Date ### Description Gets the creation date of the scheduled event. ### Returns - **Date** - The creation date. ``` -------------------------------- ### new User(data, client) Source: https://docs.oceanic.ws/v1.15.0/classes/User.html Creates a new User instance. This constructor is typically called internally by the library. ```APIDOC ## new User(data, client) ### Description Creates a new User instance with the provided raw data and client. ### Constructor `new User(data, client)` ### Parameters - **data** (RawUser) - Required - The raw user data. - **client** (Client) - Required - The client instance. ### Returns - **User** - The created User instance. ``` -------------------------------- ### get defaultAvatar(): number Source: https://docs.oceanic.ws/v1.15.0/classes/ExtendedUser.html Gets the default avatar value of this user. ```APIDOC ## get defaultAvatar(): number ### Description Gets the default avatar value of this user. ### Returns - **Type**: number ``` -------------------------------- ### get createdAt() Source: https://docs.oceanic.ws/v1.15.0/classes/AuditLogEntry.html Gets the creation date of the audit log entry. ```APIDOC ## Accessor: createdAt ### Description Gets the creation date of the audit log entry. ### Returns - **Date** ``` -------------------------------- ### from Source: https://docs.oceanic.ws/v1.15.0/classes/GroupChannel.html Static factory method to create a channel from raw data. ```APIDOC ## from(data, client): T ### Description Creates a channel instance from raw data. ### Type Parameters - **T** extends AnyChannel = AnyChannel ### Parameters - **data** (RawChannel) - Required - The raw channel data. - **client** (Client) - Required - The client instance. ### Returns - **T** - The created channel instance. ``` -------------------------------- ### create Source: https://docs.oceanic.ws/v1.15.0/classes/REST_Lobbies.html Create a new lobby. ```APIDOC ## create ### Description Create a new lobby. ### Method create ### Parameters - **options** (CreateLobbyOptions) - Optional - The options for creating the lobby. ### Returns Promise ### Caching This method **does not** cache its result. ``` -------------------------------- ### getPinsIterator(options?): MessagePinsIterator Source: https://docs.oceanic.ws/v1.15.0/classes/VoiceChannel.html Gets an async iterator for getting pins in this channel. ```APIDOC ### getPinsIterator(options?): MessagePinsIterator Gets an async iterator for getting pins in this channel. #### Parameters - **options** (GetChannelPinsIteratorOptions) - Optional - The options for getting pins. #### Returns MessagePinsIterator ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/TextableVoiceChannel.html Creates a new TextableVoiceChannel instance. ```APIDOC ## constructor ### Description Creates a new TextableVoiceChannel instance. ### Signature `new TextableVoiceChannel(data, client): TextableVoiceChannel` ### Type Parameters - `T extends AnyVoiceChannel = AnyVoiceChannel` ### Parameters - `data` (RawVoiceChannel | RawStageChannel) - The raw data for the channel. - `client` (Client) - The client instance. ### Returns `TextableVoiceChannel` ``` -------------------------------- ### getPinsIterator(options?): MessagePinsIterator Source: https://docs.oceanic.ws/v1.15.0/classes/PrivateChannel.html Gets an async iterator for getting pins in this channel. ```APIDOC ## GET getPinsIterator ### Description Gets an async iterator for getting pins in this channel. ### Method GET ### Endpoint getPinsIterator ### Parameters #### Query Parameters - **options** (GetChannelPinsIteratorOptions) - Optional - The options for getting pins. ### Returns - **MessagePinsIterator** - An async iterator for getting pins. ``` -------------------------------- ### get guild() Source: https://docs.oceanic.ws/v1.15.0/classes/ModalSubmitInteraction.html Gets the guild this interaction was sent from, if applicable. Throws an error if the guild is not cached. ```APIDOC ## get guild() ### Description Gets the guild this interaction was sent from, if applicable. Throws an error if the guild is not cached. ### Returns T extends AnyTextableGuildChannel ? Guild : null | Guild ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/Base.html Creates a new instance of the Base class with the given ID and client. ```APIDOC ## constructor ### Description Creates a new Base instance. ### Method constructor ### Parameters - **id** (string) - Required - The ID of the base entity. - **client** (Client) - Required - The client instance. ### Returns Base ``` -------------------------------- ### new ApplicationCommand(data, client): ApplicationCommand Source: https://docs.oceanic.ws/v1.15.0/classes/ApplicationCommand.html Creates a new ApplicationCommand instance. ```APIDOC ## new ApplicationCommand(data, client): ApplicationCommand ### Description Creates a new ApplicationCommand instance. ### Constructor `new ApplicationCommand(data, client): ApplicationCommand` ### Type Parameters - `T extends ApplicationCommandTypes = ApplicationCommandTypes` ### Parameters - **data** (`RawApplicationCommand`) - The raw data for the command. - **client** (`Client`) - The client instance. ### Returns `ApplicationCommand` ``` -------------------------------- ### get guild(): Guild Source: https://docs.oceanic.ws/v1.15.0/classes/GuildScheduledEvent.html Gets the guild this scheduled event belongs to. Throws an error if the guild is not cached. ```APIDOC ## get guild(): Guild ### Description Gets the guild this scheduled event belongs to. Throws an error if the guild is not cached. ### Returns - **Guild** - The guild. ``` -------------------------------- ### get clan(): null | PrimaryGuild Source: https://docs.oceanic.ws/v1.15.0/classes/ExtendedUser.html Gets the primary guild this user is in. Deprecated, use primaryGuild instead. ```APIDOC ## get clan(): null | PrimaryGuild ### Description Gets the primary guild this user is in. Deprecated, use primaryGuild instead. ### Returns - **Type**: null | PrimaryGuild ### Deprecated Use primaryGuild ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/OAuthApplication.html Creates a new OAuthApplication instance. ```APIDOC ## new OAuthApplication(data, client) ### Description Creates a new OAuthApplication instance. ### Parameters - **data** (RESTOAuthApplication) - Required - The data for the OAuth application. - **client** (Client) - Required - The client instance. ### Returns OAuthApplication ``` -------------------------------- ### get(webhookID, token?): Promise Source: https://docs.oceanic.ws/v1.15.0/classes/REST_Webhooks.html Gets a webhook by ID and optionally token. This method does not cache its result. ```APIDOC ## get(webhookID, token?): Promise ### Description Gets a webhook by ID (and optionally token). ### Method GET ### Endpoint /get ### Parameters #### Path Parameters - **webhookID** (string) - Required - The ID of the webhook. - **token** (string) - Optional - The token of the webhook. ### Response #### Success Response (200) - **Webhook** - The webhook object. #### Response Example { "id": "string", "token": "string" } ``` -------------------------------- ### CreatePrimaryEntryPointApplicationCommandOptions Source: https://docs.oceanic.ws/v1.15.0/interfaces/Types_Applications.CreatePrimaryEntryPointApplicationCommandOptions.html Interface for creating a primary entry point application command. ```APIDOC ## Interface CreatePrimaryEntryPointApplicationCommandOptions ### Description Options for creating a primary entry point application command. ### Properties #### `Optional` contexts - **Type**: `InteractionContextTypes[]` - **Description**: The interaction contexts where the command can be used. Defaults to all interaction context types for new commands. #### `Optional` defaultMemberPermissions - **Type**: `null | string` - **Description**: The default member permissions for the command. #### `Optional` dmPermission - **Type**: `null | boolean` - **Description**: If the command can be used in a DM. - **Deprecated**: Use contexts instead. #### handler - **Type**: `EntryPointCommandHandlerTypes` - **Description**: The handler for the entry point command. #### `Optional` id - **Type**: `string` - **Description**: The ID of the command, if known. (Only usable when bulkEditing guild commands.) #### `Optional` integrationTypes - **Type**: `ApplicationIntegrationTypes[]` - **Description**: The install contexts where the command is available. Defaults to GUILD_INSTALL. #### name - **Type**: `string` - **Description**: The name of the command. #### `Optional` nameLocalizations - **Type**: `null | Partial>` - **Description**: A dictionary of locales to localized names. #### `Optional` nsfw - **Type**: `boolean` - **Description**: Whether the command is age restricted. #### type - **Type**: `PRIMARY_ENTRY_POINT` - **Description**: The type of the command. ``` -------------------------------- ### voiceChannelStartTimeUpdate Source: https://docs.oceanic.ws/v1.15.0/interfaces/ClientEvents.html Emitted when the start time of a voice channel is updated. Provides the guild, channel, and the new start time. ```APIDOC ## voiceChannelStartTimeUpdate ### Description Emitted when the start time of a voice channel is updated. ### Arguments - **guild** (Guild | Uncached) - The guild where the update occurred. - **channel** (AnyVoiceChannel | Uncached) - The voice channel whose start time was updated. - **voiceStartTime** (null | number) - The new start time, or null if not set. ``` -------------------------------- ### create Source: https://docs.oceanic.ws/v1.15.0/classes/REST_Webhooks.html Creates a channel webhook. ```APIDOC ## create ### Description Creates a channel webhook. ### Method create ### Endpoint create(channelID, options) ### Parameters #### Path Parameters - **channelID** (string) - Required - The ID of the channel to create the webhook in. - **options** (CreateWebhookOptions) - Required - The options to create the webhook with. ### Returns Promise ### Caching This method **does not** cache its result. ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/StageInstance.html Creates a new StageInstance instance. ```APIDOC ## constructor ### Description Creates a new StageInstance instance. ### Signature `new StageInstance(data, client): StageInstance` ### Parameters - **data** (RawStageInstance) - Required - The raw data for the stage instance. - **client** (Client) - Required - The client instance. ### Returns - **StageInstance** - The new StageInstance instance. ``` -------------------------------- ### get channel(): undefined | null | StageChannel Source: https://docs.oceanic.ws/v1.15.0/classes/GuildScheduledEvent.html Gets the channel in which the event will be hosted. Returns null if the entity type is EXTERNAL. ```APIDOC ## get channel(): undefined | null | StageChannel ### Description Gets the channel in which the event will be hosted. Returns `null` if the entity type is `EXTERNAL`. ### Returns - **undefined | null | StageChannel** - The channel or null if external. ``` -------------------------------- ### createSoundboardSound(guildID, options) Source: https://docs.oceanic.ws/v1.15.0/classes/REST_Guilds.html Creates a soundboard sound in a guild. Returns a Promise resolving to a Soundboard object. ```APIDOC ## createSoundboardSound(guildID, options) ### Description Creates a soundboard sound. ### Method createSoundboardSound ### Parameters - **guildID** (string) - Required - The ID of the guild. - **options** (CreateSoundboardSoundOptions) - Required - The options for creating the soundboard sound. ### Returns Promise ### Caching This method **may** cache its result. The result will not be cached if the guild is not cached. ### Caches Guild#soundboardSounds ``` -------------------------------- ### Install oceanic.js without optional dependencies Source: https://docs.oceanic.ws/v1.15.0 Install oceanic.js without optional dependencies. Requires NodeJS 18.13.0 or higher. ```bash npm i oceanic.js --omit=optional ``` -------------------------------- ### new Bucket(tokenLimit, interval, options?) Source: https://docs.oceanic.ws/v1.15.0/classes/Bucket.html Constructs a new Bucket instance to manage task execution rates. ```APIDOC ## Constructor ### Signature `new Bucket(tokenLimit: number, interval: number, options?: { latencyRef?: { latency: number }, reservedTokens?: number }): Bucket` ### Parameters - **tokenLimit** (number) - The maximum number of tokens allowed. - **interval** (number) - The time interval for token replenishment. - **options** (object, optional) - Configuration options. - **latencyRef** (object, optional) - Reference for latency tracking. - **latency** (number) - Current latency value. - **reservedTokens** (number, optional) - Number of tokens to reserve. ``` -------------------------------- ### connect() Source: https://docs.oceanic.ws/v1.15.0/classes/Client.html Connects the client to Discord. ```APIDOC ## connect() ### Description Connect the client to Discord. ### Method connect ### Returns Promise ``` -------------------------------- ### get(applicationID) Source: https://docs.oceanic.ws/v1.15.0/classes/REST_Applications.html Gets an application's info. This method does not cache its result. This generally cannot be used on any application except the authenticated bot. ```APIDOC ## get(applicationID) ### Description Get an application's info. ### Method GET ### Endpoint /applications/{applicationID} ### Parameters #### Path Parameters - **applicationID** (string) - Required - The ID of the application. ### Response #### Success Response (200) - **Application** (object) - The application info. ### Caching This method **does not** cache its result. ### Note This generally cannot be used on any application except the authenticated bot. ``` -------------------------------- ### getOptions Source: https://docs.oceanic.ws/v1.15.0/classes/InteractionOptionsWrapper.html Retrieves all interaction options. ```APIDOC ## getOptions() ### Description Get all options. ### Returns - **InteractionOptions[]** - The raw options array. ``` -------------------------------- ### get tag(): string Source: https://docs.oceanic.ws/v1.15.0/classes/ExtendedUser.html Gets this user's unique username, if migrated, else a combination of the user's username and discriminator. ```APIDOC ## get tag(): string ### Description Gets this user's unique username, if migrated, else a combination of the user's username and discriminator. ### Returns - **Type**: string ``` -------------------------------- ### from(data, client) Source: https://docs.oceanic.ws/v1.15.0/classes/AutocompleteInteraction.html Static method that creates an interaction instance from raw data. ```APIDOC ## from(data, client) ### Description Static method that creates an interaction instance from raw data. ### Type Parameters - **T** (extends AnyInteraction = AnyInteraction) - The type of interaction to create. ### Parameters - **data** (RawInteraction) - The raw interaction data. - **client** (Client) - The client instance. ### Returns T ``` -------------------------------- ### get channel(): null | (CH extends AnyInviteChannel ? CH : PartialInviteChannel) Source: https://docs.oceanic.ws/v1.15.0/interfaces/InviteWithMetadata.html Gets the channel this invite leads to. If the channel is not cached, returns a partial with only id, name, and type. ```APIDOC ## get channel(): null | (CH extends AnyInviteChannel ? CH : PartialInviteChannel) ### Description Gets the channel this invite leads to. If the channel is not cached, returns a partial with only `id`, `name`, and `type`. ### Returns - **null** - If the channel is not available. - **CH** - If the channel is cached and matches the generic type. - **PartialInviteChannel** - If the channel is not cached, a partial with only `id`, `name`, and `type`. ``` -------------------------------- ### launchActivity Source: https://docs.oceanic.ws/v1.15.0/interfaces/Types_Interactions.GuildComponentButtonInteraction.html Launches an activity in the interaction context. ```APIDOC ## launchActivity ### Description Launches an activity in the interaction context. ### Method launchActivity ### Returns - **Promise>** - The interaction callback response. ``` -------------------------------- ### Error.captureStackTrace with constructorOpt example Source: https://docs.oceanic.ws/v1.15.0/classes/DiscordHTTPError.html Demonstrates using the constructorOpt argument to omit frames above a given function from the stack trace. In this example, functions c and b are excluded from the stack trace. ```javascript function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` -------------------------------- ### sort method example Source: https://docs.oceanic.ws/v1.15.0/classes/QueryBuilder.html Sorts all existing name-value pairs in-place by their names using a stable sorting algorithm. The example shows that after sorting, the query string is percent-encoded and ordered by name. ```javascript const params = new URLSearchParams('query[]=abc&type=search&query[]=123'); params.sort(); console.log(params.toString()); // Prints query%5B%5D=abc&query%5B%5D=123&type=search ``` -------------------------------- ### toString Source: https://docs.oceanic.ws/v1.15.0/classes/Soundboard.html Returns a string representation of the Soundboard instance. ```APIDOC ## toString ### Description Returns a string representation of the Soundboard instance. ### Returns string ``` -------------------------------- ### connect() Source: https://docs.oceanic.ws/v1.15.0/classes/ShardManager.html Connects all shards. ```APIDOC ## connect() ### Description Connects all shards. ### Returns Promise ``` -------------------------------- ### keys method example Source: https://docs.oceanic.ws/v1.15.0/classes/QueryBuilder.html Returns an ES6 Iterator over the names of each name-value pair. The example creates a URLSearchParams with duplicate 'foo' keys and prints each name, resulting in 'foo' printed twice. ```javascript const params = new URLSearchParams('foo=bar&foo=baz'); for (const name of params.keys()) { console.log(name); } // Prints: // foo // foo ``` -------------------------------- ### getEntitlements Source: https://docs.oceanic.ws/v1.15.0/classes/User.html Gets the entitlements for this guild. ```APIDOC ## GET getEntitlements ### Description Gets the entitlements for this guild. ### Method GET ### Endpoint getEntitlements ### Parameters #### Query Parameters - **options** (Omit) - Optional - The options for getting the entitlements. - **applicationID** (string) - Optional - The ID of the application. ### Returns - **Promise<(Entitlement | TestEntitlement)[]>** - A promise that resolves to an array of entitlements. ``` -------------------------------- ### new ShardManager(client, options?) Source: https://docs.oceanic.ws/v1.15.0/classes/ShardManager.html Creates a new ShardManager instance. ```APIDOC ## new ShardManager(client, options?) ### Description Creates a new ShardManager instance. ### Parameters - **client** (Client) - Required - The client this manager belongs to. - **options** (GatewayOptions) - Optional - Gateway options, defaults to {}. ### Returns ShardManager ``` -------------------------------- ### getMessage Source: https://docs.oceanic.ws/v1.15.0/classes/Webhook.html Gets a webhook message. ```APIDOC ## getMessage(messageID, threadID?, token?) ### Description Get a webhook message. ### Method getMessage ### Type Parameters - T extends AnyTextableGuildChannel ### Parameters - messageID: string - The ID of the message. - `Optional` threadID: string - The ID of the thread the message is in. - `Optional` token: string - The token for the webhook, if not already present. ### Returns Promise> ``` -------------------------------- ### from(data, client) Source: https://docs.oceanic.ws/v1.15.0/classes/ModalSubmitInteraction.html Static method that creates an interaction instance from raw data and a client. ```APIDOC ## from(data, client) ### Description Static method that creates an interaction instance from raw data and a client. ### Method from ### Type Parameters - **T** extends AnyInteraction = AnyInteraction ### Parameters - **data** (RawInteraction) - Required - The raw interaction data. - **client** (Client) - Required - The client instance. ### Returns `T` ``` -------------------------------- ### getThreadMembers Source: https://docs.oceanic.ws/v1.15.0/classes/PublicThreadChannel.html Gets members of the thread. ```APIDOC ## getThreadMembers ### Description Gets members of the thread. ### Method getThreadMembers ### Parameters None ### Returns Promise ``` -------------------------------- ### client Source: https://docs.oceanic.ws/v1.15.0/classes/AuditLogEntry.html The client instance. ```APIDOC ## Property: client ### Description The client instance. ### Type - **Client** ``` -------------------------------- ### getMessages Source: https://docs.oceanic.ws/v1.15.0/classes/PublicThreadChannel.html Gets messages from the thread. ```APIDOC ## getMessages ### Description Gets messages from the thread. ### Method getMessages ### Parameters - **options** (GetMessagesOptions) - Optional - Options for fetching messages. ### Returns Promise[]> ``` -------------------------------- ### startThread Source: https://docs.oceanic.ws/v1.15.0/classes/ForumChannel.html Starts a new thread in this forum channel. ```APIDOC ## startThread ### Description Starts a new thread in this forum channel. ### Method POST ### Endpoint /channels/{channel.id}/threads ### Parameters #### Path Parameters - **channel.id** (string) - Required - The ID of the forum channel. #### Request Body - **name** (string) - Required - The name of the thread. - **message** (object) - Required - The initial message content. - **autoArchiveDuration** (number) - Optional - The auto archive duration. - **rateLimitPerUser** (number) - Optional - The rate limit per user. - **tags** (array) - Optional - The tags for the thread. ### Response #### Success Response (201) - **thread** (ThreadChannel) - The created thread. #### Response Example ```json { "id": "string", "name": "string" } ``` ``` -------------------------------- ### getMessage Source: https://docs.oceanic.ws/v1.15.0/classes/PublicThreadChannel.html Gets a message from the thread. ```APIDOC ## getMessage ### Description Gets a message from the thread. ### Method getMessage ### Parameters - **messageID** (string) - Required - The ID of the message. ### Returns Promise> ``` -------------------------------- ### getMembers Source: https://docs.oceanic.ws/v1.15.0/classes/PublicThreadChannel.html Gets all members of the thread. ```APIDOC ## getMembers ### Description Gets all members of the thread. ### Method getMembers ### Parameters None ### Returns Promise ``` -------------------------------- ### constructor Source: https://docs.oceanic.ws/v1.15.0/classes/VoiceState.html Creates a new VoiceState instance. ```APIDOC ## new VoiceState(data, client) ### Description Creates a new VoiceState instance. ### Parameters - **data** (RawVoiceState) - Required - The raw voice state data. - **client** (Client) - Required - The client instance. ### Returns VoiceState ```