CommandClient

CommandClient

Represents an Eris client with the command framework

Constructor

new CommandClient(token, options, commandOptionsopt)

Create a CommandClient

Properties:
Name Type Description
commands Object

Object mapping command labels to Command objects

commandAliases Object

Object mapping command label aliases to command labels

commandOptions Object

Command options

guildPrefixes Object

Object mapping guild IDs to guild specific prefix or arrays of guild-specific prefixes

Source:
Parameters:
Name Type Attributes Description
token String

Bot token

options Object

Eris options (same as Client)

commandOptions Object <optional>

Command options

Name Type Attributes Default Description
argsSplitter function <optional>

The function used to split args. The function is given a string with the contents of the command message (without the prefix) and should return an array of strings. By default, args are split by consecutive whitespace

defaultCommandOptions Object <optional>
{}

Default command options. This object takes the same options as a normal Command

defaultHelpCommand Boolean <optional>
true

Whether to register the default help command or not

description String <optional>
"An Eris-based Discord bot"

The description to show in the default help command

ignoreBots Boolean <optional>
true

Whether to ignore bot accounts or not

ignoreSelf Boolean <optional>
true

Whether to ignore the bot's own account or not

name String <optional>
"<Bot username>"

The bot name to show in the default help command

owner String <optional>
"an unknown user"

The owner to show in the default help command

prefix String | Array.<String> <optional>
"@mention "

The bot prefix. Can be either an array of prefixes or a single prefix. "@mention" will be automatically replaced with the bot's actual mention

Extends

Methods

addGroupRecipient(groupID, userID, options) → {Promise}

Add a user to a group channel

Overrides:
Source:
Parameters:
Name Type Description
groupID String

The ID of the target group

userID String

The ID of the user to add

options Object

The options for adding the user

Name Type Attributes Description
accessToken String

The access token of the user to add. Requires having been authorized with the gdm.join scope

nick String <optional>

The nickname to give the user

Returns:
Type:
Promise

addGuildDiscoverySubcategory(guildID, categoryID, reasonopt) → {Promise.<Object>}

Add a guild discovery subcategory

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

categoryID String

The ID of the discovery category

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Object>

addGuildMember(guildID, userID, accessToken, optionsopt) → {Promise}

Add a member to a guild

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

userID String

The ID of the user

accessToken String

The access token of the user

options Object <optional>

Options for adding the member

Name Type Attributes Description
deaf Boolean <optional>

Whether the member should be deafened

mute Boolean <optional>

Whether the member should be muted

nick String <optional>

The nickname of the member

roles Array.<String> <optional>

Array of role IDs to add to the member

Returns:
Type:
Promise

addGuildMemberRole(guildID, memberID, roleID, reasonopt) → {Promise}

Add a role to a guild member

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

memberID String

The ID of the member

roleID String

The ID of the role

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

addMessageReaction(channelID, messageID, reaction) → {Promise}

Add a reaction to a message

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the channel

messageID String

The ID of the message

reaction String

The reaction (Unicode string if Unicode emoji, emojiName:emojiID if custom emoji)

Returns:
Type:
Promise

banGuildMember(guildID, userID, reasonopt) → {Promise}

Ban a user from a guild

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
guildID String

The ID of the guild

userID String

The ID of the user

options.deleteMessageDays Number <optional>
0

[DEPRECATED] Number of days to delete messages for, between 0-7 inclusive

options.deleteMessageSeconds Number <optional>
0

Number of seconds to delete messages for, between 0 and 604800 inclusive

options.reason String <optional>

The reason to be displayed in audit logs

reason String <optional>

[DEPRECATED] The reason to be displayed in audit logs

Returns:
Type:
Promise

bulkBanGuildMembers(guildID, options) → {Promise.<Object>}

Bulk ban users from a guild - Note: Requires both BAN_MEMBERS and MANAGE_GUILD permissions

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

options Object

Options for banning the users

Name Type Attributes Default Description
userIDs Array.<String>

Array of user IDs to ban

deleteMessageSeconds Number <optional>
0

Number of seconds to delete messages for each user, between 0 and 604800 inclusive

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Object>

An object with 2 arrays - banned_users with the IDs of the successfully banned users, and failed_users with the IDs of any users who could not be banned or were already banned

bulkEditCommands(commands) → {Promise.<Array.<ApplicationCommand>>}

Bulk create/edit global application commands

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
commands Array.<Object>

An array of command objects

commands[].defaultPermission Boolean <optional>
true

[DEPRECATED] Whether the command is enabled by default when the application is added to a guild. Replaced by defaultMemberPermissions

commands[].description String <optional>

The command description, required for CHAT_INPUT commands

commands[].descriptionLocalizations Object <optional>
<nullable>

Localization directory with keys in available locales for the command description

commands[].dmPermission Boolean <optional>
<nullable>
true

Whether the command is available in DMs with the app

commands[].id String <optional>

The command ID, if known

commands[].name String

The command name

commands[].nameLocalizations Object <optional>
<nullable>

Localization directory with keys in available locales for the command name

commands[].nsfw Boolean <optional>
false

Whether the command is age-restricted

commands[].options Array.<Object> <optional>

The application command options

commands[].type Number <optional>
1

The command type, either 1 for CHAT_INPUT, 2 for USER or 3 for MESSAGE

Returns:
Type:
Promise.<Array.<ApplicationCommand>>

Resolves with the overwritten application commands

bulkEditGuildCommands(guildID, commands) → {Promise.<Array.<ApplicationCommand>>}

Bulk create/edit guild application commands

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
guildID String

The ID of the guild

commands Array.<Object>

An array of command objects

commands[].defaultPermission Boolean <optional>
true

[DEPRECATED] Whether the command is enabled by default when the application is added to a guild. Replaced by defaultMemberPermissions

commands[].description String <optional>

The command description, required for CHAT_INPUT commands

commands[].descriptionLocalizations Object <optional>
<nullable>

Localization directory with keys in available locales for the command description

commands[].id String <optional>

The command ID, if known

commands[].name String

The command name

commands[].nameLocalizations Object <optional>
<nullable>

Localization directory with keys in available locales for the command name

commands[].nsfw Boolean <optional>
false

Whether the command is age-restricted

commands[].options Array.<Object> <optional>

The application command options

commands[].type Number <optional>
1

The command type, either 1 for CHAT_INPUT, 2 for USER or 3 for MESSAGE

Returns:
Type:
Promise.<Array.<ApplicationCommand>>

Resolves with the overwritten application commands

closeVoiceConnection(guildID)

Closes a voice connection with a guild ID

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

(async) connect() → {Promise}

Tells all shards to connect. This will call getBotGateway(), which is ratelimited.

Overrides:
Source:
Returns:
Type:
Promise

Resolves when all shards are initialized

createAutoModerationRule(guildID, options) → {Promise.<AutoModerationRule>}

Create an auto moderation rule

Overrides:
Source:
Parameters:
Name Type Description
guildID String

the ID of the guild to create the rule in

options Object

The rule to create

Name Type Attributes Default Description
actions Array.<Object>

The actions done when the rule is violated

enabled Boolean <optional>
false

If the rule is enabled, false by default

eventType Number

The event type for the rule

exemptChannels Array.<String> <optional>

Any channels where this rule does not apply

exemptRoles Array.<String> <optional>

Any roles to which this rule does not apply

name String

The name of the rule

triggerMetadata Object <optional>

The trigger metadata for the rule

triggerType Number

The trigger type of the rule

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<AutoModerationRule>

createChannel(guildID, name, typeopt, optionsopt) → {Promise.<(CategoryChannel|ForumChannel|TextChannel|VoiceChannel)>}

Create a channel in a guild

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
guildID String

The ID of the guild to create the channel in

name String

The name of the channel

type Number <optional>
0

The type of the channel, either 0 (text), 2 (voice), 4 (category), 5 (news), 13 (stage), or 15 (forum)

options Object | String <optional>

The properties the channel should have. If options is a string, it will be treated as options.parentID (see below). Passing a string is deprecated and will not be supported in future versions.

Name Type Attributes Description
availableTags Array.<Object> <optional>

The available tags that can be applied to threads in a forum/media channel. See the official Discord API documentation entry for object structure (forum/media channels only, max 20)

bitrate Number <optional>

The bitrate of the channel (voice channels only)

defaultAutoArchiveDuration Number <optional>

The default duration of newly created threads in minutes to automatically archive the thread after inactivity (60, 1440, 4320, 10080) (text/news/forum/media channels only)

defaultForumLayout Number <optional>

The default forum layout type used to display posts in forum channels (forum channels only)

defaultReactionEmoji Object <optional>

The emoji to show in the add reaction button on a thread in a forum/media channel (forum/media channels only)

defaultSortOrder Number <optional>

The default sort order type used to order posts in forum/media channels (forum/media channels only)

defaultThreadRateLimitPerUser Number <optional>

The initial rateLimitPerUser to set on newly created threads in a channel (text/forum/media channels only)

nsfw Boolean <optional>

The nsfw status of the channel

parentID String <optional>
<nullable>

The ID of the parent category channel for this channel

permissionOverwrites Array.<Object> <optional>

An array containing permission overwrite objects

position Number <optional>

The sorting position of the channel

rateLimitPerUser Number <optional>

The time in seconds a user has to wait before sending another message (0-21600) (does not affect bots or users with manageMessages/manageChannel permissions) (text/voice/stage/forum/media channels only)

reason String <optional>

The reason to be displayed in audit logs

topic String <optional>

The topic of the channel (text channels only)

userLimit Number <optional>

The channel user limit (voice channels only)

createChannelInvite(channelID, optionsopt, reasonopt) → {Promise.<Invite>}

Create an invite for a channel

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

options Object <optional>

Invite generation options

Name Type Attributes Description
maxAge Number <optional>

How long the invite should last in seconds

maxUses Number <optional>

How many uses the invite should last for

targetApplicationID String <optional>

The target application id

targetType Number <optional>

The type of the target application

targetUserID String <optional>

The ID of the user whose stream should be displayed for the invite (options.targetType must be 1)

temporary Boolean <optional>

Whether the invite grants temporary membership or not

unique Boolean <optional>

Whether the invite is unique or not

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Invite>

createChannelWebhook(channelID, options, reasonopt) → {Promise.<Object>}

Create a channel webhook

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel to create the webhook in

options Object

Webhook options

Name Type Attributes Description
avatar String <optional>
<nullable>

The default avatar as a base64 data URI. Note: base64 strings alone are not base64 data URI strings

name String

The default name

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Object>

Resolves with a webhook object

createCommand(command) → {Promise.<ApplicationCommand>}

Create a global application command

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
command Object

A command object

command.defaultPermission Boolean <optional>
true

[DEPRECATED] Whether the command is enabled by default when the application is added to a guild. Replaced by defaultMemberPermissions

command.description String <optional>

The command description, required for CHAT_INPUT commands

command.descriptionLocalizations Object <optional>
<nullable>

Localization directory with keys in available locales for the command description

command.dmPermission Boolean <optional>
<nullable>
true

Whether the command is available in DMs with the app

command.name String

The command name

command.nameLocalizations Object <optional>
<nullable>

Localization directory with keys in available locales for the command name

command.nsfw Boolean <optional>
false

Whether the command is age-restricted

command.options Array.<Object> <optional>

The application command options

command.type Number <optional>
1

The command type, either 1 for CHAT_INPUT, 2 for USER or 3 for MESSAGE

Returns:
Type:
Promise.<ApplicationCommand>

Resolves with the created application command

createEmoji(options) → {Promise.<Object>}

Create an emoji for this application

Overrides:
Source:
Parameters:
Name Type Description
options Object

Emoji options

Name Type Description
image String

The base 64 encoded string

name String

The name of emoji

Returns:
Type:
Promise.<Object>

An emoji object

createGroupChannel(options) → {Promise.<GroupChannel>}

Create a group channel with other users

Overrides:
Source:
Parameters:
Name Type Description
options Object

The options for the group channel

Name Type Attributes Description
acessTokens Array.<String>

The OAuth2 access tokens of the users to add to the group. Requires them to have been authorized with the gdm.join scope

nicks Object <optional>

An object with user IDs as keys for nicknames to give the users

Returns:
Type:
Promise.<GroupChannel>

createGuildCommand(guildID, command) → {Promise.<ApplicationCommand>}

Create a guild application command

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
guildID String

The ID of the guild

command Object

A command object

command.defaultPermission Boolean <optional>
true

[DEPRECATED] Whether the command is enabled by default when the application is added to a guild. Replaced by defaultMemberPermissions

command.description String <optional>

The command description, required for CHAT_INPUT commands

command.descriptionLocalizations Object <optional>
<nullable>

Localization directory with keys in available locales for the command description

command.name String

The command name

command.nameLocalizations Object <optional>
<nullable>

Localization directory with keys in available locales for the command name

command.nsfw Boolean <optional>
false

Whether the command is age-restricted

command.options Array.<Object> <optional>

The application command options

command.type Number <optional>
1

The command type, either 1 for CHAT_INPUT, 2 for USER or 3 for MESSAGE

Returns:
Type:
Promise.<ApplicationCommand>

Resolves with the created application command

createGuildEmoji(guildID, options, reasonopt) → {Promise.<Object>}

Create a guild emoji object

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild to create the emoji in

options Object

Emoji options

Name Type Attributes Description
image String

The base 64 encoded string

name String

The name of emoji

roles Array <optional>

An array containing authorized role IDs

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Object>

A guild emoji object

createGuildScheduledEvent(guildID, event, reasonopt) → {Promise.<GuildScheduledEvent>}

Create a guild scheduled event

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The guild ID where the event will be created

event Object

The event to be created

Name Type Attributes Description
channelID String <optional>

The channel ID of the event. This is optional if entityType is 3 (external)

description String <optional>

The description of the event

entityMetadata Object <optional>

The entity metadata for the scheduled event. This is required if entityType is 3 (external)

Name Type Attributes Description
location String <optional>

Location of the event

entityType Number

The entity type of the scheduled event

image String <optional>

Base 64 encoded image for the scheduled event

name String

The name of the event

privacyLevel String

The privacy level of the event

recurrenceRule Object <optional>

The definitions for how often this event should recur. Properties can be camelCase (preferred) or snake_case

scheduledEndTime Date <optional>

The time when the event is scheduled to end. This is required if entityType is 3 (external)

scheduledStartTime Date

The time the event will start

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<GuildScheduledEvent>

createGuildSoundboardSound(guildID, sound, reasonopt) → {Promise.<SoundboardSound>}

Create a guild soundboard sound

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The guild ID where the sound will be created

sound Object

The sound to be created

Name Type Attributes Default Description
emojiID String <optional>
<nullable>

The ID of the relating custom emoji (mutually exclusive with sound.emojiName)

emojiName String <optional>
<nullable>

The name of the relating default emoji (mutually exclusive with sound.emojiID)

name String

The name of the soundboard sound (2-32 characters)

sound String

The base 64 encoded mp3/ogg sound data

volume Number <optional>
<nullable>
1

The volume of the soundboard sound, between 0 and 1

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<SoundboardSound>

createGuildSticker(options, reasonopt) → {Promise.<Object>}

Create a guild sticker

Overrides:
Source:
Parameters:
Name Type Attributes Description
options Object

Sticker options

Name Type Attributes Description
description String <optional>

The description of the sticker

file Object

A file object

Name Type Description
file Buffer

A buffer containing file data

name String

What to name the file

name String

The name of the sticker

tags String

The Discord name of a unicode emoji representing the sticker's expression

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Object>

A sticker object

createGuildTemplate(guildID, name, descriptionopt) → {Promise.<GuildTemplate>}

Create a template for a guild

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

name String

The name of the template

description String <optional>

The description for the template

Returns:
Type:
Promise.<GuildTemplate>

createInteractionResponse(interactionID, interactionToken, options, fileopt) → {Promise}

Respond to the interaction with a message Note: Use webhooks if you have already responded with an interaction response.

Overrides:
Source:
Parameters:
Name Type Attributes Description
interactionID String

The interaction ID.

interactionToken String

The interaction Token.

options Object

The options object.

Name Type Attributes Description
data Object <optional>

The data to send with the response. For response types 4 and 7, see here. For response type 8, see here. For response type 9, see here

type Number

The response type to send. See the official Discord API documentation entry for valid types

file Object | Array.<Object> <optional>

A file object (or an Array of them)

Name Type Description
file Buffer

A buffer containing file data

name String

What to name the file

Returns:
Type:
Promise

createMessage(channelID, content, fileopt) → {Promise.<Message>}

Create a message in a channel Note: If you want to DM someone, the user ID is not the DM channel ID. use Client.getDMChannel() to get the DM channel for a user

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

content String | Object

A string or object. If an object is passed:

Name Type Attributes Description
allowedMentions Object <optional>

A list of mentions to allow (overrides default)

Name Type Attributes Description
everyone Boolean <optional>

Whether or not to allow @everyone/@here

repliedUser Boolean <optional>

Whether or not to mention the author of the message being replied to

roles Boolean | Array.<String> <optional>

Whether or not to allow all role mentions, or an array of specific role mentions to allow

users Boolean | Array.<String> <optional>

Whether or not to allow all user mentions, or an array of specific user mentions to allow

attachments Array.<Object> <optional>

An array of attachment objects with the filename and description

Name Type Attributes Description
description String <optional>

The description of the file

filename String <optional>

The name of the file

id Number

The index of the file

components Array.<Object> <optional>

An array of component objects

Name Type Attributes Description
custom_id String <optional>

The ID of the component (type 2 style 0-4 and type 3,5,6,7,8 only)

disabled Boolean <optional>

Whether the component is disabled (type 2 and 3,5,6,7,8 only)

emoji Object <optional>

The emoji to be displayed in the component (type 2)

label String <optional>

The label to be displayed in the component (type 2)

default_values Array.<Object> <optional>

default values for the component (type 5,6,7,8 only)

Name Type Attributes Description
id String <optional>

id of a user, role, or channel

type String <optional>

type of value that id represents (user, role, or channel)

max_values Number <optional>

The maximum number of items that can be chosen (1-25, default 1)

min_values Number <optional>

The minimum number of items that must be chosen (0-25, default 1)

options Array.<Object> <optional>

The options for this component (type 3 only)

Name Type Attributes Description
default Boolean <optional>

Whether this option should be the default value selected

description String <optional>

The description for this option

emoji Object <optional>

The emoji to be displayed in this option

label String

The label for this option

value Number | String

The value for this option

placeholder String <optional>

The placeholder text for the component when no option is selected (type 3,5,6,7,8 only)

style Number <optional>

The style of the component (type 2 only) - If 0-4, custom_id is required; if 5, url is required

type Number

The type of component - If 1, it is a collection and a components array (nested) is required; if 2, it is a button; if 3, it is a string select; if 5, it is a user select; if 6, it is a role select; if 7, it is a mentionable select; if 8, it is a channel select

url String <optional>

The URL that the component should open for users (type 2 style 5 only)

content String <optional>

A content string

embed Object <optional>

[DEPRECATED] An embed object. See the official Discord API documentation entry for object structure

embeds Array.<Object> <optional>

An array of embed objects. See the official Discord API documentation entry for object structure

enforceNonce Boolean <optional>

If true and content.nonce is present, if multiple messages are sent with the same nonce within a few minutes of each other, that message will be returned and no new message created

messageReference Object <optional>

The message reference, used when replying to or forwarding messages

Name Type Attributes Default Description
channelID String <optional>

The channel ID of the referenced message. Required when forwarding messages

failIfNotExists Boolean <optional>
true

Whether to throw an error if the message reference doesn't exist. If false, and the referenced message doesn't exist, the message is created without a referenced message

guildID String <optional>

The guild ID of the referenced message

messageID String

The message ID of the referenced message. This cannot reference a system message

type String <optional>
0

The type of reference. Either 0 (REPLY) or 1 (FORWARDED). Will become required in the future

messageReferenceID String <optional>

[DEPRECATED] The ID of the message should be replied to. Use messageReference instead

nonce String | Number <optional>

A nonce value which will also appear in the messageCreate event

poll Object <optional>

A poll object. See the official Discord API documentation entry for object structure

stickerIDs Array.<String> <optional>

An array of IDs corresponding to stickers to send

tts Boolean <optional>

Set the message TTS flag

file Object | Array.<Object> <optional>

A file object (or an Array of them)

Name Type Description
file Buffer

A buffer containing file data

name String

What to name the file

Returns:
Type:
Promise.<Message>

createRole(guildID, optionsopt, reasonopt) → {Promise.<Role>}

Create a guild role

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild to create the role in

options Object | Role <optional>

An object or Role containing the properties to set

Name Type Attributes Description
color Number <optional>

The hex color of the role, in number form (ex: 0x3d15b3 or 4040115)

hoist Boolean <optional>

Whether to hoist the role in the user list or not

icon String <optional>

The role icon as a base64 data URI

mentionable Boolean <optional>

Whether the role is mentionable or not

name String <optional>

The name of the role

permissions BigInt | Number | String | Permission <optional>

The role permissions

unicodeEmoji String <optional>

The role's unicode emoji

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Role>

createStageInstance(channelID, options) → {Promise.<StageInstance>}

Create a stage instance

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the stage channel to create the instance in

options Object

The stage instance options

Name Type Attributes Description
privacyLevel Number <optional>

The privacy level of the stage instance. 1 is public, 2 is guild only

topic String

The stage instance topic

Returns:
Type:
Promise.<StageInstance>

createThread(channelID, options, fileopt) → {Promise.<(NewsThreadChannel|PublicThreadChannel|PrivateThreadChannel)>}

Create a thread in a channel

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

options Object

The thread options

Name Type Attributes Description
appliedTags Array.<String> <optional>

The IDs of the set of tags that have been applied to a thread in a forum/media channel (threads created in forum/media channels only, max 5)

autoArchiveDuration Number <optional>

The duration in minutes to automatically archive the thread after recent activity, either 60, 1440, 4320 or 10080

invitable Boolean <optional>

Whether non-moderators can add other non-moderators to the thread (private threads only)

message Object <optional>

The message to create with the thread (only use when creating a thread inside of a thread-only channel). Note: When creating a forum/media channel thread, you must provide at least one of content, embeds, stickerIDs, components, or files

Name Type Attributes Description
allowedMentions Object <optional>

A list of mentions to allow (overrides default)

Name Type Attributes Description
everyone Boolean <optional>

Whether or not to allow @everyone/@here

repliedUser Boolean <optional>

Whether or not to mention the author of the message being replied to

roles Boolean | Array.<String> <optional>

Whether or not to allow all role mentions, or an array of specific role mentions to allow

users Boolean | Array.<String> <optional>

Whether or not to allow all user mentions, or an array of specific user mentions to allow

attachments Array.<Object> <optional>

An array of attachment objects with the filename and description

Name Type Attributes Description
description String <optional>

The description of the file

filename String <optional>

The name of the file

id Number

The index of the file

components Array.<Object> <optional>

An array of component objects

Name Type Attributes Description
custom_id String <optional>

The ID of the component (type 2 style 0-4 and type 3,5,6,7,8 only)

disabled Boolean <optional>

Whether the component is disabled (type 2 and 3,5,6,7,8 only)

emoji Object <optional>

The emoji to be displayed in the component (type 2)

label String <optional>

The label to be displayed in the component (type 2)

components[].default_values Array.<Object> <optional>

default values for the component (type 5,6,7,8 only)

components[].default_values[].id String <optional>

id of a user, role, or channel

components[].default_values[].type String <optional>

type of value that id represents (user, role, or channel)

message.components[].max_values Number <optional>

The maximum number of items that can be chosen (1-25, default 1)

message.components[].min_values Number <optional>

The minimum number of items that must be chosen (0-25, default 1)

message.components[].options Array.<Object> <optional>

The options for this component (type 3 only)

message.components[].options[].default Boolean <optional>

Whether this option should be the default value selected

message.components[].options[].description String <optional>

The description for this option

message.components[].options[].emoji Object <optional>

The emoji to be displayed in this option

message.components[].options[].label String

The label for this option

message.components[].options[].value Number | String

The value for this option

message.components[].placeholder String <optional>

The placeholder text for the component when no option is selected (type 3,5,6,7,8 only)

message.components[].style Number <optional>

The style of the component (type 2 only) - If 0-4, custom_id is required; if 5, url is required

components[].type Number

The type of component - If 1, it is a collection and a components array (nested) is required; if 2, it is a button; if 3, it is a string select; if 5, it is a user select; if 6, it is a role select; if 7, it is a mentionable select; if 8, it is a channel select

message.components[].url String <optional>

The URL that the component should open for users (type 2 style 5 only)

message.content String <optional>

A string containing the message content

message.embeds Array.<Object> <optional>

An array of embed objects. See the official Discord API documentation entry for object structure

message.stickerIDs Array.<String> <optional>

An array of IDs corresponding to stickers to send

name String

The thread channel name

rateLimitPerUser Number <optional>

The time in seconds a user has to wait before sending another message (0-21600) (does not affect bots or users with manageMessages/manageChannel permissions)

reason String <optional>

The reason to be displayed in audit logs

type Number <optional>

The channel type of the thread to create. Either 10 (announcement thread, announcement channels only), 11 (public thread) or 12 (private thread). Note: Not required when creating a thread inside of a forum/media channel, it will always be public

file Object | Array.<Object> <optional>

A file object (or an Array of them). Only use when creating a thread inside of a forum/media channel

Name Type Description
file Buffer

A buffer containing file data

name String

What to name the file

createThreadWithMessage(channelID, messageID, options) → {Promise.<(NewsThreadChannel|PublicThreadChannel)>}

Create a thread with an existing message

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the channel

messageID String

The ID of the message to create the thread from

options Object

The thread options

Name Type Attributes Description
autoArchiveDuration Number <optional>

Duration in minutes to automatically archive the thread after recent activity, either 60, 1440, 4320 or 10080

name String

The thread channel name

rateLimitPerUser Number <optional>

The time in seconds a user has to wait before sending another message (0-21600) (does not affect bots or users with manageMessages/manageChannel permissions)

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<(NewsThreadChannel|PublicThreadChannel)>

createThreadWithoutMessage(channelID, options) → {Promise.<(NewsThreadChannel|PublicThreadChannel|PrivateThreadChannel)>}

[DEPRECATED] Create a thread without an existing message. Use createThread instead

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the channel

options Object

The thread options

Name Type Attributes Description
autoArchiveDuration Number <optional>

Duration in minutes to automatically archive the thread after recent activity, either 60, 1440, 4320 or 10080

invitable Boolean <optional>

Whether non-moderators can add other non-moderators to the thread (private threads only)

name String

The thread channel name

rateLimitPerUser Number <optional>

The time in seconds a user has to wait before sending another message (0-21600) (does not affect bots or users with manageMessages/manageChannel permissions)

reason String <optional>

The reason to be displayed in audit logs

type Number <optional>

The channel type of the thread to create. Either 10 (announcement thread, announcement channels only), 11 (public thread) or 12 (private thread)

crosspostMessage(channelID, messageID) → {Promise.<Message>}

Crosspost (publish) a message to subscribed channels

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the NewsChannel

messageID String

The ID of the message

Returns:
Type:
Promise.<Message>

deleteAutoModerationRule(guildID, ruleID, reasonopt) → {Promise}

Delete an auto moderation rule

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The guildID to delete the rule from

ruleID String

The ID of the rule to delete

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

deleteChannel(channelID, reasonopt) → {Promise.<(CateogryChannel|DMChannel|GroupChannel|NewsChannel|StageChannel|TextChannel|VoiceChannel)>}

Delete a guild channel, or leave a DM channel

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<(CateogryChannel|DMChannel|GroupChannel|NewsChannel|StageChannel|TextChannel|VoiceChannel)>

deleteChannelPermission(channelID, overwriteID, reasonopt) → {Promise}

Delete a channel permission overwrite

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

overwriteID String

The ID of the overwritten user or role

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

deleteCommand(commandID) → {Promise}

Delete a global application command

Overrides:
Source:
Parameters:
Name Type Description
commandID String

The command id

Returns:
Type:
Promise

deleteEmoji(emojiID) → {Promise}

Delete an emoji for this application

Overrides:
Source:
Parameters:
Name Type Description
emojiID String

The id of the emoji

Returns:
Type:
Promise

deleteGuildCommand(guildID, commandID) → {Promise}

Delete a guild application command

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The guild ID

commandID String

The command id

Returns:
Type:
Promise

deleteGuildDiscoverySubcategory(guildID, categoryID, reasonopt) → {Promise}

Delete a guild discovery subcategory

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

categoryID String

The ID of the discovery category

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

deleteGuildEmoji(guildID, emojiID, reasonopt) → {Promise}

Delete a guild emoji object

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild to delete the emoji in

emojiID String

The ID of the emoji

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

deleteGuildIntegration(guildID, integrationID) → {Promise}

Delete a guild integration

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

integrationID String

The ID of the integration

Returns:
Type:
Promise

deleteGuildScheduledEvent(guildID, eventID) → {Promise}

Delete a guild scheduled event

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

eventID String

The ID of the event

Returns:
Type:
Promise

deleteGuildSoundboardSound(guildID, soundID, reasonopt) → {Promise}

Delete a guild soundboard sound

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

soundID String

The ID of the soundboard sound

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

deleteGuildSticker(guildID, stickerID, reasonopt) → {Promise}

Delete a guild sticker

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

stickerID String

The ID of the sticker

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

deleteGuildTemplate(guildID, code) → {Promise.<GuildTemplate>}

Delete a guild template

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

code String

The template code

Returns:
Type:
Promise.<GuildTemplate>

deleteInvite(inviteID, reasonopt) → {Promise}

Delete an invite

Overrides:
Source:
Parameters:
Name Type Attributes Description
inviteID String

The ID of the invite

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

deleteMessage(channelID, messageID, reasonopt) → {Promise}

Delete a message

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

messageID String

The ID of the message

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

deleteMessages(channelID, messageIDs, reasonopt) → {Promise}

Bulk delete messages (bot accounts only)

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

messageIDs Array.<String>

Array of message IDs to delete

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

deleteRole(guildID, roleID, reasonopt) → {Promise}

Delete a guild role

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild to create the role in

roleID String

The ID of the role

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

deleteStageInstance(channelID) → {Promise}

Delete a stage instance

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The stage channel associated with the instance

Returns:
Type:
Promise

deleteWebhook(webhookID, tokenopt, reasonopt) → {Promise}

Delete a webhook

Overrides:
Source:
Parameters:
Name Type Attributes Description
webhookID String

The ID of the webhook

token String <optional>

The token of the webhook, used instead of the Bot Authorization token

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

deleteWebhookMessage(webhookID, token, messageID) → {Promise}

Delete a webhook message

Overrides:
Source:
Parameters:
Name Type Description
webhookID String
token String
messageID String
Returns:
Type:
Promise

disconnect(optionsopt, nullable)

Disconnects all shards

Overrides:
Source:
Parameters:
Name Type Attributes Description
options Object <optional>
<nullable>

Shard disconnect options

Name Type Attributes Description
reconnect String | Boolean <optional>

false means destroy everything, true means you want to reconnect in the future, "auto" will autoreconnect

editAFK(afk)

Update the bot's AFK status. Setting this to true will enable push notifications for userbots.

Overrides:
Source:
Parameters:
Name Type Description
afk Boolean

Whether the bot user is AFK or not

editAutoModerationRule(guildID, ruleID, options) → {Promise.<AutoModerationRule>}

Edit an existing auto moderation rule

Overrides:
Source:
Parameters:
Name Type Description
guildID String

the ID of the guild to edit the rule in

ruleID String

The ID of the rule to edit

options Object

The properties to edit

Name Type Attributes Default Description
actions Array.<Object> <optional>

The actions done when the rule is violated

enabled Boolean <optional>
false

If the rule is enabled, false by default

eventType Number <optional>

The event type for the rule

exemptChannels Array.<String> <optional>

Any channels where this rule does not apply

exemptRoles Array.<String> <optional>

Any roles to which this rule does not apply

name String <optional>

The name of the rule

triggerMetadata Object <optional>

The trigger metadata for the rule

triggerType Number <optional>

The trigger type of the rule

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<AutoModerationRule>

editChannel(channelID, options, reasonopt) → {Promise.<(CategoryChannel|ForumChannel|GroupChannel|NewsChannel|NewsThreadChannel|PrivateThreadChannel|PublicThreadChannel|TextChannel|VoiceChannel)>}

Edit a channel's properties

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

options Object

The properties to edit

Name Type Attributes Description
appliedTags Array.<String> <optional>

The IDs of the set of tags that have been applied to a thread in a forum/media channel (threads created in forum/media channels only, max 5)

archived Boolean <optional>

The archive status of the channel (thread channels only)

autoArchiveDuration Number <optional>

The duration in minutes to automatically archive the thread after recent activity, either 60, 1440, 4320 or 10080 (thread channels only)

availableTags Array.<Object> <optional>

The available tags that can be applied to threads in a forum/media channel. See the official Discord API documentation entry for object structure (forum/media channels only, max 20)

bitrate Number <optional>

The bitrate of the channel (guild voice channels only)

defaultAutoArchiveDuration Number <optional>

The default duration of newly created threads in minutes to automatically archive the thread after inactivity (60, 1440, 4320, 10080) (text/news/forum/media channels only)

defaultForumLayout Number <optional>

The default forum layout type used to display posts in forum channels (forum channels only)

defaultReactionEmoji Object <optional>

The emoji to show in the add reaction button on a thread in a forum/media channel (forum/media channels only)

defaultSortOrder Number <optional>

The default sort order type used to order posts in forum/media channels (forum/media channels only)

defaultThreadRateLimitPerUser Number <optional>

The initial rateLimitPerUser to set on newly created threads in a channel (text/forum/media channels only)

flags Number <optional>

The flags for the channel combined as a bitfield (thread/forum/media channels only). Note: PINNED can only be set for threads in forum/media channels, REQUIRE_TAG can only be set for forum/media channels, and HIDE_MEDIA_DOWNLOAD_OPTIONS can only be set for media channels

icon String <optional>

The icon of the channel as a base64 data URI (group channels only). Note: base64 strings alone are not base64 data URI strings

invitable Boolean <optional>

Whether non-moderators can add other non-moderators to the channel (private thread channels only)

locked Boolean <optional>

The lock status of the channel (thread channels only)

name String <optional>

The name of the channel

nsfw Boolean <optional>

The nsfw status of the channel (guild channels only)

parentID String <optional>
<nullable>

The ID of the parent channel category for this channel (guild text/voice channels only)

permissionOverwrites Array.<Object> <optional>

An array containing permission overwrite objects

position Number <optional>

The sorting position of the channel (guild channels only)

rateLimitPerUser Number <optional>

The time in seconds a user has to wait before sending another message (0-21600) (does not affect bots or users with manageMessages/manageChannel permissions) (text/voice/stage/forum/media channels only)

rtcRegion String <optional>
<nullable>

The RTC region ID of the channel (automatic if null) (guild voice channels only)

topic String <optional>

The topic of the channel (guild text channels only)

userLimit Number <optional>

The channel user limit (guild voice channels only)

videoQualityMode Number <optional>

The camera video quality mode of the channel (guild voice channels only). 1 is auto, 2 is 720p

reason String <optional>

The reason to be displayed in audit logs

editChannelPermission(channelID, overwriteID, allow, deny, type, reasonopt) → {Promise}

Create a channel permission overwrite

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of channel

overwriteID String

The ID of the overwritten user or role (everyone role ID = guild ID)

allow BigInt

The permissions number for allowed permissions

deny BigInt

The permissions number for denied permissions

type Number

The object type of the overwrite, either 1 for "member" or 0 for "role"

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

editChannelPosition(channelID, position, optionsopt) → {Promise}

Edit a guild channel's position. Note that channel position numbers are grouped by type (category, text, voice), then sorted in ascending order (lowest number is on top).

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

position Number

The new position of the channel

options Object <optional>

Additional options when editing position

Name Type Attributes Description
lockPermissions Boolean <optional>

Whether to sync the channel's permissions with the new parent, if changing parents

parentID String <optional>

The new parent ID (category channel) for the channel that is moved

Returns:
Type:
Promise

editChannelPositions(guildID, channelPositions) → {Promise}

Edit multiple guild channels' positions. Note that channel position numbers are grouped by type (category, text, voice), then sorted in ascending order (lowest number is on top).

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

channelPositions Array.<Object>

An array of ChannelPosition

Name Type Attributes Description
id String

The ID of the channel

lockPermissions Boolean <optional>

Whether to sync the channel's permissions with the new parent, if changing parents

parentID String <optional>

The new parent ID (category channel) for the channel that is moved. For each request, only one channel can change parents

position Number

The new position of the channel

Returns:
Type:
Promise

editCommand(commandID, command) → {Promise.<ApplicationCommand>}

Edit a global application command

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
commandID String

The command ID

command Object

A command object

command.defaultPermission Boolean <optional>

[DEPRECATED] Whether the command is enabled by default when the application is added to a guild. Replaced by defaultMemberPermissions

command.description String <optional>

The command description, required for CHAT_INPUT commands

command.descriptionLocalizations Object <optional>
<nullable>

Localization directory with keys in available locales for the command description

command.dmPermission Boolean <optional>
<nullable>
true

Whether the command is available in DMs with the app

command.name String <optional>

The command name

command.nameLocalizations Object <optional>
<nullable>

Localization directory with keys in available locales for the command name

command.nsfw Boolean <optional>

Whether the command is age-restricted

command.options Array.<Object> <optional>

The application command options

Returns:
Type:
Promise.<ApplicationCommand>

Resolves with the edited application command

editCommandPermissions(guildID, commandID, permissions, reasonopt) → {Promise.<Object>}

Edits command permissions for a specific command in a guild. Note: You can only add up to 10 permission overwrites for a command.

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The guild ID

commandID String

The command id

permissions Array.<Object>

An array of permissions objects

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Object>

Resolves with a GuildApplicationCommandPermissions object.

editEmoji(options) → {Promise.<Object>}

Edit an existing emoji for this application

Overrides:
Source:
Parameters:
Name Type Description
options Object

Emoji options

Name Type Description
name String

The name of emoji

Returns:
Type:
Promise.<Object>

An emoji object

editGuild(guildID, options, reasonopt) → {Promise.<Guild>}

Edit a guild

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

options Object

The properties to edit

Name Type Attributes Description
afkChannelID String <optional>
<nullable>

The ID of the AFK voice channel

afkTimeout Number <optional>

The AFK timeout in seconds

banner String <optional>
<nullable>

The guild banner image as a base64 data URI (VIP only). Note: base64 strings alone are not base64 data URI strings

defaultNotifications Number <optional>
<nullable>

The default notification settings for the guild. 0 is "All Messages", 1 is "Only @mentions".

description String <optional>
<nullable>

The description for the guild (VIP only)

discoverySplash String <optional>
<nullable>

The guild discovery splash image as a base64 data URI (VIP only). Note: base64 strings alone are not base64 data URI strings

explicitContentFilter Number <optional>
<nullable>

The level of the explicit content filter for messages/images in the guild. 0 disables message scanning, 1 enables scanning the messages of members without roles, 2 enables scanning for all messages.

features Array.<String> <optional>

The enabled features for the guild. Note that only certain features can be toggled with the API

icon String <optional>
<nullable>

The guild icon as a base64 data URI. Note: base64 strings alone are not base64 data URI strings

name String <optional>

The name of the guild

preferredLocale String <optional>
<nullable>

Preferred "COMMUNITY" guild language used in server discovery and notices from Discord

publicUpdatesChannelID String <optional>
<nullable>

The ID of the channel where admins and moderators of "COMMUNITY" guilds receive notices from Discord

rulesChannelID String <optional>
<nullable>

The ID of the channel where "COMMUNITY" guilds display rules and/or guidelines

safetyAlertsChannelID String <optional>
<nullable>

The ID of the channel where admins and moderators of Community guilds receive safety alerts from Discord

splash String <optional>
<nullable>

The guild splash image as a base64 data URI (VIP only). Note: base64 strings alone are not base64 data URI strings

systemChannelFlags Number <optional>

The flags for the system channel

systemChannelID String <optional>
<nullable>

The ID of the system channel

verificationLevel Number <optional>
<nullable>

The guild verification level

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Guild>

editGuildCommand(guildID, commandID, command) → {Promise.<ApplicationCommand>}

Edit a guild application command

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

commandID String

The ID of the command

command Object

A command object

command.defaultPermission Boolean <optional>

[DEPRECATED] Whether the command is enabled by default when the application is added to a guild. Replaced by defaultMemberPermissions

command.description String <optional>

The command description, required for CHAT_INPUT commands

command.descriptionLocalizations Object <optional>
<nullable>

Localization directory with keys in available locales for the command description

command.name String <optional>

The command name

command.nameLocalizations Object <optional>
<nullable>

Localization directory with keys in available locales for the command name

command.nsfw Boolean <optional>

Whether the command is age-restricted

command.options Array.<Object> <optional>

The application command options

Returns:
Type:
Promise.<ApplicationCommand>

Resolves with the edited application command

editGuildDiscovery(guildID, optionsopt) → {Promise.<Object>}

Edit a guild's discovery data

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

options Object <optional>

The guild discovery data

Name Type Attributes Description
emojiDiscoverabilityEnabled Boolean <optional>

Whether guild info should be shown when emoji info is loaded

keywords Array.<String> <optional>

The discovery keywords (max 10)

primaryCategoryID String <optional>

The primary discovery category ID

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Object>

The updated guild's discovery object

editGuildEmoji(guildID, emojiID, options, reasonopt) → {Promise.<Object>}

Edit a guild emoji object

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild to edit the emoji in

emojiID String

The ID of the emoji you want to modify

options Object

Emoji options

Name Type Attributes Description
name String <optional>

The name of emoji

roles Array <optional>

An array containing authorized role IDs

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Object>

A guild emoji object

editGuildMember(guildID, memberID, options, reasonopt) → {Promise.<Member>}

Edit a guild member

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

memberID String

The ID of the member (you can use "@me" if you are only editing the bot user's nickname)

options Object

The properties to edit

Name Type Attributes Description
channelID String <optional>
<nullable>

The ID of the voice channel to move the member to (must be in voice). Set to null to disconnect the member

communicationDisabledUntil Date <optional>
<nullable>

When the user's timeout should expire. Set to null to instantly remove timeout

deaf Boolean <optional>

Server deafen the member

flags Number <optional>

The user's flags - OR the BYPASSES_VERIFICATION flag (4) to make the member exempt from verification requirements, NAND the flag to make the member not exempt

mute Boolean <optional>

Server mute the member

nick String <optional>

Set the member's server nickname, "" to remove

roles Array.<String> <optional>

The array of role IDs the member should have

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Member>

editGuildOnboarding(guildID, options, reasonopt) → {Promise.<Object>}

Edit a guild's onboarding settings

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

options Object

The properties to edit

Name Type Description
defaultChannelIDs Array.<String>

The ID of channels that members are opted into automatically

enabled Boolean

Whether onboarding should be enabled or not for the guild

mode Number

The onboarding mode, 0 for default, 1 for advanced

prompts Array.<Object>

The prompts shown during the onboarding process

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Object>

The guild's onboarding settings

editGuildScheduledEvent(guildID, eventID, event, reasonopt) → {Promise.<GuildScheduledEvent>}

Edit a guild scheduled event

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The guild ID where the event will be edited

eventID String

The guild scheduled event ID to be edited

event Object

The new guild scheduled event object

Name Type Attributes Description
channelID String <optional>

The channel ID of the event. If updating entityType to 3 (external), this must be set to null

description String <optional>

The description of the event

entityMetadata Object <optional>

The entity metadata for the scheduled event. This is required if updating entityType to 3 (external)

Name Type Attributes Description
location String <optional>

Location of the event. This is required if updating entityType to 3 (external)

entityType Number <optional>

The entity type of the scheduled event

image String <optional>

Base 64 encoded image for the event

name String <optional>

The name of the event

privacyLevel String <optional>

The privacy level of the event

recurrenceRule Object <optional>
<nullable>

The definitions for how often this event should recur. Properties can be camelCase (preferred) or snake_case

scheduledEndTime Date <optional>

The time when the scheduled event is scheduled to end. This is required if updating entityType to 3 (external)

scheduledStartTime Date <optional>

The time the event will start

status Number <optional>

The status of the scheduled event

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<GuildScheduledEvent>

editGuildSoundboardSound(guildID, soundID, options) → {Promise.<SoundboardSound>}

Edit a guild soundboard sound

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The guild ID where the sound will be edited

soundID String

The ID of the soundboard sound

options Object

The properties to edit

Name Type Attributes Description
emojiID String <optional>
<nullable>

The ID of the relating custom emoji (mutually exclusive with options.emojiName)

emojiName String <optional>
<nullable>

The name of the relating default emoji (mutually exclusive with options.emojiID)

name String <optional>

The name of the soundboard sound (2-32 characters)

volume Number <optional>
<nullable>

The volume of the soundboard sound, between 0 and 1

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<SoundboardSound>

editGuildSticker(stickerID, options, reasonopt) → {Promise.<Object>}

Edit a guild sticker

Overrides:
Source:
Parameters:
Name Type Attributes Description
stickerID String

The ID of the sticker

options Object

The properties to edit

Name Type Attributes Description
description String <optional>

The description of the sticker

name String <optional>

The name of the sticker

tags String <optional>

The Discord name of a unicode emoji representing the sticker's expression

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Object>

A sticker object

editGuildTemplate(guildID, code, options) → {Promise.<GuildTemplate>}

Edit a guild template

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

code String

The template code

options Object

The properties to edit

Name Type Attributes Description
description String <optional>
<nullable>

The description for the template. Set to null to remove the description

name String <optional>

The name of the template

Returns:
Type:
Promise.<GuildTemplate>

editGuildVanity(guildID, codenullable) → {Promise.<Object>}

Modify a guild's vanity code

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

code String <nullable>

The new vanity code

Returns:
Type:
Promise.<Object>

editGuildVoiceState(guildID, options, userIDopt) → {Promise}

Update a user's voice state - See caveats

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
guildID String

The ID of the guild

options Object

The properties to edit

Name Type Attributes Description
channelID String

The ID of the channel the user is currently in

requestToSpeakTimestamp Date <optional>
<nullable>

Sets the user's request to speak - this can only be used when the userID param is "@me"

suppress Boolean <optional>

Toggles the user's suppress state

userID String <optional>
"@me"

The user ID of the user to update

Returns:
Type:
Promise

editGuildWelcomeScreen(guildID, optionsopt) → {Promise.<Object>}

Edit a guild welcome screen

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

options Object <optional>

The properties to edit

Name Type Attributes Description
description String <optional>
<nullable>

The description in the welcome screen

enabled Boolean <optional>

Whether the welcome screen is enabled

welcomeChannels Array.<Object> <optional>

The list of channels in the welcome screen as an array

Name Type Attributes Description
channelID String

The channel ID of the welcome channel

description String

The description of the welcome channel

emojiID String <nullable>

The emoji ID of the welcome channel

emojiName String <nullable>

The emoji name of the welcome channel

Returns:
Type:
Promise.<Object>

editGuildWidget(guildID, options) → {Promise.<Object>}

Modify a guild's widget

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

options Object

The widget object to modify (https://discord.com/developers/docs/resources/guild#modify-guild-widget)

Name Type Attributes Description
channelID String <optional>
<nullable>

The channel ID for the guild widget

enabled Boolean <optional>

Whether the guild widget is enabled

reason String <optional>
<nullable>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Object>

A guild widget object

editMessage(channelID, messageID, content) → {Promise.<Message>}

Edit a message

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the channel

messageID String

The ID of the message

content String | Array | Object

A string, array of strings, or object. If an object is passed:

Name Type Attributes Description
allowedMentions Object <optional>

A list of mentions to allow (overrides default)

Name Type Attributes Description
everyone Boolean <optional>

Whether or not to allow @everyone/@here

roles Boolean | Array.<String> <optional>

Whether or not to allow all role mentions, or an array of specific role mentions to allow

users Boolean | Array.<String> <optional>

Whether or not to allow all user mentions, or an array of specific user mentions to allow

attachments Array.<Object> <optional>

An array of attachment objects that will be appended to the message, including new files. Only the provided files will be appended

Name Type Attributes Description
description String <optional>

The description of the file

filename String <optional>

The name of the file. This is not required if you are attaching a new file

id Number | String

The ID of the file. If you are attaching a new file, this would be the index of the file

components Array.<Object> <optional>

An array of component objects

Name Type Attributes Description
custom_id String <optional>

The ID of the component (type 2 style 0-4 and type 3,5,6,7,8 only)

disabled Boolean <optional>

Whether the component is disabled (type 2 and 3,5,6,7,8 only)

emoji Object <optional>

The emoji to be displayed in the component (type 2)

label String <optional>

The label to be displayed in the component (type 2)

default_values Array.<Object> <optional>

default values for the component (type 5,6,7,8 only)

Name Type Attributes Description
id String <optional>

id of a user, role, or channel

type String <optional>

type of value that id represents (user, role, or channel)

max_values Number <optional>

The maximum number of items that can be chosen (1-25, default 1)

min_values Number <optional>

The minimum number of items that must be chosen (0-25, default 1)

options Array.<Object> <optional>

The options for this component (type 3 only)

Name Type Attributes Description
default Boolean <optional>

Whether this option should be the default value selected

description String <optional>

The description for this option

emoji Object <optional>

The emoji to be displayed in this option

label String

The label for this option

value Number | String

The value for this option

placeholder String <optional>

The placeholder text for the component when no option is selected (type 3,5,6,7,8 only)

style Number <optional>

The style of the component (type 2 only) - If 0-4, custom_id is required; if 5, url is required

type Number

The type of component - If 1, it is a collection and a components array (nested) is required; if 2, it is a button; if 3, it is a string select; if 5, it is a user select; if 6, it is a role select; if 7, it is a mentionable select; if 8, it is a channel select

url String <optional>

The URL that the component should open for users (type 2 style 5 only)

content String <optional>

A content string

embed Object <optional>

[DEPRECATED] An embed object. See the official Discord API documentation entry for object structure

embeds Array.<Object> <optional>

An array of embed objects. See the official Discord API documentation entry for object structure

file Object | Array.<Object> <optional>

A file object (or an Array of them)

Name Type Description
file Buffer

A buffer containing file data

name String

What to name the file

flags Number <optional>

A number representing the flags to apply to the message (only SUPPRESS_EMBEDS and SUPPRESS_NOTIFICATIONS)

Returns:
Type:
Promise.<Message>

editNickname(guildID, nick, reasonopt) → {Promise}

[DEPRECATED] Edit the bot's nickname in a guild

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

nick String

The nickname

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

editRole(guildID, roleID, options, reasonopt) → {Promise.<Role>}

Edit a guild role

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild the role is in

roleID String

The ID of the role

options Object

The properties to edit

Name Type Attributes Description
color Number <optional>

The hex color of the role, in number form (ex: 0x3da5b3 or 4040115)

hoist Boolean <optional>

Whether to hoist the role in the user list or not

icon String <optional>

The role icon as a base64 data URI

mentionable Boolean <optional>

Whether the role is mentionable or not

name String <optional>

The name of the role

permissions BigInt | Number | String | Permission <optional>

The role permissions

unicodeEmoji String <optional>

The role's unicode emoji

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Role>

editRoleConnectionMetadataRecords(data) → {Promise.<Array.<Object>>}

Update the role connection metadata for the application

Overrides:
Source:
Parameters:
Name Type Description
data Array.<Object>

An array of role connection metadata objects. See the official Discord API documentation entry for object structure

Returns:
Type:
Promise.<Array.<Object>>

An array of role connection metadata objects

editRolePosition(guildID, roleID, position) → {Promise}

Edit a guild role's position. Note that role position numbers are highest on top and lowest at the bottom.

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild the role is in

roleID String

The ID of the role

position Number

The new position of the role

Returns:
Type:
Promise

editSelf(options, guildIDopt, nullable) → {Promise.<(ExtendedUser|GuildMember)>}

Edit properties of the bot user or a guild member

Overrides:
Source:
Parameters:
Name Type Attributes Description
options Object

The properties to edit

Name Type Attributes Description
avatar String <optional>
<nullable>

The new avatar as a base64 data URI. Note: base64 strings alone are not base64 data URI strings

banner String <optional>
<nullable>

The new banner as a base64 data URI. Note: base64 strings alone are not base64 data URI strings

username String <optional>
<nullable>

The new global username (only for bot user, ignored if guildID is provided)

nick String <optional>
<nullable>

The new nickname (only for guild member when guildID is provided)

bio String <optional>
<nullable>

The new bio/about me (only for guild member when guildID is provided)

guildID String <optional>
<nullable>

The ID of the guild to edit the member in (optional). If provided, edits guild member properties (nick, bio, avatar, banner). If omitted, edits the bot user globally.

Returns:
Type:
Promise.<(ExtendedUser|GuildMember)>

Resolves with the updated user (global) or guild member object

editStageInstance(channelID, options) → {Promise.<StageInstance>}

Update a stage instance

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the stage channel associated with the instance

options Object

The properties to edit

Name Type Attributes Description
privacyLevel Number <optional>

The privacy level of the stage instance. 1 is public, 2 is guild only

topic String <optional>

The stage instance topic

Returns:
Type:
Promise.<StageInstance>

editStatus(statusopt, activitiesopt)

Update the bot's status on all guilds

Overrides:
Source:
Parameters:
Name Type Attributes Description
status String <optional>

Sets the bot's status, either "online", "idle", "dnd", or "invisible"

activities Array | Object <optional>

Sets the bot's activities. A single activity object is also accepted for backwards compatibility

Name Type Attributes Description
name String <optional>

The name of the activity. Note: When setting a custom status, use state instead

type Number

The type of the activity. 0 is playing, 1 is streaming (Twitch only), 2 is listening, 3 is watching, 4 is custom status, 5 is competing in

url String <optional>

The URL of the activity

state String <optional>

The state of the activity. This is the text to be displayed as the bots custom status

editWebhook(webhookID, options, tokenopt, reasonopt) → {Promise.<Object>}

Edit a webhook

Overrides:
Source:
Parameters:
Name Type Attributes Description
webhookID String

The ID of the webhook

options Object

Webhook options

Name Type Attributes Description
avatar String <optional>

The new default avatar as a base64 data URI. Note: base64 strings alone are not base64 data URI strings

channelID String <optional>

The new channel ID where webhooks should be sent to

name String <optional>

The new default name

token String <optional>

The token of the webhook, used instead of the Bot Authorization token

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Object>

Resolves with a webhook object

editWebhookMessage(webhookID, token, messageID, options) → {Promise.<Message>}

Edit a webhook message

Overrides:
Source:
Parameters:
Name Type Description
webhookID String

The ID of the webhook

token String

The token of the webhook

messageID String

The ID of the message

options Object

Webhook message edit options

Name Type Attributes Description
allowedMentions Object <optional>

A list of mentions to allow (overrides default)

Name Type Attributes Description
everyone Boolean <optional>

Whether or not to allow @everyone/@here

repliedUser Boolean <optional>

Whether or not to mention the author of the message being replied to

roles Boolean | Array.<String> <optional>

Whether or not to allow all role mentions, or an array of specific role mentions to allow

users Boolean | Array.<String> <optional>

Whether or not to allow all user mentions, or an array of specific user mentions to allow

attachments Array.<Object> <optional>

An array of attachment objects that will be appended to the message, including new files. Only the provided files will be appended

Name Type Attributes Description
description String <optional>

The description of the file

filename String <optional>

The name of the file. This is not required if you are attaching a new file

id Number | String

The ID of the file. If you are attaching a new file, this would be the index of the file

components Array.<Object> <optional>

An array of component objects

Name Type Attributes Description
custom_id String <optional>

The ID of the component (type 2 style 0-4 and type 3,5,6,7,8 only)

disabled Boolean <optional>

Whether the component is disabled (type 2 and 3,5,6,7,8 only)

emoji Object <optional>

The emoji to be displayed in the component (type 2)

label String <optional>

The label to be displayed in the component (type 2)

default_values Array.<Object> <optional>

default values for the component (type 5,6,7,8 only)

Name Type Attributes Description
id String <optional>

id of a user, role, or channel

type String <optional>

type of value that id represents (user, role, or channel)

max_values Number <optional>

The maximum number of items that can be chosen (1-25, default 1)

min_values Number <optional>

The minimum number of items that must be chosen (0-25, default 1)

options Array.<Object> <optional>

The options for this component (type 3 only)

Name Type Attributes Description
default Boolean <optional>

Whether this option should be the default value selected

description String <optional>

The description for this option

emoji Object <optional>

The emoji to be displayed in this option

label String

The label for this option

value Number | String

The value for this option

placeholder String <optional>

The placeholder text for the component when no option is selected (type 3,5,6,7,8 only)

style Number <optional>

The style of the component (type 2 only) - If 0-4, custom_id is required; if 5, url is required

type Number

The type of component - If 1, it is a collection and a components array (nested) is required; if 2, it is a button; if 3, it is a string select; if 5, it is a user select; if 6, it is a role select; if 7, it is a mentionable select; if 8, it is a channel select

url String <optional>

The URL that the component should open for users (type 2 style 5 only)

content String <optional>

A content string

embed Object <optional>

[DEPRECATED] An embed object. See the official Discord API documentation entry for object structure

embeds Array.<Object> <optional>

An array of embed objects. See the official Discord API documentation entry for object structure

file Object | Array.<Object> <optional>

A file object (or an Array of them)

Name Type Description
file Buffer

A buffer containing file data

name String

What to name the file

Returns:
Type:
Promise.<Message>

endPoll(channelID, messageID) → {Promise.<Message>}

Immediately end a poll. Note: You cannot end polls created by another user.

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the channel

messageID String

The ID of the message that the poll is in

Returns:
Type:
Promise.<Message>

executeSlackWebhook(webhookID, token, options) → {Promise}

Execute a slack-style webhook

Overrides:
Source:
Parameters:
Name Type Description
webhookID String

The ID of the webhook

token String

The token of the webhook

options Object

Slack webhook options

Name Type Attributes Default Description
auth Boolean <optional>
false

Whether or not to authenticate with the bot token.

threadID String <optional>

The ID of the thread channel in the webhook's channel to send the message to

wait Boolean <optional>
false

Whether to wait for the server to confirm the message create or not

Returns:
Type:
Promise

executeWebhook(webhookID, token, options) → {Promise.<?Message>}

Execute a webhook

Overrides:
Source:
Parameters:
Name Type Description
webhookID String

The ID of the webhook

token String

The token of the webhook

options Object

Webhook execution options

Name Type Attributes Default Description
allowedMentions Object <optional>

A list of mentions to allow (overrides default)

Name Type Attributes Description
everyone Boolean <optional>

Whether or not to allow @everyone/@here

roles Boolean | Array.<String> <optional>

Whether or not to allow all role mentions, or an array of specific role mentions to allow

users Boolean | Array.<String> <optional>

Whether or not to allow all user mentions, or an array of specific user mentions to allow

attachments Array.<Object> <optional>

An array of attachment objects that will be appended to the message, including new files. Only the provided files will be appended

Name Type Attributes Description
description String <optional>

The description of the file

filename String <optional>

The name of the file. This is not required if you are attaching a new file

id Number | String

The ID of the file. If you are attaching a new file, this would be the index of the file

auth Boolean <optional>
false

Whether or not to authenticate with the bot token.

avatarURL String <optional>

A URL for a custom avatar, defaults to webhook default avatar if not specified

components Array.<Object> <optional>

An array of component objects

Name Type Attributes Description
custom_id String <optional>

The ID of the component (type 2 style 0-4 and type 3,5,6,7,8 only)

disabled Boolean <optional>

Whether the component is disabled (type 2 and 3,5,6,7,8 only)

emoji Object <optional>

The emoji to be displayed in the component (type 2)

label String <optional>

The label to be displayed in the component (type 2)

default_values Array.<Object> <optional>

default values for the component (type 5,6,7,8 only)

Name Type Attributes Description
id String <optional>

id of a user, role, or channel

type String <optional>

type of value that id represents (user, role, or channel)

max_values Number <optional>

The maximum number of items that can be chosen (1-25, default 1)

min_values Number <optional>

The minimum number of items that must be chosen (0-25, default 1)

options Array.<Object> <optional>

The options for this component (type 3 only)

Name Type Attributes Description
default Boolean <optional>

Whether this option should be the default value selected

description String <optional>

The description for this option

emoji Object <optional>

The emoji to be displayed in this option

label String

The label for this option

value Number | String

The value for this option

placeholder String <optional>

The placeholder text for the component when no option is selected (type 3,5,6,7,8 only)

style Number <optional>

The style of the component (type 2 only) - If 0-4, custom_id is required; if 5, url is required

type Number

The type of component - If 1, it is a collection and a components array (nested) is required; if 2, it is a button; if 3, it is a string select; if 5, it is a user select; if 6, it is a role select; if 7, it is a mentionable select; if 8, it is a channel select

url String <optional>

The URL that the component should open for users (type 2 style 5 only)

content String <optional>

A content string

embed Object <optional>

An embed object. See the official Discord API documentation entry for object structure

embeds Array.<Object> <optional>

An array of embed objects. See the official Discord API documentation entry for object structure

file Object | Array.<Object> <optional>

A file object (or an Array of them)

Name Type Description
file Buffer

A buffer containing file data

name String

What to name the file

flags Number <optional>

Flags to execute the webhook with, 64 for ephemeral (Interaction webhooks only)

poll Object <optional>

A poll object. See the official Discord API documentation entry for object structure

threadID String <optional>

The ID of the thread channel in the webhook's channel to send the message to

tts Boolean <optional>
false

Whether the message should be a TTS message or not

username String <optional>

A custom username, defaults to webhook default username if not specified

wait Boolean <optional>
false

Whether to wait for the server to confirm the message create or not

Returns:
Type:
Promise.<?Message>

followChannel(channelID, reasonopt) → {Object}

Follow a NewsChannel in another channel. This creates a webhook in the target channel

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the NewsChannel

options.webhookChannelID String

The ID of the target channel

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Object

An object containing the NewsChannel's ID and the new webhook's ID

getActiveGuildThreads(guildID) → {Promise.<Object>}

Get all active threads in a guild

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

Returns:
Type:
Promise.<Object>

An object containing an array of threads and an array of members

getArchivedThreads(channelID, type, optionsopt) → {Promise.<Object>}

Get all archived threads in a channel

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

type String

The type of thread channel, either "public" or "private"

options Object <optional>

Additional options when requesting archived threads

Name Type Attributes Description
before Date <optional>

List of threads to return before the timestamp

limit Number <optional>

Maximum number of threads to return

Returns:
Type:
Promise.<Object>

An object containing an array of threads, an array of members and whether the response hasMore threads that could be returned in a subsequent call

getAutoModerationRule(guildID, ruleID) → {Promise.<AutoModerationRule>}

Get an existing auto moderation rule

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild to get the rule from

ruleID String

The ID of the rule to get

Returns:
Type:
Promise.<AutoModerationRule>

getAutoModerationRules(guildID) → {Promise.<Array.<AutoModerationRule>>}

Get a guild's auto moderation rules

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild to get the rules of

Returns:
Type:
Promise.<Array.<AutoModerationRule>>

getBotGateway() → {Promise.<Object>}

Get general and bot-specific info on connecting to the Discord gateway (e.g. connection ratelimit)

Overrides:
Source:
Returns:
Type:
Promise.<Object>

Resolves with an object containing gateway connection info

getChannel(channelID) → {CategoryChannel|DMChannel|ForumChannel|NewsChannel|NewsThreadChannel|PrivateThreadChannel|PublicThreadChannel|TextChannel|VoiceChannel}

Get a Channel object from a channel ID

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the channel

getChannelInvites(channelID) → {Promise.<Array.<Invite>>}

Get all invites in a channel

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the channel

Returns:
Type:
Promise.<Array.<Invite>>

getChannelWebhooks(channelID) → {Promise.<Array.<Object>>}

Get all the webhooks in a channel

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the channel to get webhooks for

Returns:
Type:
Promise.<Array.<Object>>

Resolves with an array of webhook objects

getCommand(commandID) → {Promise.<Object>}

Get a global application command

Overrides:
Source:
Parameters:
Name Type Description
commandID String

The command id

Returns:
Type:
Promise.<Object>

Resolves with an application command object.

getCommandPermissions(guildID, commandID) → {Promise.<Object>}

Get the a guild's application command permissions

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The guild ID

commandID String

The command id

Returns:
Type:
Promise.<Object>

Resolves with a guild application command permissions object.

getCommands() → {Promise.<Array.<Object>>}

Get the global application commands

Overrides:
Source:
Returns:
Type:
Promise.<Array.<Object>>

Resolves with an array of application command objects.

getDMChannel(userID) → {Promise.<DMChannel>}

Get a DM channel with a user, or create one if it does not exist

Overrides:
Source:
Parameters:
Name Type Description
userID String

The ID of the user

Returns:
Type:
Promise.<DMChannel>

getDiscoveryCategories() → {Promise.<Array.<Object>>}

Get a list of discovery categories

Overrides:
Source:
Returns:
Type:
Promise.<Array.<Object>>

getEmoji(emojiID) → {Promise.<Object>}

Get an emoji for this application

Overrides:
Source:
Parameters:
Name Type Description
emojiID String

The ID of the emoji

Returns:
Type:
Promise.<Object>

Resolves with an emoji object

getEmojiGuild(emojiID) → {Promise.<Guild>}

Get a guild from the guild's emoji ID

Overrides:
Source:
Parameters:
Name Type Description
emojiID String

The ID of the emoji

Returns:
Type:
Promise.<Guild>

getEmojis() → {Promise.<Object>}

Get the emojis for this application

Overrides:
Source:
Returns:
Type:
Promise.<Object>

Resolves with an object that contains a property "items" which is an array of emoji objects

getGateway() → {Promise.<Object>}

Get info on connecting to the Discord gateway

Overrides:
Source:
Returns:
Type:
Promise.<Object>

Resolves with an object containing gateway connection info

getGuildAuditLog(guildID, optionsopt) → {Promise.<{entries: Array.<GuildAuditLogEntry>, integrations: Array.<PartialIntegration>, threads: Array.<(NewsThreadChannel|PrivateThreadChannel|PublicThreadChannel)>, users: Array.<User>, webhooks: Array.<Webhook>}>}

Get the audit log for a guild

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild to get audit logs for

options Object <optional>

Options for the request. If this is a number ([DEPRECATED] behavior), it is treated as options.limit

Name Type Attributes Default Description
actionType Number <optional>

Filter entries by action type

before String <optional>

Get entries before this entry ID

limit Number <optional>
50

The maximum number of entries to return

userID String <optional>

Filter entries by the user that performed the action

Returns:
Type:
Promise.<{entries: Array.<GuildAuditLogEntry>, integrations: Array.<PartialIntegration>, threads: Array.<(NewsThreadChannel|PrivateThreadChannel|PublicThreadChannel)>, users: Array.<User>, webhooks: Array.<Webhook>}>

getGuildAuditLogs(guildID, limitopt, beforeopt, actionTypeopt, userIDopt) → {Promise.<{users: Array.<User>, entries: Array.<GuildAuditLogEntry>, integrations: Array.<PartialIntegration>, webhooks: Array.<Webhook>}>}

[DEPRECATED] Get the audit log for a guild. Use getGuildAuditLog instead

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
guildID String

The ID of the guild to get audit logs for

limit Object <optional>
50

The maximum number of entries to return

before String <optional>

Get entries before this entry ID

actionType Number <optional>

Filter entries by action type

userID String <optional>

Filter entries by the user that performed the action

Returns:
Type:
Promise.<{users: Array.<User>, entries: Array.<GuildAuditLogEntry>, integrations: Array.<PartialIntegration>, webhooks: Array.<Webhook>}>

getGuildBan(guildID, userID) → {Promise.<Object>}

Get a ban from the ban list of a guild

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

userID String

The ID of the banned user

Returns:
Type:
Promise.<Object>

Resolves with {reason: String, user: User}

(async) getGuildBans(guildID, optionsopt) → {Promise.<Array.<Object>>}

Get the ban list of a guild

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

options Object <optional>

Options for the request

Name Type Attributes Default Description
after String <optional>

Only get users after given user ID

before String <optional>

Only get users before given user ID

limit Number <optional>
1000

The maximum number of users to return

Returns:
Type:
Promise.<Array.<Object>>

Resolves with an array of { reason: String, user: User }

getGuildCommand(guildID, commandID) → {Promise.<Object>}

Get a guild application command

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The guild ID

commandID String

The command id

Returns:
Type:
Promise.<Object>

Resolves with an command object.

getGuildCommandPermissions(guildID) → {Promise.<Array.<Object>>}

Get the all of a guild's application command permissions

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The guild ID

Returns:
Type:
Promise.<Array.<Object>>

Resolves with an array of guild application command permissions objects.

getGuildCommands(guildID) → {Promise.<Array.<Object>>}

Get a guild's application commands

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The guild ID

Returns:
Type:
Promise.<Array.<Object>>

Resolves with an array of command objects.

getGuildDiscovery(guildID) → {Promise.<Object>}

Get a guild's discovery object

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

Returns:
Type:
Promise.<Object>

getGuildIntegrations(guildID) → {Promise.<Array.<GuildIntegration>>}

Get a list of integrations for a guild

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

Returns:
Type:
Promise.<Array.<GuildIntegration>>

getGuildInvites(guildID) → {Promise.<Array.<Invite>>}

Get all invites in a guild

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

Returns:
Type:
Promise.<Array.<Invite>>

getGuildOnboarding(guildID) → {Promise.<Object>}

Get a guild's onboarding settings

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

Returns:
Type:
Promise.<Object>

The guild's onboarding settings

getGuildPreview(guildID) → {Promise.<Object>}

Get a guild preview for a guild. Only available for community guilds.

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

Returns:
Type:
Promise.<Object>

getGuildScheduledEventUsers(guildID, eventID, optionsopt)

Get a list of users subscribed to a guild scheduled event

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

eventID String

The ID of the event

options Object <optional>

Options for the request

Name Type Attributes Default Description
after String <optional>

Get users after this user ID. If options.before is provided, this will be ignored. Fetching users in between before and after is not supported

before String <optional>

Get users before this user ID

limit Number <optional>
100

The number of users to get (max 100). Pagination will only work if one of options.after or options.after is also provided

withMember Boolean <optional>

Include guild member data

Returns:

getGuildScheduledEvents(guildID, optionsopt) → {Promise.<Array.<GuildScheduledEvent>>}

Get a guild's scheduled events

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

options Object <optional>

Options for the request

Name Type Attributes Description
withUserCount Boolean <optional>

Whether to include the number of users subscribed to each event

Returns:
Type:
Promise.<Array.<GuildScheduledEvent>>

getGuildSoundboardSound(guildID, soundID) → {Promise.<SoundboardSound>}

Get a guild soundboard sound. Not to be confused with getGuildSoundboardSounds, which gets all soundboard sounds in a guild

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The guild ID where the sound was created

soundID String

The ID of the soundboard sound

Returns:
Type:
Promise.<SoundboardSound>

getGuildSoundboardSounds(guildID) → {Promise.<Array.<SoundboardSound>>}

Get a guild's soundboard sounds. Not to be confused with getGuildSoundboardSound, which gets a specified soundboard sound

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

Returns:
Type:
Promise.<Array.<SoundboardSound>>

getGuildTemplate(code) → {Promise.<GuildTemplate>}

Get a guild template

Overrides:
Source:
Parameters:
Name Type Description
code String

The template code

Returns:
Type:
Promise.<GuildTemplate>

getGuildTemplates(guildID) → {Promise.<Array.<GuildTemplate>>}

Get a guild's templates

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

Returns:
Type:
Promise.<Array.<GuildTemplate>>

getGuildVanity(guildID) → {Promise}

Returns the vanity url of the guild

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

Returns:
Type:
Promise

getGuildVoiceState(guildID, userIDopt) → {Promise.<VoiceState>}

Get a guild user's voice state

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
guildID String

The ID of the guild

userID String <optional>
"@me"

The ID of the user

Returns:
Type:
Promise.<VoiceState>

getGuildWebhooks(guildID) → {Promise.<Array.<Object>>}

Get all the webhooks in a guild

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild to get webhooks for

Returns:
Type:
Promise.<Array.<Object>>

Resolves with an array of webhook objects

getGuildWelcomeScreen(guildID) → {Promise.<Object>}

Get the welcome screen of a Community guild, shown to new members

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild to get the welcome screen for

Returns:
Type:
Promise.<Object>

getGuildWidget(guildID) → {Promise.<Object>}

Get a guild's widget object

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

Returns:
Type:
Promise.<Object>

A guild widget object

getGuildWidgetImageURL(guildID, styleopt) → {String}

Get a guild's widget image

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
guildID String

The ID of the guild

style String <optional>
"shield"

The style of widget image. Either shield, banner1, banner2, banner3, or banner4.

Returns:
Type:
String

The widget image link

getGuildWidgetSettings(guildID) → {Promise.<Object>}

Get a guild's widget settings object. Requires MANAGE_GUILD permission

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

Returns:
Type:
Promise.<Object>

A guild widget setting object

getInvite(inviteID, withCountsopt, withExpirationopt, guildScheduledEventIDopt) → {Promise.<Invite>}

Get info on an invite

Overrides:
Source:
Parameters:
Name Type Attributes Description
inviteID String

The ID of the invite

withCounts Boolean <optional>

Whether to fetch additional invite info or not (approximate member counts, approximate presences, channel counts, etc.)

withExpiration Boolean <optional>

Whether to fetch the expiration time or not

guildScheduledEventID String <optional>

The guild scheduled event to include with the invite

Returns:
Type:
Promise.<Invite>

getJoinedPrivateArchivedThreads(channelID, optionsopt) → {Promise.<Object>}

Get joined private archived threads in a channel

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

options Object <optional>

Additional options when requesting archived threads

Name Type Attributes Description
before Date <optional>

List of threads to return before the timestamp

limit Number <optional>

Maximum number of threads to return

Returns:
Type:
Promise.<Object>

An object containing an array of threads, an array of members and whether the response hasMore threads that could be returned in a subsequent call

getMessage(channelID, messageID) → {Promise.<Message>}

Get a previous message in a channel

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the channel

messageID String

The ID of the message

Returns:
Type:
Promise.<Message>

getMessageReaction(channelID, messageID, reaction, optionsopt, beforeopt, afteropt) → {Promise.<Array.<User>>}

Get a list of users who reacted with a specific reaction

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

messageID String

The ID of the message

reaction String

The reaction (Unicode string if Unicode emoji, emojiName:emojiID if custom emoji)

options Object <optional>

Options for the request. If this is a number ([DEPRECATED] behavior), it is treated as options.limit

Name Type Attributes Default Description
after String <optional>

Get users after this user ID

limit Number <optional>
100

The maximum number of users to get

type Number <optional>
0

The type of reaction (0 for normal, 1 for burst)

before String <optional>

[DEPRECATED] Get users before this user ID. Discord no longer supports this parameter

after String <optional>

[DEPRECATED] Get users after this user ID

Returns:
Type:
Promise.<Array.<User>>

(async) getMessages(channelID, optionsopt, beforeopt, afteropt, aroundopt) → {Promise.<Array.<Message>>}

Get previous messages in a channel

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

options Object <optional>

Options for the request. If this is a number ([DEPRECATED] behavior), it is treated as options.limit

Name Type Attributes Default Description
after String <optional>

Get messages after this message ID

around String <optional>

Get messages around this message ID (does not work with limit > 100)

before String <optional>

Get messages before this message ID

limit Number <optional>
50

The max number of messages to get

before String <optional>

[DEPRECATED] Get messages before this message ID

after String <optional>

[DEPRECATED] Get messages after this message ID

around String <optional>

[DEPRECATED] Get messages around this message ID (does not work with limit > 100)

Returns:
Type:
Promise.<Array.<Message>>

getNitroStickerPacks() → {Promise.<Object>}

Get the list of sticker packs available to Nitro subscribers

Overrides:
Source:
Returns:
Type:
Promise.<Object>

An object whichs contains a value which contains an array of sticker packs

getOAuthApplication() → {Promise.<Object>}

Get data on the bot's OAuth2 application

Overrides:
Source:
Returns:
Type:
Promise.<Object>

The bot's application data. Refer to the official Discord API documentation entry for object structure

getPins(channelID, optionsopt) → {Promise.<{hasMore: Boolean, items: Array.<{pinnedAt: Number, message: Message}>}>}

Get pinned messages in a channel

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

options Object <optional>

The options to use to get pinned messages

Name Type Attributes Default Description
before Date <optional>

Get pinned messages before this date

limit Number <optional>
50

The max number of pinned messages to get (1-50, default 50)

Returns:
Type:
Promise.<{hasMore: Boolean, items: Array.<{pinnedAt: Number, message: Message}>}>

An object containing hasMore (Boolean, true if there are more pins available), and items which is an array of objects containing pinnedAt (Date of when the message was pinned) and message (the pinned message)

getPollAnswerVoters(channelID, messageID, answerID, optionsopt) → {Promise.<Array.<User>>}

Get a list of users that voted for a specific poll answer

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

messageID String

The ID of the message that the poll is in

answerID Number

The ID of the answer to get voters for

options Object <optional>

Options for the request

Name Type Attributes Default Description
after String <optional>

Get users after this user ID

limit Number <optional>
25

The max number of users to get

Returns:
Type:
Promise.<Array.<User>>

An array of users who voted for this answer

getPruneCount(guildID, optionsopt) → {Promise.<Number>}

Get the prune count for a guild

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

options Number <optional>

The options to use to get number of prune members

Name Type Attributes Default Description
days Number <optional>
7

The number of days of inactivity to prune for

includeRoles Array.<String> <optional>

An array of role IDs that members must have to be considered for pruning

Returns:
Type:
Promise.<Number>

Resolves with the number of members that would be pruned

getRESTChannel(channelID) → {Promise.<(CategoryChannel|DMChannel|ForumChannel|GroupChannel|NewsChannel|NewsThreadChannel|PrivateThreadChannel|PublicThreadChannel|StageChannel|TextChannel|VoiceChannel)>}

Get a channel's data via the REST API. REST mode is required to use this endpoint.

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the channel

getRESTGuild(guildID, withCountsopt) → {Promise.<Guild>}

Get a guild's data via the REST API. REST mode is required to use this endpoint.

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
guildID String

The ID of the guild

withCounts Boolean <optional>
false

Whether the guild object will have approximateMemberCount and approximatePresenceCount

Returns:
Type:
Promise.<Guild>

getRESTGuildChannels(guildID) → {Promise.<Array.<(CategoryChannel|ForumChannel|NewsChannel|StageChannel|TextChannel|VoiceChannel)>>}

Get a guild's channels via the REST API. REST mode is required to use this endpoint.

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

getRESTGuildEmoji(guildID, emojiID) → {Promise.<Object>}

Get a guild emoji via the REST API. REST mode is required to use this endpoint.

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

emojiID String

The ID of the emoji

Returns:
Type:
Promise.<Object>

An emoji object

getRESTGuildEmojis(guildID) → {Promise.<Array.<Object>>}

Get a guild's emojis via the REST API. REST mode is required to use this endpoint.

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

Returns:
Type:
Promise.<Array.<Object>>

An array of guild emoji objects

getRESTGuildMember(guildID, memberID) → {Promise.<Member>}

Get a guild's members via the REST API. REST mode is required to use this endpoint.

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

memberID String

The ID of the member

Returns:
Type:
Promise.<Member>

getRESTGuildMembers(guildID, optionsopt, afteropt) → {Promise.<Array.<Member>>}

Get a guild's members via the REST API. REST mode is required to use this endpoint.

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

options Object <optional>

Options for the request. If this is a number ([DEPRECATED] behavior), it is treated as options.limit

Name Type Attributes Default Description
after String <optional>

The highest user ID of the previous page

limit Number <optional>
1

The max number of members to get (1 to 1000)

after String <optional>

[DEPRECATED] The highest user ID of the previous page

Returns:
Type:
Promise.<Array.<Member>>

getRESTGuildRole(guildID, roleID) → {Promise.<Role>}

Get a guild role via the REST API. REST mode is required to use this endpoint.

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

roleID String

The ID of the role

Returns:
Type:
Promise.<Role>

getRESTGuildRoles(guildID) → {Promise.<Array.<Role>>}

Get a guild's roles via the REST API. REST mode is required to use this endpoint.

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

Returns:
Type:
Promise.<Array.<Role>>

getRESTGuildScheduledEvent(guildID, eventID, optionsopt) → {Promise.<GuildScheduledEvent>}

Get a guild scheduled event via the REST API. REST mode is required to use this endpoint.

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

eventID String

The ID of the guild scheduled event

options Object <optional>

Options for the request

Name Type Attributes Description
withUserCount Boolean <optional>

Whether to include the number of users subscribed to the event

Returns:
Type:
Promise.<GuildScheduledEvent>

getRESTGuildSticker(guildID, stickerID) → {Promise.<Object>}

Get a guild sticker via the REST API. REST mode is required to use this endpoint.

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

stickerID String

The ID of the sticker

Returns:
Type:
Promise.<Object>

A sticker object

getRESTGuildStickers(guildID) → {Promise.<Array.<Object>>}

Get a guild's stickers via the REST API. REST mode is required to use this endpoint.

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

Returns:
Type:
Promise.<Array.<Object>>

An array of guild sticker objects

getRESTGuilds(optionsopt, beforeopt, afteropt) → {Promise.<Array.<Guild>>}

Get a list of the user's guilds via the REST API. REST mode is required to use this endpoint.

Overrides:
Source:
Parameters:
Name Type Attributes Description
options Object <optional>

Options for the request. If this is a number ([DEPRECATED] behavior), it is treated as options.limit

Name Type Attributes Default Description
after String <optional>

The highest guild ID of the previous page

before String <optional>

The lowest guild ID of the next page

limit Number <optional>
100

The max number of guilds to get (1 to 200)

withCounts Boolean <optional>
false

Whether to include approximate member and presence counts

before String <optional>

[DEPRECATED] The lowest guild ID of the next page

after String <optional>

[DEPRECATED] The highest guild ID of the previous page

Returns:
Type:
Promise.<Array.<Guild>>

getRESTSticker(stickerID) → {Promise.<Object>}

Get a sticker via the REST API. REST mode is required to use this endpoint.

Overrides:
Source:
Parameters:
Name Type Description
stickerID String

The ID of the sticker

Returns:
Type:
Promise.<Object>

A sticker object

getRESTUser(userID) → {Promise.<User>}

Get a user's data via the REST API. REST mode is required to use this endpoint.

Overrides:
Source:
Parameters:
Name Type Description
userID String

The ID of the user

Returns:
Type:
Promise.<User>

getRoleConnectionMetadataRecords() → {Promise.<Array.<Object>>}

Get the role connection metadata for the application

Overrides:
Source:
Returns:
Type:
Promise.<Array.<Object>>

An array of role connection metadata objects. See the official Discord API documentation entry for object structure

getSelf() → {Promise.<ExtendedUser>}

Get properties of the bot user

Overrides:
Source:
Returns:
Type:
Promise.<ExtendedUser>

getSoundboardSounds() → {Promise.<Array.<SoundboardSound>>}

Get the default soundboard sounds

Overrides:
Source:
Returns:
Type:
Promise.<Array.<SoundboardSound>>

getStageInstance(channelID) → {Promise.<StageInstance>}

Get the stage instance associated with a stage channel

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The stage channel ID

Returns:
Type:
Promise.<StageInstance>

getStickerPack(packID) → {Promise.<Object>}

Get a sticker pack

Overrides:
Source:
Parameters:
Name Type Description
packID String

The ID of the pack

Returns:
Type:
Promise.<Object>

An object representing the sticker pack

getThreadMember(channelID, userID, withMemberopt) → {Promise.<ThreadMember>}

Get a member that is part of a thread channel

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the thread channel

userID String

The ID of the user

withMember Boolean <optional>

Whether to include the guild member object within the response

Returns:
Type:
Promise.<ThreadMember>

getThreadMembers(channelID, optionsopt) → {Promise.<Array.<ThreadMember>>}

Get a list of members that are part of a thread channel

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the thread channel

options Object <optional>

Options for the request

Name Type Attributes Default Description
after String <optional>

Get members after this user ID

limit Number <optional>
100

The maximum number of thread members to fetch (1-100)

withMember Boolean <optional>

Whether to include the guild member object for each member of the thread

Returns:
Type:
Promise.<Array.<ThreadMember>>

getVoiceRegions(guildIDopt) → {Promise.<Array.<Object>>}

Get a list of general/guild-specific voice regions

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String <optional>

The ID of the guild

Returns:
Type:
Promise.<Array.<Object>>

Resolves with an array of voice region objects

getWebhook(webhookID, tokenopt) → {Promise.<Object>}

Get a webhook

Overrides:
Source:
Parameters:
Name Type Attributes Description
webhookID String

The ID of the webhook

token String <optional>

The token of the webhook, used instead of the Bot Authorization token

Returns:
Type:
Promise.<Object>

Resolves with a webhook object

getWebhookMessage(webhookID, token, messageID) → {Promise.<Message>}

Get a webhook message

Overrides:
Source:
Parameters:
Name Type Description
webhookID String

The ID of the webhook

token String

The token of the webhook

messageID String

The message ID of a message sent by this webhook

Returns:
Type:
Promise.<Message>

Resolves with a webhook message

joinThread(channelID, userIDopt) → {Promise}

Join a thread

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
channelID String

The ID of the thread channel

userID String <optional>
"@me"

The user ID of the user joining

Returns:
Type:
Promise

joinVoiceChannel(channelID, optionsopt) → {Promise.<VoiceConnection>}

Join a voice channel

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the voice channel

options Object <optional>

VoiceConnection constructor options

Name Type Attributes Description
opusOnly Object <optional>

Skip opus encoder initialization. You should not enable this unless you know what you are doing

selfDeaf Boolean <optional>

Whether the bot joins the channel deafened or not

selfMute Boolean <optional>

Whether the bot joins the channel muted or not

shared Object <optional>

Whether the VoiceConnection will be part of a SharedStream or not

Returns:
Type:
Promise.<VoiceConnection>

Resolves with a VoiceConnection

kickGuildMember(guildID, userID, reasonopt) → {Promise}

Kick a user from a guild

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

userID String

The ID of the user

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

leaveGuild(guildID) → {Promise}

Leave a guild

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

Returns:
Type:
Promise

leaveThread(channelID, userIDopt) → {Promise}

Leave a thread

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
channelID String

The ID of the thread channel

userID String <optional>
"@me"

The user ID of the user leaving

Returns:
Type:
Promise

leaveVoiceChannel(channelID)

Leaves a voice channel

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the voice channel

(async) onMessageCreate(msg)

Checks the command client for a command based on the provided message

Source:
Parameters:
Name Type Description
msg Message

The message object from the message create event

pinMessage(channelID, messageID) → {Promise}

Pin a message

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the channel

messageID String

The ID of the message

Returns:
Type:
Promise

pruneMembers(guildID, optionsopt) → {Promise.<?Number>}

Begin pruning a guild

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

options Number <optional>

The options to pass to prune members

Name Type Attributes Default Description
computePruneCount Boolean <optional>
true

Whether or not the number of pruned members should be returned. Discord discourages setting this to true for larger guilds

days Number <optional>
7

The number of days of inactivity to prune for

includeRoles Array.<String> <optional>

An array of role IDs that members must have to be considered for pruning

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<?Number>

If computePruneCount was true, resolves with the number of pruned members

(async) purgeChannel(channelID, options, filteropt, beforeopt, afteropt, reasonopt) → {Promise.<Number>}

Purge previous messages in a channel with an optional filter (bot accounts only)

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

options Object

Options for the request. If this is a number ([DEPRECATED] behavior), it is treated as options.limit

Name Type Attributes Description
after String <optional>

Get messages after this message ID

before String <optional>

Get messages before this message ID

filter function <optional>

Optional filter function that returns a boolean when passed a Message object

limit Number

The max number of messages to search through, -1 for no limit

reason String <optional>

The reason to be displayed in audit logs

filter function <optional>

[DEPRECATED] Optional filter function that returns a boolean when passed a Message object

before String <optional>

[DEPRECATED] Get messages before this message ID

after String <optional>

[DEPRECATED] Get messages after this message ID

reason String <optional>

[DEPRECATED] The reason to be displayed in audit logs

Returns:
Type:
Promise.<Number>

Resolves with the number of messages deleted

registerCommand(label, generator, optionsopt) → {Command}

Register a command

Source:
Parameters:
Name Type Attributes Default Description
label String

The command label

generator function | String | Array.<(function()|String)>

A response string, array of functions or strings, or function that generates a string or array of strings when called. If a function is passed, the function will be passed a Message object and an array of command arguments. The Message object will have an additional property prefix, which is the prefix used in the command. generator(msg, args)

options Object <optional>

Command options

Name Type Attributes Default Description
aliases Array.<String> <optional>

An array of command aliases

argsRequired Boolean <optional>
false

If arguments are required or not

caseInsensitive Boolean <optional>
false

Whether the command label (and aliases) is case insensitive or not

cooldown Number <optional>

The cooldown between command usage in milliseconds

cooldownExclusions Object <optional>
{}

A set of factors that limit where cooldowns are active

Name Type Attributes Description
channelIDs Array.<String> <optional>

An array of channel IDs representing channels that are not affected by cooldowns.

guildIDs Array.<String> <optional>

An array of guild IDs representing guilds that are not affected by cooldowns.

userIDs Array.<String> <optional>

An array of user IDs representing users that are not affected by cooldowns.

cooldownMessage function | String <optional>

A string or a function that returns a string to show when the command is on cooldown

option.cooldownReturns Number <optional>
0

Number of times to return a message when the command is used during it's cooldown. Once the cooldown expires this is reset. Set this to 0 to always return a message.

options.defaultSubcommandOptions Object <optional>
{}

Default subcommand options. This object takes the same options as a normal Command

options.deleteCommand Boolean <optional>
false

Whether to delete the user command message or not

options.description String <optional>
"No description"

A short description of the command to show in the default help command

options.dmOnly Boolean <optional>
false

Whether to prevent the command from being used in guilds or not

options.errorMessage function | String <optional>

A string or a function that returns a string to show if the execution of the command handler somehow fails. The function is passed the command message and the error as parameters.

options.fullDescription String <optional>
"No full description"

A detailed description of the command to show in the default help command

options.guildOnly Boolean <optional>
false

Whether to prevent the command from being used in Direct Messages or not

options.hidden Boolean <optional>
false

Whether or not the command should be hidden from the default help command list

options.hooks Object <optional>

A set of functions to be executed at different times throughout the command's processing

Name Type Attributes Description
preCommand function <optional>

A function that is executed before any permission or cooldown checks is made. The function is passed the command message and arguments as parameters.

postCheck function <optional>

A function that is executed after all checks have cleared, but before the command is executed. The function is passed the command message, arguments, and if command checks were passed as parameters.

postExecution function <optional>

A function that is executed after the command is executed, regardless of the final failed state of the command. The function is passed the command message, arguments, and if execution succeeded as parameters.

postCommand function <optional>

A function that is executed after a response has been posted, and the command has finished processing. The function is passed the command message, arguments, and the response message (if applicable) as parameters.

options.invalidUsageMessage function | String <optional>

A string or a function that returns a string to show when a command was improperly used

options.permissionMessage function | String <optional>

A string or a function that returns a string to show when the user doesn't have permissions to use the command

options.reactionButtons Array.<{emoji: String, type: String, response: (function()|String|Array.<(function()|String)>)}> <optional>

An array of objects specifying reaction buttons emoji specifies the button emoji. Custom emojis should be in format emojiName:emojiID type specifies the type of the reaction button, either "edit" or "cancel" response specifies the content to edit the message to when the reaction button is pressed. This accepts the same arguments as the generator parameter of this function, but with an extra userID parameter for generator functions (function(msg, args, userID)) describing the user that made the reaction filter specifies a function (function(msg, emoji, userID)) that filters message reactions. If the function returns false, the reaction is not treated as a valid reaction button response

options.reactionButtonTimeout Number <optional>
60000

Time (in milliseconds) to wait before invalidating the command's reaction buttons

options.requirements Object <optional>

A set of factors that limit who can call the command

Name Type Attributes Description
custom function <optional>

A function that accepts a message and returns true if the command should be run

permissions function | Object <optional>

An object or a function that returns an object containing permission keys the user must match to use the command i.e.:

{
  "administrator": false,
  "manageMessages": true
}

In the above example, the user must not have administrator permissions, but must have manageMessages to use the command

roleIDs function | Array.<String> <optional>

An array or a function that returns an array of role IDs that would allow a user to use the command

roleNames function | Array.<String> <optional>

An array or a function that returns an array of role names that would allow a user to use the command

userIDs function | Array.<String> <optional>

An array or a function that returns an array of user IDs representing users that can call the command

option.restartCooldown Boolean <optional>
false

Whether or not to restart a command's cooldown every time it's used.

options.usage String <optional>

Details on how to call the command to show in the default help command

Returns:
Type:
Command

registerCommandAlias(alias, label)

Register an alias for a command

Source:
Parameters:
Name Type Description
alias String

The alias

label String

The original command label

registerGuildPrefix(guildID, prefix)

Register a prefix override for a specific guild

Source:
Parameters:
Name Type Description
guildID String

The ID of the guild to override prefixes for

prefix String | Array

The bot prefix. Can be either an array of prefixes or a single prefix. "@mention" will be automatically replaced with the bot's actual mention

removeGroupRecipient(groupID, userID) → {Promise}

Remove a user from a group

Overrides:
Source:
Parameters:
Name Type Description
groupID String

The ID of the target group

userID String

The ID of the target user

Returns:
Type:
Promise

removeGuildMemberRole(guildID, memberID, roleID, reasonopt) → {Promise}

Remove a role from a guild member

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

memberID String

The ID of the member

roleID String

The ID of the role

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

removeMessageReaction(channelID, messageID, reaction, userIDopt) → {Promise}

Remove a reaction from a message

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
channelID String

The ID of the channel

messageID String

The ID of the message

reaction String

The reaction (Unicode string if Unicode emoji, emojiName:emojiID if custom emoji)

userID String <optional>
"@me"

The ID of the user to remove the reaction for

Returns:
Type:
Promise

removeMessageReactionEmoji(channelID, messageID, reaction) → {Promise}

Remove all reactions from a message for a single emoji.

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the channel

messageID String

The ID of the message

reaction String

The reaction (Unicode string if Unicode emoji, emojiName:emojiID if custom emoji)

Returns:
Type:
Promise

removeMessageReactions(channelID, messageID) → {Promise}

Remove all reactions from a message

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the channel

messageID String

The ID of the message

Returns:
Type:
Promise

searchGuildMembers(guildID, query, limitopt) → {Promise.<Array.<Member>>}

Search for guild members by partial nickname/username

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
guildID String

The ID of the guild

query String

The query string to match username(s) and nickname(s) against

limit Number <optional>
1

The maximum number of members you want returned, capped at 100

Returns:
Type:
Promise.<Array.<Member>>

sendChannelTyping(channelID) → {Promise}

Send typing status in a channel

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the channel

Returns:
Type:
Promise

sendSoundboardSound(channelID, options) → {Promise}

Send a soundboard sound to a connected voice channel

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the connected voice channel

options Object

The soundboard sound options

Name Type Attributes Description
soundID String

The ID of the soundboard sound

sourceGuildID String <optional>

The ID of the guild where the soundboard sound was created, if not in the same guild

Returns:
Type:
Promise

setVoiceChannelStatus(channelID, status, reasonopt) → {Promise}

Set the status of a voice channel. Note: This will not work in stage channels

Overrides:
Source:
Parameters:
Name Type Attributes Description
channelID String

The ID of the channel

status String

The new voice channel status

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

syncGuildIntegration(guildID, integrationID) → {Promise}

Force a guild integration to sync

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

integrationID String

The ID of the integration

Returns:
Type:
Promise

syncGuildTemplate(guildID, code) → {Promise.<GuildTemplate>}

Force a guild template to sync

Overrides:
Source:
Parameters:
Name Type Description
guildID String

The ID of the guild

code String

The template code

Returns:
Type:
Promise.<GuildTemplate>

unbanGuildMember(guildID, userID, reasonopt) → {Promise}

Unban a user from a guild

Overrides:
Source:
Parameters:
Name Type Attributes Description
guildID String

The ID of the guild

userID String

The ID of the user

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

unpinMessage(channelID, messageID) → {Promise}

Unpin a message

Overrides:
Source:
Parameters:
Name Type Description
channelID String

The ID of the channel

messageID String

The ID of the message

Returns:
Type:
Promise

unregisterCommand(label)

Unregister a command

Source:
Parameters:
Name Type Description
label String

The command label

validateDiscoverySearchTerm(term) → {Promise.<Object>}

Validate discovery search term

Overrides:
Source:
Parameters:
Name Type Description
term String

The search term to check

Returns:
Type:
Promise.<Object>

An object with a valid field which is true when valid and false when invalid

Events

applicationCommandPermissionsUpdate

Fired when an application command's permissions are updated

Properties:
Name Type Description
guildApplicationCommandPermissions Object

The updated command permissions

Overrides:
Source:

autoModerationActionExecution

Fired when an auto moderation action is executed.

Properties:
Name Type Description
guild Guild

The guild associated with the action

action Object

The exection action

Overrides:
Source:

autoModerationRuleCreate

Fired when an auto moderation rule is created

Properties:
Name Type Description
guild Guild

The guild associated with the rule

rule AutoModerationRule

The created rule

Overrides:
Source:

autoModerationRuleDelete

Fired when an auto moderation rule is deleted

Properties:
Name Type Description
guild Guild

The guild associated with the rule

rule AutoModerationRule

The deleted rule

Overrides:
Source:

autoModerationRuleUpdate

Fired when an auto moderation rule is updated

Properties:
Name Type Attributes Description
guild Guild

The guild associated with the rule

rule AutoModerationRule

The updated role

oldRule Object <nullable>

The old rule. If the rule was uncached, this will be null

Overrides:
Source:

channelCreate

Fired when a channel is created

Properties:
Name Type Description
channel CategoryChannel | ForumChannel | GuildChannel | NewsChannel | TextChannel | VoiceChannel

The channel

Overrides:
Source:

channelDelete

Fired when a channel is deleted

Properties:
Name Type Description
channel CategoryChannel | DMChannel | ForumChannel | NewsChannel | TextChannel | VoiceChannel

The channel

Overrides:
Source:

channelPinUpdate

Fired when a channel pin timestamp is updated

Properties:
Name Type Description
channel DMChannel | TextChannel | NewsChannel

The channel

timestamp Number

The new timestamp

oldTimestamp Number

The old timestamp

Overrides:
Source:

channelUpdate

Fired when a channel is updated

Properties:
Properties
Name Type Description
channel CategoryChannel | DMChannel | ForumChannel | GuildChannel | TextChannel | VoiceChannel | NewsChannel

The updated channel

oldChannel Object

The old channel data

Name Type Attributes Description
availableTags Array.<Object>

The available tags that can be applied to threads in a forum/media channel. See the official Discord API documentation entry for object structure (forum/media channels only, max 20)

bitrate Number

The bitrate of the channel (voice channels only)

defaultAutoArchiveDuration Number

The default duration of newly created threads in minutes to automatically archive the thread after inactivity (60, 1440, 4320, 10080) (text/news/forum/media channels only)

defaultForumLayout Number

The default forum layout type used to display posts in forum channels (forum channels only)

defaultReactionEmoji Object

The emoji to show in the add reaction button on a thread in a forum/media channel (forum/media channels only)

defaultSortOrder Number

The default sort order type used to order posts in forum/media channels (forum/media channels only)

defaultThreadRateLimitPerUser Number

The initial rateLimitPerUser to set on newly created threads in a channel (text/forum/media channels only)

flags Number <nullable>

The flags for the channel combined as a bitfield (thread/forum/media channels only)

name String

The name of the channel

nsfw Boolean

Whether the channel is NSFW or not (text channels only)

parentID String <nullable>

The ID of the category this channel belongs to (guild channels only)

permissionOverwrites Collection

Collection of PermissionOverwrites in this channel (guild channels only)

position Number

The position of the channel (guild channels only)

rateLimitPerUser Number <nullable>

The time in seconds a user has to wait before sending another message (0-21600) (text/voice/stage/forum/media channels only)

rtcRegion String <nullable>

The RTC region ID of the channel (automatic when null) (voice channels only)

topic String <nullable>

The topic of the channel (text channels only)

type Number

The type of the old channel (text/news channels only)

userLimit Number <nullable>

The max number of users that can join the channel (voice channels only)

videoQualityMode Number <nullable>

The camera video quality mode of the channel (voice channels only)

Overrides:
Source:

connect

Fired when the shard establishes a connection

Properties:
Name Type Description
id Number

The ID of the shard

Overrides:
Source:

debug

Fired when stuff happens and gives more info

Properties:
Name Type Description
message String

The debug message

id Number

The ID of the shard

Overrides:
Source:

disconnect

Fired when all shards disconnect

Overrides:
Source:

error

Fired when the shard encounters an error

Properties:
Name Type Description
err Error

The error

id Number

The ID of the shard

Overrides:
Source:

guildAuditLogEntryCreate

Fired when a guild audit log entry is created

Properties:
Name Type Description
guildAuditLogEntry GuildAuditLogEntry

The created guild audit log entry

Overrides:
Source:

guildAvailable

Fired when a guild becomes available

Properties:
Name Type Description
guild Guild

The guild

Overrides:
Source:

guildBanAdd

Fired when a user is banned from a guild

Properties:
Name Type Description
guild Guild

The guild

user User

The banned user

Overrides:
Source:

guildBanRemove

Fired when a user is unbanned from a guild

Properties:
Name Type Description
guild Guild

The guild

user User

The banned user

Overrides:
Source:

guildCreate

Fired when a guild is created. This happens when:

  • the client creates a guild
  • the client joins a guild
Properties:
Name Type Description
guild Guild

The guild

Overrides:
Source:

guildDelete

Fired when a guild is deleted. This happens when:

  • the client left the guild
  • the client was kicked/banned from the guild
  • the guild was literally deleted
Properties:
Name Type Description
guild Guild | Object

The guild. If the guild was not cached, it will be an object with an id key. No other property is guaranteed

Overrides:
Source:

guildEmojisUpdate

Fired when a guild's emojis are updated

Properties:
Name Type Attributes Description
guild Guild

The guild. If the guild is uncached, this is an object with an ID key. No other property is guaranteed

emojis Array

The updated emojis of the guild

oldEmojis Array <nullable>

The old emojis of the guild. If the guild is uncached, this will be null

Overrides:
Source:

guildIntegrationsUpdate

Fired when a guild integration is updated

Properties:
Name Type Description
guild Guild

The guild where the integration was updated. If the guild isn't cached, this will be an object with an id key. No other properties are guaranteed

Overrides:
Source:

guildMemberAdd

Fired when a member joins a server

Properties:
Name Type Description
guild Guild

The guild

member Member

The member

Overrides:
Source:

guildMemberChunk

Fired when Discord sends member chunks

Properties:
Name Type Description
guild Guild

The guild the chunked members are in

members Array.<Member>

The members in the chunk

Overrides:
Source:

guildMemberRemove

Fired when a member leaves a server

Properties:
Name Type Description
guild Guild

The guild

member Member | Object

The member. If the member is not cached, this will be an object with id and user key

Overrides:
Source:

guildMemberUpdate

Fired when a member's guild avatar, roles or nickname are updated or they start boosting a server

Properties:
Properties
Name Type Attributes Description
guild Guild

The guild

member Member

The updated member

oldMember Object <nullable>

The old member data, or null if the member wasn't cached

Name Type Attributes Description
avatar String <nullable>

The hash of the member's guild avatar, or null if no guild avatar

communicationDisabledUntil Number <nullable>

Timestamp of previous timeout expiry. If null, the member was not timed out

flags Number <nullable>

The member's flags (see Constants). Defaults to 0

nick String <nullable>

The server nickname of the member

pending Boolean <nullable>

Whether the member has passed the guild's Membership Screening requirements

premiumSince Number <nullable>

Timestamp of when the member boosted the guild

roles Array.<String>

An array of role IDs this member is a part of

Overrides:
Source:

guildRoleCreate

Fired when a guild role is created

Properties:
Name Type Description
guild Guild

The guild

role Role

The role

Overrides:
Source:

guildRoleDelete

Fired when a guild role is deleted

Properties:
Name Type Description
guild Guild

The guild

role Role

The role

Overrides:
Source:

guildRoleUpdate

Fired when a guild role is updated

Properties:
Properties
Name Type Description
guild Guild

The guild

role Role

The updated role

oldRole Object

The old role data

Name Type Attributes Description
color Number

The hex color of the role in base 10

flags Number

The flags of the role (see constants)

hoist Boolean

Whether users with the role are hoisted in the user list or not

icon String <nullable>

The hash of the role's icon, or null if no icon

managed Boolean

Whether a guild integration manages the role or not

mentionable Boolean

Whether the role is mentionable or not

name String

The name of the role

permissions Permission

The permissions number of the role

position Number

The position of the role

tags Object <nullable>

The tags of the role

unicodeEmoji String <nullable>

Unicode emoji for the role

Overrides:
Source:

guildScheduledEventCreate

Fired when a guild scheduled event is created

Properties:
Name Type Description
event GuildScheduledEvent

The event

Overrides:
Source:

guildScheduledEventDelete

Fired when a guild scheduled event is deleted

Properties:
Name Type Description
event GuildScheduledEvent

The event that was deleted.

Overrides:
Source:

guildScheduledEventUpdate

Fired when a guild scheduled event is updated

Properties:
Properties
Name Type Attributes Description
event GuildScheduledEvent

The updated event

oldEvent Object <nullable>

The old guild event data, or null if the event wasn't cached.

Properties
Name Type Attributes Description
channel VoiceChannel | StageChannel | Object <nullable>

The channel where the event is held

description String <nullable>

The description of the event

entityID String <nullable>

The Entity ID associated to the event

entityMetadata Object <nullable>

Metadata for the event

Name Type Attributes Description
location String <nullable>

Location of the event

entityType Number

The event entity type

image String <nullable>

The hash of the event's image

name String

The name of the event

privacyLevel Number

The privacy level of the event

scheduledEndTime Number <nullable>

The time the event will start

scheduledStartTime Number

The time the event will start

status Number

The status of the guild scheduled event

Overrides:
Source:

guildScheduledEventUserAdd

Fired when an user has subscribed to a Guild Event.

Properties:
Name Type Description
event GuildScheduledEvent | Object

The guild event that the user subscribed to. If the event is uncached, this will be an object with id and guild keys. No other property is guaranteed

user User | Object

The user that subscribed to the Guild Event. If the user is uncached, this will be an object with an id key. No other property is guaranteed

Overrides:
Source:

guildScheduledEventUserRemove

Fired when an user has unsubscribed from a Guild Event.

Properties:
Name Type Description
event GuildScheduledEvent | string

The guild event that the user unsubscribed to. This will be the guild event ID if the guild was uncached

user User | string

The user that unsubscribed to the Guild Event. This will be the user ID if the user was uncached

Overrides:
Source:

guildSoundboardSoundCreate

Fired when a guild soundboard sound is created

Properties:
Name Type Description
sound SoundboardSound

The created soundboard sound

Overrides:
Source:

guildSoundboardSoundDelete

Fired when a guild soundboard sound is deleted

Properties:
Name Type Description
sound SoundboardSound

The deleted soundboard sound. If the soundboard sound isn't cached, this will be an object with id and guild keys. If the guild isn't cached, it will be an object with an id key. No other properties are guaranteed

Overrides:
Source:

guildSoundboardSoundUpdate

Fired when a guild soundboard sound is updated

Properties:
Properties
Name Type Description
sound SoundboardSound

The updated soundboard sound

oldSound Object

The old soundboard sound data, or null if not cached

Name Type Attributes Description
available Boolean

Whether the soundboard sound was available or not

emojiID String <nullable>

The ID of the relating custom emoji

emojiName String <nullable>

The name of the relating default emoji

name String

The name of the soundboard sound

volume Number

The volume of the soundboard sound, between 0 and 1

Overrides:
Source:

guildSoundboardSoundsUpdate

Fired when multiple guild soundboard sounds are updated

Properties:
Name Type Attributes Description
guild Guild

The guild. If the guild is uncached, this is an object with an ID key. No other property is guaranteed

sounds Array.<SoundboardSound>

The updated soundboard sounds

oldSounds Array.<Object>

The old soundboard sounds data, or null if not cached

oldSounds[].available Boolean

Whether the soundboard sound was available or not

oldSounds[].emojiID String <nullable>

The ID of the relating custom emoji

oldSounds[].emojiName String <nullable>

The name of the relating default emoji

oldSounds[].name String

The name of the soundboard sound

oldSounds[].volume Number

The volume of the soundboard sound, between 0 and 1

Overrides:
Source:

guildStickersUpdate

Fired when a guild's stickers are updated

Properties:
Name Type Attributes Description
guild Guild

The guild. If the guild is uncached, this is an object with an ID key. No other property is guaranteed

stickers Array

The updated stickers of the guild

oldStickers Array <nullable>

The old stickers of the guild. If the guild is uncached, this will be null

Overrides:
Source:

guildUnavailable

Fired when a guild becomes unavailable

Properties:
Name Type Description
guild Guild

The guild

Overrides:
Source:

guildUpdate

Fired when a guild is updated

Properties:
Properties
Name Type Attributes Description
guild Guild

The guild

oldGuild Object

The old guild data

Name Type Attributes Description
afkChannelID String <nullable>

The ID of the AFK voice channel

afkTimeout Number

The AFK timeout in seconds

autoRemoved Boolean <nullable>

Whether the guild was automatically removed from Discovery

banner String <nullable>

The hash of the guild banner image, or null if no splash (VIP only)

defaultNotifications Number

The default notification settings for the guild. 0 is "All Messages", 1 is "Only @mentions"

description String <nullable>

The description for the guild (VIP only)

emojiCount Number <nullable>

The number of emojis in the guild

emojis Array.<Object>

An array of guild emojis

explicitContentFilter Number

The explicit content filter level for the guild. 0 is off, 1 is on for people without roles, 2 is on for all

features Array.<String>

An array of guild features

icon String <nullable>

The hash of the guild icon, or null if no icon

keywords Array.<String> <nullable>

The guild's discovery keywords

large Boolean

Whether the guild is "large" by "some Discord standard"

maxMembers Number <nullable>

The maximum number of members for this guild

maxVideoChannelUsers Number <nullable>

The max number of users allowed in a video channel

mfaLevel Number

The admin 2FA level for the guild. 0 is not required, 1 is required

name String

The name of the guild

nsfw Boolean

[DEPRECATED] Whether the guild is designated as NSFW by Discord

nsfwLevel Number

The guild NSFW level designated by Discord

ownerID String

The ID of the user that is the guild owner

preferredLocale String

Preferred "COMMUNITY" guild language used in server discovery and notices from Discord

premiumProgressBarEnabled Boolean

If the boost progress bar is enabled

premiumSubscriptionCount Number <nullable>

The total number of users currently boosting this guild

premiumTier Number

Nitro boost level of the guild

primaryCategory Object <nullable>

The guild's primary discovery category

primaryCategoryID Number <nullable>

The guild's primary discovery category ID

publicUpdatesChannelID String <nullable>

ID of the guild's updates channel if the guild has "COMMUNITY" features

rulesChannelID String <nullable>

The channel where "COMMUNITY" guilds display rules and/or guidelines

splash String <nullable>

The hash of the guild splash image, or null if no splash (VIP only)

stickers Array.<Object> <nullable>

An array of guild sticker objects

oldGuild.systemChannelFlags Number

the flags for the system channel

oldGuild.systemChannelID String <nullable>

The ID of the default channel for system messages (built-in join messages and boost messages)

oldGuild.vanityURL String <nullable>

The vanity URL of the guild (VIP only)

oldGuild.verificationLevel Number

The guild verification level

oldGuild.welcomeScreen Object <nullable>

The welcome screen of a Community guild, shown to new members

Properties
Name Type Description
description Object

The description in the welcome screen

welcomeChannels Array.<Object>

The list of channels in the welcome screens. Each channels have the following properties: channelID, description, emojiID, emojiName. emojiID and emojiName properties can be null.

Overrides:
Source:

hello

Fired when a shard receives an OP:10/HELLO packet

Properties:
Name Type Description
trace Array.<String>

The Discord server trace of the gateway and session servers

id Number

The ID of the shard

Overrides:
Source:

interactionCreate

Fired when an interaction is created

Properties:
Name Type Description
interaction PingInteraction | CommandInteraction | ComponentInteraction | AutocompleteInteraction | ModalSubmitInteraction | UnknownInteraction

The Interaction that was created

Overrides:
Source:

inviteCreate

Fired when a guild invite is created

Properties:
Name Type Description
guild Guild

The guild this invite was created in.

invite Invite

The invite that was created

Overrides:
Source:

inviteDelete

Fired when a guild invite is deleted

Properties:
Name Type Description
guild Guild

The guild this invite was created in.

invite Invite

The invite that was deleted

Overrides:
Source:

messageCreate

Fired when a message is created

Properties:
Name Type Description
message Message

The message.

Overrides:
Source:

messageDelete

Fired when a cached message is deleted

Properties:
Name Type Description
message Message | Object

The message object. If the message is not cached, this will be an object with id and channel keys. If the channel is not cached, channel will be an object with an id key. If the uncached message is from a guild, the message will also contain a guildID key, and the channel will contain a guild with an id key. No other property is guaranteed.

Overrides:
Source:

messageDeleteBulk

Fired when a bulk delete occurs

Properties:
Name Type Description
messages Array.<Message> | Array.<Object>

An array of (potentially partial) message objects. If a message is not cached, it will be an object with id and channel keys If the uncached messages are from a guild, the messages will also contain a guildID key, and the channel will contain a guild with an id key. No other property is guaranteed

Overrides:
Source:

messagePollVoteAdd

Fired when a user votes on a poll. If the poll allows multiple selection, one event will be sent per answer

Properties:
Name Type Description
message Message | Object

The message object. If the message is not cached, this will be an object with id and channel keys. If the channel is not cached, channel key will be an object with an id and a guild key with only an id. No other property is guaranteed

user User | Object

The user who voted on the poll. If the user is not cached, this will be an object with only an id key

answerID Number

The ID of the answer

Overrides:
Source:

messagePollVoteRemove

Fired when a user removes their vote on a poll. If the poll allows multiple selection, one event will be sent per answer

Properties:
Name Type Description
message Message | Object

The message object. If the message is not cached, this will be an object with id and channel keys. If the channel is not cached, channel key will be an object with an id and a guild key with only an id. No other property is guaranteed

user User | Object

The user who removed their vote from the poll. If the user is not cached, this will be an object with only an id key

answerID Number

The ID of the answer

Overrides:
Source:

messageReactionAdd

Fired when someone adds a reaction to a message

Properties:
Properties
Name Type Description
message Message | Object

The message object. If the message is not cached, this will be an object with id, channel, and if inside a guild, guildID keys. If the channel is not cached, channel key will be an object with only an id. guildID will be present if the message was sent in a guild channel. No other property is guaranteed

emoji Object

The reaction emoji object

Name Type Attributes Description
animated Boolean <nullable>

Whether the emoji is animated or not

id String <nullable>

The emoji ID (null for non-custom emojis)

name String

The emoji name

reactor Member | Object

The member, if the reaction is in a guild. If the reaction is not in a guild, this will be an object with an id key. No other property is guaranteed

burst Boolean

Whether the reaction is a super reaction

Overrides:
Source:

messageReactionRemove

Fired when someone removes a reaction from a message

Properties:
Properties
Name Type Description
message Message | Object

The message object. If the message is not cached, this will be an object with id, channel, and if inside a guild, guildID keys. If the channel is not cached, channel key will be an object with only an id. guildID will be present if the message was sent in a guild channel. No other property is guaranteed

emoji Object

The reaction emoji object

Name Type Attributes Description
animated Boolean <nullable>

Whether the emoji is animated or not

id String <nullable>

The ID of the emoji (null for non-custom emojis)

name String

The emoji name

userID String

The ID of the user that removed the reaction

burst Boolean

Whether the reaction is a super reaction

Overrides:
Source:

messageReactionRemoveAll

Fired when all reactions are removed from a message

Properties:
Name Type Description
message Message | Object

The message object. If the message is not cached, this will be an object with id, channel, and if inside a guild, guildID keys. If the channel is not cached, channel key will be an object with only an id. No other property is guaranteed

Overrides:
Source:

messageReactionRemoveEmoji

Fired when someone removes all reactions from a message for a single emoji

Properties:
Properties
Name Type Description
message Message | Object

The message object. If the message is not cached, this will be an object with id and channel keys. If the channel is not cached, channel key will be an object with only an id. No other property is guaranteed

emoji Object

The reaction emoji object

Name Type Attributes Description
animated Boolean <nullable>

Whether the emoji is animated or not

id String <nullable>

The ID of the emoji (null for non-custom emojis)

name String

The emoji name

Overrides:
Source:

messageUpdate

Fired when a message is updated

Properties:
Properties
Name Type Attributes Description
message Message

The updated message. If oldMessage is null, it is recommended to discard this event, since the message data will be very incomplete (only id and channel are guaranteed). If the channel isn't cached, channel will be an object with an id key.

oldMessage Object <nullable>

The old message data. If the message was cached, this will return the full old message. Otherwise, it will be null

Name Type Description
attachments Array.<Object>

Array of attachments

channelMentions Array.<String>

Array of mentions channels' ids.

content String

Message content

editedTimestamp Number

Timestamp of latest message edit

embeds Array.<Object>

Array of embeds

flags Number

Old message flags (see constants)

mentionedBy Object

Object of if different things mention the bot user

mentions Array.<User>

Array of mentioned users' ids

pinned Boolean

Whether the message was pinned or not

poll Object

A poll object. See the official Discord API documentation entry for object structure

roleMentions Array.<String>

Array of mentioned roles' ids.

tts Boolean

Whether to play the message using TTS or not

Overrides:
Source:

presenceUpdate

Fired when a guild member's status or game changes

Properties:
Properties
Name Type Attributes Description
other Member

The updated member

oldPresence Object <nullable>

The old presence data. If the user was offline when the bot started and the client option getAllUsers is not true, this will be null

Properties
Name Type Attributes Description
activities Array.<Object> <nullable>

The member's current activities

clientStatus Object <nullable>

The member's per-client status

Name Type Description
desktop String

The member's status on desktop. Either "online", "idle", "dnd", or "offline". Will be "offline" for bots

mobile String

The member's status on mobile. Either "online", "idle", "dnd", or "offline". Will be "offline" for bots

web String

The member's status on web. Either "online", "idle", "dnd", or "offline". Will be "online" for bots

status String

The other user's old status. Either "online", "idle", or "offline"

Overrides:
Source:

rawREST

Fired when the Client's RequestHandler receives a response

Properties:
Properties
Name Type Attributes Description
request Object <optional>

The data for the request.

Properties
Name Type Attributes Description
auth Boolean

True if the request required an authorization token

body Object <optional>

The request payload

file Object <optional>

The file object sent in the request

Name Type Description
file Buffer

A buffer containing file data

name String

The name of the file

latency Number

The HTTP response latency

method String

Uppercase HTTP method

resp IncomingMessage

The HTTP response to the request

route String

The calculated ratelimiting route for the request

short Boolean

Whether or not the request was prioritized in its ratelimiting queue

url String

URL of the endpoint

Overrides:
Source:

rawWS

Fired when the shard receives a websocket packet

Properties:
Name Type Description
packet Object

The packet

id Number

The ID of the shard

Overrides:
Source:

ready

Fired when all shards turn ready

Overrides:
Source:

shardDisconnect

Fired when a shard disconnects

Properties:
Name Type Attributes Description
error Error <nullable>

The error, if any

id Number

The ID of the shard

Overrides:
Source:

shardPreReady

Fired when a shard finishes processing the ready packet

Properties:
Name Type Description
id Number

The ID of the shard

Overrides:
Source:

shardReady

Fired when a shard turns ready

Properties:
Name Type Description
id Number

The ID of the shard

Overrides:
Source:

shardResume

Fired when a shard resumes

Properties:
Name Type Description
id Number

The ID of the shard

Overrides:
Source:

stageInstanceCreate

Fired when a stage instance is created

Properties:
Name Type Description
stageInstance StageInstance

The stage instance

Overrides:
Source:

stageInstanceDelete

Fired when a stage instance is deleted

Properties:
Name Type Description
stageInstance StageInstance

The deleted stage instance

Overrides:
Source:

stageInstanceUpdate

Fired when a stage instance is updated

Properties:
Properties
Name Type Attributes Description
stageInstance StageInstance

The stage instance

oldStageInstance Object <nullable>

The old stage instance. If the stage instance was cached, this will be an object with the properties below. Otherwise, it will be null

Name Type Description
discoverableDisabled Boolean

Whether or not stage discovery was disabled

privacyLevel Number

The privacy level of the stage instance. 1 is public, 2 is guild only

topic String

The stage instance topic

Overrides:
Source:

threadCreate

Fired when a channel is created

Properties:
Name Type Description
channel NewsThreadChannel | PrivateThreadChannel | PublicThreadChannel

The channel

Overrides:
Source:

threadDelete

Fired when a thread channel is deleted

Properties:
Name Type Description
channel NewsThreadChannel | PrivateThreadChannel | PublicThreadChannel

The channel

Overrides:
Source:

threadListSync

Fired when the current user gains access to a channel

Properties:
Name Type Description
guild Guild

The guild where threads are being synced

deletedThreads Array.<(NewsThreadChannel|PrivateThreadChannel|PublicThreadChannel|Object)>

An array of synced threads that the current user no longer has access to. If a thread channel is uncached, it will be an object with an id key. No other property is guaranteed

activeThreads Array.<(NewsThreadChannel|PrivateThreadChannel|PublicThreadChannel)>

An array of synced active threads that the current user can access

joinedThreadsMember Array.<ThreadMember>

An array of thread member objects where the current user has been added in a synced thread channel

Overrides:
Source:

threadMemberUpdate

Fired when a thread member is updated

Properties:
Properties
Name Type Description
channel NewsThreadChannel | PrivateThreadChannel | PublicThreadChannel

The channel

member ThreadMember

The updated thread member

oldMember Object

The old thread member data

Name Type Description
flags Number

User thread settings

Overrides:
Source:

threadMembersUpdate

Fired when anyone is added or removed from a thread. If the guildMembers intent is not specified, this will only apply for the current user

Properties:
Name Type Description
channel NewsThreadChannel | PrivateThreadChannel | PublicThreadChannel

The thread channel

addedMembers Array.<ThreadMember>

An array of members that were added to the thread channel

removedMembers Array.<(ThreadMember|Object)>

An array of members that were removed from the thread channel. If a member is uncached, it will be an object with an id key. No other property is guaranteed

Overrides:
Source:

threadUpdate

Fired when a thread channel is updated

Properties:
Properties
Name Type Attributes Description
channel NewsThreadChannel | PrivateThreadChannel | PublicThreadChannel

The updated channel

oldChannel Object <nullable>

The old thread channel. This will be null if the channel was uncached

Properties
Name Type Attributes Description
appliedTags Array.<String> <nullable>

The IDs of the set of tags that have been applied to a thread in a forum/media channel

autoArchiveDuration Number

The duration in minutes to automatically archive the thread after recent activity, either 60, 1440, 4320 or 10080

flags Number

The flags for the channel combined as a bitfield

name String

The name of the channel

rateLimitPerUser Number

The time in seconds a user has to wait before sending another message (0-21600)

threadMetadata Object

Metadata for the thread

Name Type Attributes Description
archived Boolean

Whether the thread is archived

archiveTimestamp Number

Timestamp when the thread's archive status was last changed, used for calculating recent activity

autoArchiveDuration Number

Duration in minutes to automatically archive the thread after recent activity, either 60, 1440, 4320 or 10080

locked Boolean <nullable>

Whether the thread is locked

Overrides:
Source:

typingStart

Fired when a user begins typing

Properties:
Name Type Attributes Description
channel DMChannel | TextChannel | NewsChannel | Object

The text channel the user is typing in. If the channel is not cached, this will be an object with an id key. No other property is guaranteed

user User | Object

The user. If the user is not cached, this will be an object with an id key. No other property is guaranteed

member Member <nullable>

The guild member, if typing in a guild channel, or null, if typing in a DMChannel

Overrides:
Source:

unavailableGuildCreate

Fired when an unavailable guild is created

Properties:
Name Type Description
guild UnavailableGuild

The unavailable guild

Overrides:
Source:

unknown

Fired when the shard encounters an unknown packet

Properties:
Name Type Description
packet Object

The unknown packet

id Number

The ID of the shard

Overrides:
Source:

userUpdate

Fired when a user's avatar, avatar decoration, discriminator, display name or username changes

Properties:
Properties
Name Type Attributes Description
user User

The updated user

oldUser Object <nullable>

The old user data. If the user was uncached, this will be null

Name Type Attributes Description
avatar String <nullable>

The hash of the user's avatar, or null if no avatar

avatarDecorationData Object <nullable>

The data of the user's avatar decoration, including the asset and sku ID, or null if no avatar decoration

discriminator String

The discriminator of the user

globalName String <nullable>

The user's display name, if it is set. For bots, this is the application name

username String

The username of the user

Overrides:
Source:

voiceChannelEffectSend

Fired when a user sends a voice channel effect

Properties:
Properties
Name Type Description
effect Object

The effect that was sent

Name Type Attributes Description
animationID Number <nullable>

The animation ID

animationType Number <nullable>

The animation type

channel VoiceChannel | StageChannel | Object

The voice channel the effect was sent in. If the channel is not cached, this will be an object with an id key. No other property is guaranteed

emoji Object <nullable>

The emoji sent

guild Guild | Object

The guild the effect was sent in. If the guild is not cached, this will be an object with an id key. No other property is guaranteed

soundID String | Number <nullable>

The sound ID

soundVolume Number <nullable>

The volume of the sound (a number between 0 and 1)

user User | Object

The user that sent the effect. If the user is not cached, this will be an object with an id key. No other property is guaranteed

Overrides:
Source:

voiceChannelJoin

Fired when a guild member joins a voice channel. This event is not fired when a member switches voice channels, see voiceChannelSwitch

Properties:
Name Type Description
member Member

The member

newChannel VoiceChannel | StageChannel

The voice channel

Overrides:
Source:

voiceChannelLeave

Fired when a guild member leaves a voice channel. This event is not fired when a member switches voice channels, see voiceChannelSwitch

Properties:
Name Type Attributes Description
member Member <nullable>

The member

oldChannel VoiceChannel | StageChannel

The voice channel

Overrides:
Source:

voiceChannelStatusUpdate

Fired when a voice channel status is updated

Properties:
Properties
Name Type Description
channel VoiceChannel

The updated voice channel

oldChannel Object

The old channel data

Name Type Attributes Description
status String <nullable>

The old voice channel status

Overrides:
Source:

voiceChannelSwitch

Fired when a guild member switches voice channels

Properties:
Name Type Description
member Member

The member

newChannel VoiceChannel | StageChannel

The new voice channel

oldChannel VoiceChannel | StageChannel

The old voice channel

Overrides:
Source:

voiceStateUpdate

Fired when a guild member's voice state changes

Properties:
Properties
Name Type Attributes Description
member Member | Object

The member. If the member is not cached and Discord doesn't send a member payload, this will be an object with id and voiceState keys. No other property is guaranteed

oldState Object <nullable>

The old voice state of the member. If the above caveat applies, this will be null

Name Type Description
deaf Boolean

The previous server deaf status

mute Boolean

The previous server mute status

selfDeaf Boolean

The previous self deaf status

selfMute Boolean

The previous self mute status

selfStream Boolean

The previous self stream status

selfVideo Boolean

The previous self video status

Overrides:
Source:

warn

Fired to warn of something weird but non-breaking happening

Properties:
Name Type Description
message String

The warning message

id Number

The ID of the shard

Overrides:
Source:

webhooksUpdate

Fired when a channel's webhooks are updated

Properties:
Properties
Name Type Description
data Object

The update data

Name Type Description
channelID String

The ID of the channel that webhooks were updated in

guildID String

The ID of the guild that webhooks were updated in

Overrides:
Source: