Constructor
new Client(token, options)
Create a Client
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
application |
Object
|
<nullable> |
Object containing the bot application's ID and its public flags |
bot |
Boolean
|
Whether the bot user belongs to an OAuth2 application |
|
channelGuildMap |
Object
|
Object mapping channel IDs to guild IDs |
|
dmChannelMap |
Object
|
Object mapping user IDs to private channel IDs |
|
dmChannels |
Collection.<DMChannel>
|
Collection of private channels the bot is in |
|
gatewayURL |
String
|
The URL for the discord gateway |
|
guilds |
Collection.<Guild>
|
Collection of guilds the bot is in |
|
guildShardMap |
Object
|
Object mapping guild IDs to shard IDs |
|
options |
Object
|
Eris options |
|
requestHandler |
RequestHandler
|
The request handler the client will use |
|
shards |
Collection.<Shard>
|
Collection of shards Eris is using |
|
startTime |
Number
|
Timestamp of bot ready event |
|
threadGuildMap |
Object
|
Object mapping thread channel IDs to guild IDs |
|
unavailableGuilds |
Collection.<UnavailableGuild>
|
Collection of unavailable guilds the bot is in |
|
uptime |
Number
|
How long in milliseconds the bot has been up for |
|
user |
ExtendedUser
|
The bot user |
|
users |
Collection.<User>
|
Collection of users the bot sees |
|
voiceConnections |
Collection.<VoiceConnection>
|
Extended collection of active VoiceConnections the bot has |
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
token |
String
|
The auth token to use. Bot tokens should be prefixed with |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object
|
Eris client options
|
Extends
- EventEmitter
Methods
addGroupRecipient(groupID, userID, options) → {Promise}
Add a user to a group channel
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
|
Returns:
- Type:
-
Promise
addGuildDiscoverySubcategory(guildID, categoryID, reasonopt) → {Promise.<Object>}
Add a guild discovery subcategory
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
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
|
Returns:
- Type:
-
Promise
addGuildMemberRole(guildID, memberID, roleID, reasonopt) → {Promise}
Add a role to a guild member
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
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, |
Returns:
- Type:
-
Promise
banGuildMember(guildID, userID, reasonopt) → {Promise}
Ban a user from a guild
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
Parameters:
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
guildID |
String
|
The ID of the guild |
||||||||||||||||||||
options |
Object
|
Options for banning the users
|
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
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 |
commands[].description |
String
|
<optional> |
The command description, required for |
|
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 |
Returns:
- Type:
-
Promise.<Array.<ApplicationCommand>>
Resolves with the overwritten application commands
bulkEditGuildCommands(guildID, commands) → {Promise.<Array.<ApplicationCommand>>}
Bulk create/edit guild application commands
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 |
commands[].description |
String
|
<optional> |
The command description, required for |
|
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 |
Returns:
- Type:
-
Promise.<Array.<ApplicationCommand>>
Resolves with the overwritten application commands
closeVoiceConnection(guildID)
Closes a voice connection with a guild ID
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.
Returns:
- Type:
-
Promise
Resolves when all shards are initialized
createAutoModerationRule(guildID, options) → {Promise.<AutoModerationRule>}
Create an auto moderation rule
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
guildID |
String
|
the ID of the guild to create the rule in |
||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object
|
The rule to create
|
Returns:
- Type:
-
Promise.<AutoModerationRule>
createChannel(guildID, name, typeopt, optionsopt) → {Promise.<(CategoryChannel|ForumChannel|TextChannel|VoiceChannel)>}
Create a channel in a guild
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
|
Returns:
- Type:
-
Promise.<(CategoryChannel|ForumChannel|TextChannel|VoiceChannel)>
createChannelInvite(channelID, optionsopt, reasonopt) → {Promise.<Invite>}
Create an invite for a channel
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channelID |
String
|
The ID of the channel |
|||||||||||||||||||||||||||||||||
options |
Object
|
<optional> |
Invite generation options
|
||||||||||||||||||||||||||||||||
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
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channelID |
String
|
The ID of the channel to create the webhook in |
|||||||||||||
options |
Object
|
Webhook options
|
|||||||||||||
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
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 |
command.description |
String
|
<optional> |
The command description, required for |
|
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 |
createEmoji(options) → {Promise.<Object>}
Create an emoji for this application
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
Emoji options
|
Returns:
- Type:
-
Promise.<Object>
An emoji object
createGroupChannel(options) → {Promise.<GroupChannel>}
Create a group channel with other users
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The options for the group channel
|
Returns:
- Type:
-
Promise.<GroupChannel>
createGuildCommand(guildID, command) → {Promise.<ApplicationCommand>}
Create a guild application command
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 |
command.description |
String
|
<optional> |
The command description, required for |
|
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 |
createGuildEmoji(guildID, options, reasonopt) → {Promise.<Object>}
Create a guild emoji object
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
guildID |
String
|
The ID of the guild to create the emoji in |
|||||||||||||||||
options |
Object
|
Emoji options
|
|||||||||||||||||
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
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
guildID |
String
|
The guild ID where the event will be created |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
event |
Object
|
The event to be created
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
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
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
guildID |
String
|
The guild ID where the sound will be created |
|||||||||||||||||||||||||||||||
sound |
Object
|
The sound to be created
|
|||||||||||||||||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<SoundboardSound>
createGuildSticker(options, reasonopt) → {Promise.<Object>}
Create a guild sticker
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
Sticker options
|
||||||||||||||||||||||||||||||
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
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.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
interactionID |
String
|
The interaction ID. |
|||||||||||||
interactionToken |
String
|
The interaction Token. |
|||||||||||||
options |
Object
|
The options object.
|
|||||||||||||
file |
Object
|
Array.<Object>
|
<optional> |
A file object (or an Array of them)
|
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
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channelID |
String
|
The ID of the channel |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
content |
String
|
Object
|
A string or object. If an object is passed:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
file |
Object
|
Array.<Object>
|
<optional> |
A file object (or an Array of them)
|
Returns:
- Type:
-
Promise.<Message>
createRole(guildID, optionsopt, reasonopt) → {Promise.<Role>}
Create a guild role
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
|
||||||||||||||||||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise.<Role>
createStageInstance(channelID, options) → {Promise.<StageInstance>}
Create a stage instance
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channelID |
String
|
The ID of the stage channel to create the instance in |
||||||||||||
options |
Object
|
The stage instance options
|
Returns:
- Type:
-
Promise.<StageInstance>
createThread(channelID, options, fileopt) → {Promise.<(NewsThreadChannel|PublicThreadChannel|PrivateThreadChannel)>}
Create a thread in a channel
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channelID |
String
|
The ID of the channel |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object
|
The thread options
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
|
Returns:
- Type:
-
Promise.<(NewsThreadChannel|PublicThreadChannel|PrivateThreadChannel)>
createThreadWithMessage(channelID, messageID, options) → {Promise.<(NewsThreadChannel|PublicThreadChannel)>}
Create a thread with an existing message
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
|
Returns:
- Type:
-
Promise.<(NewsThreadChannel|PublicThreadChannel)>
createThreadWithoutMessage(channelID, options) → {Promise.<(NewsThreadChannel|PublicThreadChannel|PrivateThreadChannel)>}
[DEPRECATED] Create a thread without an existing message. Use createThread instead
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channelID |
String
|
The ID of the channel |
||||||||||||||||||||||||||||
options |
Object
|
The thread options
|
Returns:
- Type:
-
Promise.<(NewsThreadChannel|PublicThreadChannel|PrivateThreadChannel)>
crosspostMessage(channelID, messageID) → {Promise.<Message>}
Crosspost (publish) a message to subscribed channels
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
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
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
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
Parameters:
| Name | Type | Description |
|---|---|---|
commandID |
String
|
The command id |
Returns:
- Type:
-
Promise
deleteEmoji(emojiID) → {Promise}
Delete an emoji for this application
Parameters:
| Name | Type | Description |
|---|---|---|
emojiID |
String
|
The id of the emoji |
Returns:
- Type:
-
Promise
deleteGuildCommand(guildID, commandID) → {Promise}
Delete a guild application command
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
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
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
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
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
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
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
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
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
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)
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
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
Parameters:
| Name | Type | Description |
|---|---|---|
channelID |
String
|
The stage channel associated with the instance |
Returns:
- Type:
-
Promise
deleteWebhook(webhookID, tokenopt, reasonopt) → {Promise}
Delete a webhook
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
Parameters:
| Name | Type | Description |
|---|---|---|
webhookID |
String
|
|
token |
String
|
|
messageID |
String
|
Returns:
- Type:
-
Promise
disconnect(optionsopt, nullable)
Disconnects all shards
Parameters:
| Name | Type | Attributes | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> <nullable> |
Shard disconnect options
|
editAFK(afk)
Update the bot's AFK status. Setting this to true will enable push notifications for userbots.
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
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
|
Returns:
- Type:
-
Promise.<AutoModerationRule>
editChannel(channelID, options, reasonopt) → {Promise.<(CategoryChannel|ForumChannel|GroupChannel|NewsChannel|NewsThreadChannel|PrivateThreadChannel|PublicThreadChannel|TextChannel|VoiceChannel)>}
Edit a channel's properties
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channelID |
String
|
The ID of the channel |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object
|
The properties to edit
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
editChannelPermission(channelID, overwriteID, allow, deny, type, reasonopt) → {Promise}
Create a channel permission overwrite
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).
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
|
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).
Parameters:
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
guildID |
String
|
The ID of the guild |
||||||||||||||||||||
channelPositions |
Array.<Object>
|
An array of ChannelPosition
|
Returns:
- Type:
-
Promise
editCommand(commandID, command) → {Promise.<ApplicationCommand>}
Edit a global application command
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 |
|
command.description |
String
|
<optional> |
The command description, required for |
|
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 |
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.
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 |
editEmoji(options) → {Promise.<Object>}
Edit an existing emoji for this application
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
options |
Object
|
Emoji options
|
Returns:
- Type:
-
Promise.<Object>
An emoji object
editGuild(guildID, options, reasonopt) → {Promise.<Guild>}
Edit a guild
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
guildID |
String
|
The ID of the guild |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object
|
The properties to edit
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
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 |
command.description |
String
|
<optional> |
The command description, required for |
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 |
editGuildDiscovery(guildID, optionsopt) → {Promise.<Object>}
Edit a guild's discovery data
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
guildID |
String
|
The ID of the guild |
|||||||||||||||||||||
options |
Object
|
<optional> |
The guild discovery data
|
Returns:
- Type:
-
Promise.<Object>
The updated guild's discovery object
editGuildEmoji(guildID, emojiID, options, reasonopt) → {Promise.<Object>}
Edit a guild emoji object
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
|
|||||||||||||
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
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
|
|||||||||||||||||||||||||||||||||
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
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
guildID |
String
|
The ID of the guild |
||||||||||||||||
options |
Object
|
The properties to edit
|
||||||||||||||||
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
editGuildScheduledEvent(guildID, eventID, event, reasonopt) → {Promise.<GuildScheduledEvent>}
Edit a guild scheduled event
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
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
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
|
Returns:
- Type:
-
Promise.<SoundboardSound>
editGuildSticker(stickerID, options, reasonopt) → {Promise.<Object>}
Edit a guild sticker
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
stickerID |
String
|
The ID of the sticker |
|||||||||||||||||
options |
Object
|
The properties to edit
|
|||||||||||||||||
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
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
guildID |
String
|
The ID of the guild |
||||||||||||
code |
String
|
The template code |
||||||||||||
options |
Object
|
The properties to edit
|
Returns:
- Type:
-
Promise.<GuildTemplate>
editGuildVanity(guildID, codenullable) → {Promise.<Object>}
Modify a guild's vanity code
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
Parameters:
| Name | Type | Attributes | Default | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
guildID |
String
|
The ID of the guild |
||||||||||||||||||
options |
Object
|
The properties to edit
|
||||||||||||||||||
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
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
guildID |
String
|
The ID of the guild |
|||||||||||||||||||||||||||||||||||||
options |
Object
|
<optional> |
The properties to edit
|
Returns:
- Type:
-
Promise.<Object>
editGuildWidget(guildID, options) → {Promise.<Object>}
Modify a guild's widget
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)
|
Returns:
- Type:
-
Promise.<Object>
A guild widget object
editMessage(channelID, messageID, content) → {Promise.<Message>}
Edit a message
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:
|
Returns:
- Type:
-
Promise.<Message>
editNickname(guildID, nick, reasonopt) → {Promise}
[DEPRECATED] Edit the bot's nickname in a guild
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
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
|
|||||||||||||||||||||||||||||||||
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
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.
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
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The properties to edit
|
|||||||||||||||||||||||||
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
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channelID |
String
|
The ID of the stage channel associated with the instance |
||||||||||||
options |
Object
|
The properties to edit
|
Returns:
- Type:
-
Promise.<StageInstance>
editStatus(statusopt, activitiesopt)
Update the bot's status on all guilds
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
|
editWebhook(webhookID, options, tokenopt, reasonopt) → {Promise.<Object>}
Edit a webhook
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
webhookID |
String
|
The ID of the webhook |
|||||||||||||||||
options |
Object
|
Webhook options
|
|||||||||||||||||
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
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
|
Returns:
- Type:
-
Promise.<Message>
endPoll(channelID, messageID) → {Promise.<Message>}
Immediately end a poll. Note: You cannot end polls created by another user.
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
Parameters:
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
webhookID |
String
|
The ID of the webhook |
||||||||||||||||||||
token |
String
|
The token of the webhook |
||||||||||||||||||||
options |
Object
|
Slack webhook options
|
Returns:
- Type:
-
Promise
executeWebhook(webhookID, token, options) → {Promise.<?Message>}
Execute a webhook
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
webhookID |
String
|
The ID of the webhook |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
token |
String
|
The token of the webhook |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object
|
Webhook execution options
|
Returns:
- Type:
-
Promise.<?Message>
followChannel(channelID, reasonopt) → {Object}
Follow a NewsChannel in another channel. This creates a webhook in the target channel
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
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
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
|
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
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
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)
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
Parameters:
| Name | Type | Description |
|---|---|---|
channelID |
String
|
The ID of the channel |
Returns:
getChannelInvites(channelID) → {Promise.<Array.<Invite>>}
Get all invites in a channel
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
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
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
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
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
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
Returns:
- Type:
-
Promise.<Array.<Object>>
getEmoji(emojiID) → {Promise.<Object>}
Get an emoji for this application
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
Parameters:
| Name | Type | Description |
|---|---|---|
emojiID |
String
|
The ID of the emoji |
Returns:
- Type:
-
Promise.<Guild>
getEmojis() → {Promise.<Object>}
Get the emojis for this application
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
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
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
|
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
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
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
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
guildID |
String
|
The ID of the guild |
|||||||||||||||||||||
options |
Object
|
<optional> |
Options for the request
|
Returns:
- Type:
-
Promise.<Array.<Object>>
Resolves with an array of { reason: String, user: User }
getGuildCommand(guildID, commandID) → {Promise.<Object>}
Get a guild application command
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
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
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
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
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
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
Parameters:
| Name | Type | Description |
|---|---|---|
guildID |
String
|
The ID of the guild |
getGuildPreview(guildID) → {Promise.<Object>}
Get a guild preview for a guild. Only available for community guilds.
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
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
|
Returns:
getGuildScheduledEvents(guildID, optionsopt) → {Promise.<Array.<GuildScheduledEvent>>}
Get a guild's scheduled events
Parameters:
| Name | Type | Attributes | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
guildID |
String
|
The ID of the guild |
|||||||||
options |
Object
|
<optional> |
Options for the request
|
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
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
Parameters:
| Name | Type | Description |
|---|---|---|
guildID |
String
|
The ID of the guild |
Returns:
- Type:
-
Promise.<Array.<SoundboardSound>>
getGuildTemplate(code) → {Promise.<GuildTemplate>}
Get a guild template
Parameters:
| Name | Type | Description |
|---|---|---|
code |
String
|
The template code |
Returns:
- Type:
-
Promise.<GuildTemplate>
getGuildTemplates(guildID) → {Promise.<Array.<GuildTemplate>>}
Get a guild's templates
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
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
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
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
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
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
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
guildID |
String
|
The ID of the guild |
||
style |
String
|
<optional> |
"shield" |
The style of widget image. Either |
Returns:
- Type:
-
String
The widget image link
getGuildWidgetSettings(guildID) → {Promise.<Object>}
Get a guild's widget settings object. Requires MANAGE_GUILD permission
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
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
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channelID |
String
|
The ID of the channel |
|||||||||||||
options |
Object
|
<optional> |
Additional options when requesting archived threads
|
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
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
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, |
|||||||||||||||||||||
options |
Object
|
<optional> |
Options for the request. If this is a number ([DEPRECATED] behavior), it is treated as
|
||||||||||||||||||||
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
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
|
|||||||||||||||||||||||||
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
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
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
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channelID |
String
|
The ID of the channel |
||||||||||||||||
options |
Object
|
<optional> |
The options to use to get pinned messages
|
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
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
|
getPruneCount(guildID, optionsopt) → {Promise.<Number>}
Get the prune count for a guild
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
|
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.
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.
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.
Parameters:
| Name | Type | Description |
|---|---|---|
guildID |
String
|
The ID of the guild |
Returns:
- Type:
-
Promise.<Array.<(CategoryChannel|ForumChannel|NewsChannel|StageChannel|TextChannel|VoiceChannel)>>
getRESTGuildEmoji(guildID, emojiID) → {Promise.<Object>}
Get a guild emoji via the REST API. REST mode is required to use this endpoint.
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.
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.
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.
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
|
|||||||||||||||
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.
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.
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.
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
|
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.
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.
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.
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> |
Options for the request. If this is a number ([DEPRECATED] behavior), it is treated as
|
|||||||||||||||||||||||||
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.
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.
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
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
Returns:
- Type:
-
Promise.<ExtendedUser>
getSoundboardSounds() → {Promise.<Array.<SoundboardSound>>}
Get the default soundboard sounds
Returns:
- Type:
-
Promise.<Array.<SoundboardSound>>
getStageInstance(channelID) → {Promise.<StageInstance>}
Get the stage instance associated with a stage channel
Parameters:
| Name | Type | Description |
|---|---|---|
channelID |
String
|
The stage channel ID |
Returns:
- Type:
-
Promise.<StageInstance>
getStickerPack(packID) → {Promise.<Object>}
Get a sticker pack
Parameters:
| Name | Type | Description |
|---|---|---|
packID |
String
|
The ID of the pack |
getThreadMember(channelID, userID, withMemberopt) → {Promise.<ThreadMember>}
Get a member that is part of a thread channel
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
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channelID |
String
|
The ID of the thread channel |
|||||||||||||||||||||
options |
Object
|
<optional> |
Options for the request
|
Returns:
- Type:
-
Promise.<Array.<ThreadMember>>
getVoiceRegions(guildIDopt) → {Promise.<Array.<Object>>}
Get a list of general/guild-specific voice regions
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
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
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 |
joinThread(channelID, userIDopt) → {Promise}
Join a thread
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
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channelID |
String
|
The ID of the voice channel |
|||||||||||||||||||||
options |
Object
|
<optional> |
VoiceConnection constructor options
|
kickGuildMember(guildID, userID, reasonopt) → {Promise}
Kick a user from a guild
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
Parameters:
| Name | Type | Description |
|---|---|---|
guildID |
String
|
The ID of the guild |
Returns:
- Type:
-
Promise
leaveThread(channelID, userIDopt) → {Promise}
Leave a thread
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
Parameters:
| Name | Type | Description |
|---|---|---|
channelID |
String
|
The ID of the voice channel |
pinMessage(channelID, messageID) → {Promise}
Pin a message
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
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
guildID |
String
|
The ID of the guild |
||||||||||||||||||||||||||
options |
Number
|
<optional> |
The options to pass to prune members
|
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)
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
|
|||||||||||||||||||||||||
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
removeGroupRecipient(groupID, userID) → {Promise}
Remove a user from a group
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
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
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, |
||
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.
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, |
Returns:
- Type:
-
Promise
removeMessageReactions(channelID, messageID) → {Promise}
Remove all reactions from a message
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
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
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
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
channelID |
String
|
The ID of the connected voice channel |
||||||||||||
options |
Object
|
The soundboard sound options
|
Returns:
- Type:
-
Promise
setVoiceChannelStatus(channelID, status, reasonopt) → {Promise}
Set the status of a voice channel. Note: This will not work in stage channels
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
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
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
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
Parameters:
| Name | Type | Description |
|---|---|---|
channelID |
String
|
The ID of the channel |
messageID |
String
|
The ID of the message |
Returns:
- Type:
-
Promise
validateDiscoverySearchTerm(term) → {Promise.<Object>}
Validate discovery search term
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 |
- 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 |
- 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 |
- 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 |
- 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 |
- Source:
channelCreate
Fired when a channel is created
Properties:
| Name | Type | Description |
|---|---|---|
channel |
CategoryChannel
|
ForumChannel
|
GuildChannel
|
NewsChannel
|
TextChannel
|
VoiceChannel
|
The channel |
- Source:
channelDelete
Fired when a channel is deleted
Properties:
| Name | Type | Description |
|---|---|---|
channel |
CategoryChannel
|
DMChannel
|
ForumChannel
|
NewsChannel
|
TextChannel
|
VoiceChannel
|
The channel |
- 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 |
- Source:
channelUpdate
Fired when a channel is updated
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 |
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) |
- Source:
connect
Fired when the shard establishes a connection
Properties:
| Name | Type | Description |
|---|---|---|
id |
Number
|
The ID of the shard |
- 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 |
- Source:
error
Fired when the shard encounters an error
Properties:
| Name | Type | Description |
|---|---|---|
err |
Error
|
The error |
id |
Number
|
The ID of the shard |
- Source:
guildAuditLogEntryCreate
Fired when a guild audit log entry is created
Properties:
| Name | Type | Description |
|---|---|---|
guildAuditLogEntry |
GuildAuditLogEntry
|
The created guild audit log entry |
- Source:
guildAvailable
Fired when a guild becomes available
Properties:
| Name | Type | Description |
|---|---|---|
guild |
Guild
|
The guild |
- Source:
guildBanAdd
Fired when a user is banned from a guild
Properties:
| Name | Type | Description |
|---|---|---|
guild |
Guild
|
The guild |
user |
User
|
The banned user |
- Source:
guildBanRemove
Fired when a user is unbanned from a guild
Properties:
| Name | Type | Description |
|---|---|---|
guild |
Guild
|
The guild |
user |
User
|
The banned user |
- 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 |
- 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 |
- 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 |
- 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 |
- Source:
guildMemberAdd
Fired when a member joins a server
Properties:
| Name | Type | Description |
|---|---|---|
guild |
Guild
|
The guild |
member |
Member
|
The member |
- 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 |
- 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 |
- Source:
guildMemberUpdate
Fired when a member's guild avatar, roles or nickname are updated or they start boosting a server
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 |
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 |
- Source:
guildRoleCreate
Fired when a guild role is created
Properties:
| Name | Type | Description |
|---|---|---|
guild |
Guild
|
The guild |
role |
Role
|
The role |
- Source:
guildRoleDelete
Fired when a guild role is deleted
Properties:
| Name | Type | Description |
|---|---|---|
guild |
Guild
|
The guild |
role |
Role
|
The role |
- Source:
guildRoleUpdate
Fired when a guild role is updated
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 |
- Source:
guildScheduledEventCreate
Fired when a guild scheduled event is created
Properties:
| Name | Type | Description |
|---|---|---|
event |
GuildScheduledEvent
|
The event |
- Source:
guildScheduledEventDelete
Fired when a guild scheduled event is deleted
Properties:
| Name | Type | Description |
|---|---|---|
event |
GuildScheduledEvent
|
The event that was deleted. |
- Source:
guildScheduledEventUpdate
Fired when a guild scheduled event is updated
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. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 |
entityTypeNumber
The event entity type
imageString
The hash of the event's image
nameString
The name of the event
privacyLevelNumber
The privacy level of the event
scheduledEndTimeNumber
The time the event will start
scheduledStartTimeNumber
The time the event will start
statusNumber
The status of the guild scheduled event
- 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 |
user |
User
|
Object
|
The user that subscribed to the Guild Event. If the user is uncached, this will be an object with an |
- 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 |
- Source:
guildSoundboardSoundCreate
Fired when a guild soundboard sound is created
Properties:
| Name | Type | Description |
|---|---|---|
sound |
SoundboardSound
|
The created soundboard sound |
- 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 |
- Source:
guildSoundboardSoundUpdate
Fired when a guild soundboard sound is updated
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 |
- 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 |
- 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 |
- Source:
guildUnavailable
Fired when a guild becomes unavailable
Properties:
| Name | Type | Description |
|---|---|---|
guild |
Guild
|
The guild |
- Source:
guildUpdate
Fired when a guild is updated
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) |
stickersArray.<Object>
An array of guild sticker objects
oldGuild.systemChannelFlagsNumber
the flags for the system channel
oldGuild.systemChannelIDString
The ID of the default channel for system messages (built-in join messages and boost messages)
oldGuild.vanityURLString
The vanity URL of the guild (VIP only)
oldGuild.verificationLevelNumber
The guild verification level
oldGuild.welcomeScreenObject
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: |
- 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 |
- Source:
interactionCreate
Fired when an interaction is created
Properties:
| Name | Type | Description |
|---|---|---|
interaction |
PingInteraction
|
CommandInteraction
|
ComponentInteraction
|
AutocompleteInteraction
|
ModalSubmitInteraction
|
UnknownInteraction
|
The Interaction that was created |
- 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 |
- 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 |
- Source:
messageCreate
Fired when a message is created
Properties:
| Name | Type | Description |
|---|---|---|
message |
Message
|
The message. |
- 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 |
- 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 |
- 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 |
user |
User
|
Object
|
The user who voted on the poll. If the user is not cached, this will be an object with only an |
answerID |
Number
|
The ID of the answer |
- 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 |
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 |
answerID |
Number
|
The ID of the answer |
- Source:
messageReactionAdd
Fired when someone adds a reaction to a message
Properties:
| Name | Type | Description | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
message |
Message
|
Object
|
The message object. If the message is not cached, this will be an object with |
|||||||||||||
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 |
reactorMember
|
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
burstBoolean
Whether the reaction is a super reaction
- Source:
messageReactionRemove
Fired when someone removes a reaction 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 |
|||||||||||||
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 |
userIDString
The ID of the user that removed the reaction
burstBoolean
Whether the reaction is a super reaction
- 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 |
- Source:
messageReactionRemoveEmoji
Fired when someone removes all reactions from a message for a single emoji
Properties:
| Name | Type | Description | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
message |
Message
|
Object
|
The message object. If the message is not cached, this will be an object with |
|||||||||||||
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 |
- Source:
messageUpdate
Fired when a message is updated
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 |
||||||||||||||||||||||||||||||||||||
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 |
- Source:
presenceUpdate
Fired when a guild member's status or game changes
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 |
||||||||||||||||||||||||
| 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 |
statusString
The other user's old status. Either "online", "idle", or "offline"
- Source:
rawREST
Fired when the Client's RequestHandler receives a response
Properties:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object
|
<optional> |
The data for the request. |
|||||||||||||||||||||||||||||||||||||||||||||
| 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 |
latencyNumber
The HTTP response latency
methodString
Uppercase HTTP method
respIncomingMessage
The HTTP response to the request
routeString
The calculated ratelimiting route for the request
shortBoolean
Whether or not the request was prioritized in its ratelimiting queue
urlString
URL of the endpoint
- 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 |
- 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 |
- Source:
shardPreReady
Fired when a shard finishes processing the ready packet
Properties:
| Name | Type | Description |
|---|---|---|
id |
Number
|
The ID of the shard |
- Source:
shardReady
Fired when a shard turns ready
Properties:
| Name | Type | Description |
|---|---|---|
id |
Number
|
The ID of the shard |
- Source:
shardResume
Fired when a shard resumes
Properties:
| Name | Type | Description |
|---|---|---|
id |
Number
|
The ID of the shard |
- Source:
stageInstanceCreate
Fired when a stage instance is created
Properties:
| Name | Type | Description |
|---|---|---|
stageInstance |
StageInstance
|
The stage instance |
- Source:
stageInstanceDelete
Fired when a stage instance is deleted
Properties:
| Name | Type | Description |
|---|---|---|
stageInstance |
StageInstance
|
The deleted stage instance |
- Source:
stageInstanceUpdate
Fired when a stage instance is updated
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 |
- Source:
threadCreate
Fired when a channel is created
Properties:
| Name | Type | Description |
|---|---|---|
channel |
NewsThreadChannel
|
PrivateThreadChannel
|
PublicThreadChannel
|
The channel |
- Source:
threadDelete
Fired when a thread channel is deleted
Properties:
| Name | Type | Description |
|---|---|---|
channel |
NewsThreadChannel
|
PrivateThreadChannel
|
PublicThreadChannel
|
The channel |
- 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 |
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 |
- Source:
threadMemberUpdate
Fired when a thread member is updated
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 |
- 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 |
- Source:
threadUpdate
Fired when a thread channel is updated
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 |
||||||||||||||||||||||||||||||||||||||||||||
| 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 |
- 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 |
|
user |
User
|
Object
|
The user. If the user is not cached, this will be an object with an |
|
member |
Member
|
<nullable> |
The guild member, if typing in a guild channel, or |
- Source:
unavailableGuildCreate
Fired when an unavailable guild is created
Properties:
| Name | Type | Description |
|---|---|---|
guild |
UnavailableGuild
|
The unavailable guild |
- 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 |
- Source:
userUpdate
Fired when a user's avatar, avatar decoration, discriminator, display name or username changes
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 |
- Source:
voiceChannelEffectSend
Fired when a user sends a voice channel effect
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 |
|
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 |
|
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 |
- 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 |
- 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 |
- Source:
voiceChannelStatusUpdate
Fired when a voice channel status is updated
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 |
- 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 |
- Source:
voiceStateUpdate
Fired when a guild member's voice state changes
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 |
||||||||||||||||||
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 |
- 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 |
- Source:
webhooksUpdate
Fired when a channel's webhooks are updated
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 |
- Source: