RestManager
Documentation / @discordeno/rest / RestManager
Interface: RestManager
Defined in: rest/src/types.ts:190
Properties
addDmRecipient()
addDmRecipient: (
channelId
,userId
,options
) =>Promise
<void
>
Defined in: rest/src/types.ts:348
Adds a recipient to a group DM.
Parameters
channelId
The ID of the group dm to add the user to.
userId
The user ID of the user to add to the group dm.
options
The options for adding the user
Returns
Promise
<void
>
Remarks
Requires an OAuth2 access token with the gdm.join
scope
See
https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
addGuildMember()
addGuildMember: (
guildId
,userId
,options
) =>Promise
<void
>
Defined in: rest/src/types.ts:364
Adds a member to a guild.
Parameters
guildId
The ID of the thread to add the member to.
userId
The user ID of the member to add to the thread.
options
The options for the add of a guild member
Returns
Promise
<void
>
Remarks
Requires the bot to be in the specified server
Requires an OAuth2 access token with the guilds.join
scope
Fires a Guild Member Add gateway event.
See
https://discord.com/developers/docs/resources/guild#add-guild-member
addReaction()
addReaction: (
channelId
,messageId
,reaction
) =>Promise
<void
>
Defined in: rest/src/types.ts:285
Adds a reaction to a message.
Parameters
channelId
The ID of the channel the message to add a reaction to is in.
messageId
The ID of the message to add a reaction to.
reaction
string
The reaction to add to the message.
Returns
Promise
<void
>
Remarks
Requires the READ_MESSAGE_HISTORY
permission.
If nobody else has reacted to the message:
- Requires the
ADD_REACTIONS
permission.
Fires a Message Reaction Add gateway event.
See
https://discord.com/developers/docs/resources/channel#create-reaction
addReactions()
addReactions: (
channelId
,messageId
,reactions
,ordered
?) =>Promise
<void
>
Defined in: rest/src/types.ts:304
Adds multiple a reaction to a message.
This function uses the addReaction()
helper behind the scenes.
Parameters
channelId
The ID of the channel the message to add reactions to is in.
messageId
The ID of the message to add the reactions to.
reactions
string
[]
The reactions to add to the message.
ordered?
boolean
Whether the reactions must be added in order or not.
Returns
Promise
<void
>
Remarks
Requires the READ_MESSAGE_HISTORY
permission.
If nobody else has reacted to the message:
- Requires the
ADD_REACTIONS
permission.
Fires a Message Reaction Add gateway event for every reaction added.
addRole()
addRole: (
guildId
,userId
,roleId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:320
Adds a role to a member.
Parameters
guildId
The ID of the guild the member to add the role to is in.
userId
The user ID of the member to add the role to.
roleId
The ID of the role to add to the member.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
Requires the MANAGE_ROLES
permission.
Fires a Guild Member Update gateway event.
See
https://discord.com/developers/docs/resources/guild#add-guild-member-role
addThreadMember()
addThreadMember: (
channelId
,userId
) =>Promise
<void
>
Defined in: rest/src/types.ts:335
Adds a member to a thread.
Parameters
channelId
The ID of the thread to add the member to.
userId
The user ID of the member to add to the thread.
Returns
Promise
<void
>
Remarks
Requires the ability to send messages in the thread. Requires the thread not be archived.
Fires a Thread Members Update gateway event.
See
https://discord.com/developers/docs/resources/channel#add-thread-member
applicationId
applicationId:
bigint
Defined in: rest/src/types.ts:194
The application id. Normally this is not required for recent bots but old bot's application id is sometimes different from the bot id so it is required for those bots.
authorization?
optional
authorization:string
Defined in: rest/src/types.ts:210
The authorization header value to attach when sending requests to the proxy.
authorizationHeader
authorizationHeader:
string
Defined in: rest/src/types.ts:212
The authorization header name to attach when sending requests to the proxy
banMember()
banMember: (
guildId
,userId
,options
?,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:2769
Bans a user from a guild.
Parameters
guildId
The ID of the guild to ban the user from.
userId
The ID of the user to ban from the guild.
options?
The parameters for the creation of the ban.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
Requires the BAN_MEMBERS
permission.
Fires a Guild Ban Add gateway event.
See
https://discord.com/developers/docs/resources/guild#create-guild-ban
baseUrl
baseUrl:
string
Defined in: rest/src/types.ts:202
The base url to connect to. If you create a proxy rest, that url would go here. IT SHOULD NOT END WITH A /
Default
https://discord.com/api
bulkBanMembers()
bulkBanMembers: (
guildId
,options
,reason
?) =>Promise
<{bannedUsers
:string
[];failedUsers
:string
[]; }>
Defined in: rest/src/types.ts:2786
Bans up to 200 users from a guild.
Parameters
guildId
The ID of the guild to ban the users from.
options
The users to ban and the other options for the ban.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ bannedUsers
: string
[]; failedUsers
: string
[]; }>
Remarks
Requires the BAN_MEMBERS
and MANAGE_GUILD
permissions.
If all provided users fail to be banned, discord will respond with an error (code: 500000: Failed to ban users
)
Fires as many Guild Ban Add gateway events as many user where banned.
See
https://discord.com/developers/docs/resources/guild#bulk-guild-ban
changeToDiscordFormat()
changeToDiscordFormat: (
obj
) =>any
Defined in: rest/src/types.ts:242
Reshapes and modifies the obj as needed to make it ready for discords api.
Parameters
obj
any
Returns
any
checkRateLimits()
checkRateLimits: (
url
,identifier
) =>number
|false
Defined in: rest/src/types.ts:238
Check the rate limits for a url or a bucket.
Parameters
url
string
identifier
string
Returns
number
| false
consumeEntitlement()
consumeEntitlement: (
applicationId
,entitlementId
) =>Promise
<void
>
Defined in: rest/src/types.ts:3029
For One-Time Purchase consumable SKUs, marks a given entitlement for the user as consumed. The entitlement will have consumed: true
when using List Entitlements
Parameters
applicationId
The id of the application to get the entitlement
entitlementId
The id of the entitlement to get
Returns
Promise
<void
>
createApplicationEmoji()
createApplicationEmoji: (
options
) =>Promise
<{animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:427
Creates an emoji for the application.
Parameters
options
The parameters for the creation of the emoji.
Returns
Promise
<{ animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
An instance of the created DiscordEmoji.
See
https://discord.com/developers/docs/resources/emoji#create-application-emoji
createAutomodRule()
createAutomodRule: (
guildId
,options
,reason
?) =>Promise
<{actions
:object
[];creatorId
:string
;enabled
:boolean
;eventType
:AutoModerationEventTypes
;exemptChannels
:string
[];exemptRoles
:string
[];guildId
:string
;id
:string
;name
:string
;triggerMetadata
: {allowList
:string
[];keywordFilter
:string
[];mentionRaidProtectionEnabled
:boolean
;mentionTotalLimit
:number
;presets
:DiscordAutoModerationRuleTriggerMetadataPresets
[];regexPatterns
:string
[]; };triggerType
:AutoModerationTriggerTypes
; }>
Defined in: rest/src/types.ts:380
Creates an automod rule in a guild.
Parameters
guildId
The ID of the guild to create the rule in.
options
CreateAutoModerationRuleOptions
The parameters for the creation of the rule.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ actions
: object
[]; creatorId
: string
; enabled
: boolean
; eventType
: AutoModerationEventTypes
; exemptChannels
: string
[]; exemptRoles
: string
[]; guildId
: string
; id
: string
; name
: string
; triggerMetadata
: { allowList
: string
[]; keywordFilter
: string
[]; mentionRaidProtectionEnabled
: boolean
; mentionTotalLimit
: number
; presets
: DiscordAutoModerationRuleTriggerMetadataPresets
[]; regexPatterns
: string
[]; }; triggerType
: AutoModerationTriggerTypes
; }>
An instance of the created DiscordAutoModerationRule.
Remarks
Requires the MANAGE_GUILD
permission.
Fires an Auto Moderation Rule Create gateway event.
See
https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
createBaseHeaders()
createBaseHeaders: () =>
Record
<string
,string
>
Defined in: rest/src/types.ts:234
Allows the user to inject custom headers that will be sent with every request.
Returns
Record
<string
, string
>
createChannel()
createChannel: (
guildId
,options
,reason
?) =>Promise
<{applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; }>
Defined in: rest/src/types.ts:400
Creates a channel within a guild.
Parameters
guildId
The ID of the guild to create the channel within.
options
The parameters for the creation of the channel.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }>
An instance of the created DiscordChannel.
Remarks
Requires the MANAGE_CHANNELS
permission.
If setting permission overwrites, only the permissions the bot user has in the guild can be allowed or denied.
Setting the MANAGE_ROLES
permission is only possible for guild administrators.
Fires a Channel Create gateway event.
See
https://discord.com/developers/docs/resources/guild#create-guild-channel
createEmoji()
createEmoji: (
guildId
,options
,reason
?) =>Promise
<{animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:418
Creates an emoji in a guild.
Parameters
guildId
The ID of the guild in which to create the emoji.
options
The parameters for the creation of the emoji.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
An instance of the created DiscordEmoji.
Remarks
Requires the CREATE_GUILD_EXPRESSIONS
permission.
Emojis have a maximum file size of 256 kilobits. Attempting to upload a larger emoji will cause the route to return 400 Bad Request.
Fires a Guild Emojis Update gateway event.
See
https://discord.com/developers/docs/resources/emoji#create-guild-emoji
createForumThread()
createForumThread: (
channelId
,options
,reason
?) =>Promise
<{applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; }>
Defined in: rest/src/types.ts:444
Creates a new thread in a forum channel or media channel, and sends a message within the created thread.
Parameters
channelId
The ID of the forum channel to create the thread within.
options
The parameters for the creation of the thread.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }>
An instance of DiscordChannel with a nested DiscordChannel object.
Remarks
Requires the CREATE_MESSAGES
permission.
Fires a Thread Create gateway event. Fires a Message Create gateway event.
See
https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel
createGlobalApplicationCommand()
createGlobalApplicationCommand: (
command
,options
?) =>Promise
<{applicationId
:string
;contexts
:null
|DiscordInteractionContextType
[];defaultMemberPermissions
:null
|string
;description
:string
;descriptionLocalizations
:null
| {bg
:string
;cs
:string
;da
:string
;de
:string
;el
:string
;en-GB
:string
;en-US
:string
;es-419
:string
;es-ES
:string
;fi
:string
;fr
:string
;hi
:string
;hr
:string
;hu
:string
;id
:string
;it
:string
;ja
:string
;ko
:string
;lt
:string
;nl
:string
;no
:string
;pl
:string
;pt-BR
:string
;ro
:string
;ru
:string
;sv-SE
:string
;th
:string
;tr
:string
;uk
:string
;vi
:string
;zh-CN
:string
;zh-TW
:string
; };dmPermission
:boolean
;guildId
:string
;handler
:DiscordInteractionEntryPointCommandHandlerType
;id
:string
;integrationTypes
:DiscordApplicationIntegrationType
[];name
:string
;nameLocalizations
:null
| {bg
:string
;cs
:string
;da
:string
;de
:string
;el
:string
;en-GB
:string
;en-US
:string
;es-419
:string
;es-ES
:string
;fi
:string
;fr
:string
;hi
:string
;hr
:string
;hu
:string
;id
:string
;it
:string
;ja
:string
;ko
:string
;lt
:string
;nl
:string
;no
:string
;pl
:string
;pt-BR
:string
;ro
:string
;ru
:string
;sv-SE
:string
;th
:string
;tr
:string
;uk
:string
;vi
:string
;zh-CN
:string
;zh-TW
:string
; };nsfw
:boolean
;options
:object
[];type
:ApplicationCommandTypes
;version
:string
; }>
Defined in: rest/src/types.ts:462
Creates an application command accessible globally; across different guilds and channels.
Parameters
command
The command to create.
options?
CreateGlobalApplicationCommandOptions
Additional options for the endpoint
Returns
Promise
<{ applicationId
: string
; contexts
: null
| DiscordInteractionContextType
[]; defaultMemberPermissions
: null
| string
; description
: string
; descriptionLocalizations
: null
| { bg
: string
; cs
: string
; da
: string
; de
: string
; el
: string
; en-GB
: string
; en-US
: string
; es-419
: string
; es-ES
: string
; fi
: string
; fr
: string
; hi
: string
; hr
: string
; hu
: string
; id
: string
; it
: string
; ja
: string
; ko
: string
; lt
: string
; nl
: string
; no
: string
; pl
: string
; pt-BR
: string
; ro
: string
; ru
: string
; sv-SE
: string
; th
: string
; tr
: string
; uk
: string
; vi
: string
; zh-CN
: string
; zh-TW
: string
; }; dmPermission
: boolean
; guildId
: string
; handler
: DiscordInteractionEntryPointCommandHandlerType
; id
: string
; integrationTypes
: DiscordApplicationIntegrationType
[]; name
: string
; nameLocalizations
: null
| { bg
: string
; cs
: string
; da
: string
; de
: string
; el
: string
; en-GB
: string
; en-US
: string
; es-419
: string
; es-ES
: string
; fi
: string
; fr
: string
; hi
: string
; hr
: string
; hu
: string
; id
: string
; it
: string
; ja
: string
; ko
: string
; lt
: string
; nl
: string
; no
: string
; pl
: string
; pt-BR
: string
; ro
: string
; ru
: string
; sv-SE
: string
; th
: string
; tr
: string
; uk
: string
; vi
: string
; zh-CN
: string
; zh-TW
: string
; }; nsfw
: boolean
; options
: object
[]; type
: ApplicationCommandTypes
; version
: string
; }>
An instance of the created DiscordApplicationCommand.
Remarks
⚠️ Creating a command with the same name as an existing command for your application will overwrite the old command. ⚠️ Global commands once created are cached for periods of an hour, so changes made to existing commands will take an hour to surface. ⚠️ You can only create up to 200 new commands daily.
When using the bearer token the token needs the applications.commands.update
scope and must be a Client grant
token.
You will be able to update only your own application commands
See
createGuild()
createGuild: (
options
) =>Promise
<{afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; }>
Defined in: rest/src/types.ts:479
Creates a guild.
Parameters
options
The parameters for the creation of the guild.
Returns
Promise
<{ afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }>
An instance of the created DiscordGuild.
Remarks
⚠️ This route can only be used by bots in fewer than 10 guilds.
Fires a Guild Create gateway event.
See
https://discord.com/developers/docs/resources/guild#create-guild
createGuildApplicationCommand()
createGuildApplicationCommand: (
command
,guildId
,options
?) =>Promise
<{applicationId
:string
;contexts
:null
|DiscordInteractionContextType
[];defaultMemberPermissions
:null
|string
;description
:string
;descriptionLocalizations
:null
| {bg
:string
;cs
:string
;da
:string
;de
:string
;el
:string
;en-GB
:string
;en-US
:string
;es-419
:string
;es-ES
:string
;fi
:string
;fr
:string
;hi
:string
;hr
:string
;hu
:string
;id
:string
;it
:string
;ja
:string
;ko
:string
;lt
:string
;nl
:string
;no
:string
;pl
:string
;pt-BR
:string
;ro
:string
;ru
:string
;sv-SE
:string
;th
:string
;tr
:string
;uk
:string
;vi
:string
;zh-CN
:string
;zh-TW
:string
; };dmPermission
:boolean
;guildId
:string
;handler
:DiscordInteractionEntryPointCommandHandlerType
;id
:string
;integrationTypes
:DiscordApplicationIntegrationType
[];name
:string
;nameLocalizations
:null
| {bg
:string
;cs
:string
;da
:string
;de
:string
;el
:string
;en-GB
:string
;en-US
:string
;es-419
:string
;es-ES
:string
;fi
:string
;fr
:string
;hi
:string
;hr
:string
;hu
:string
;id
:string
;it
:string
;ja
:string
;ko
:string
;lt
:string
;nl
:string
;no
:string
;pl
:string
;pt-BR
:string
;ro
:string
;ru
:string
;sv-SE
:string
;th
:string
;tr
:string
;uk
:string
;vi
:string
;zh-CN
:string
;zh-TW
:string
; };nsfw
:boolean
;options
:object
[];type
:ApplicationCommandTypes
;version
:string
; }>
Defined in: rest/src/types.ts:497
Creates an application command only accessible in a specific guild.
Parameters
command
The command to create.
guildId
The ID of the guild to create the command for.
options?
CreateGuildApplicationCommandOptions
Additional options for the endpoint
Returns
Promise
<{ applicationId
: string
; contexts
: null
| DiscordInteractionContextType
[]; defaultMemberPermissions
: null
| string
; description
: string
; descriptionLocalizations
: null
| { bg
: string
; cs
: string
; da
: string
; de
: string
; el
: string
; en-GB
: string
; en-US
: string
; es-419
: string
; es-ES
: string
; fi
: string
; fr
: string
; hi
: string
; hr
: string
; hu
: string
; id
: string
; it
: string
; ja
: string
; ko
: string
; lt
: string
; nl
: string
; no
: string
; pl
: string
; pt-BR
: string
; ro
: string
; ru
: string
; sv-SE
: string
; th
: string
; tr
: string
; uk
: string
; vi
: string
; zh-CN
: string
; zh-TW
: string
; }; dmPermission
: boolean
; guildId
: string
; handler
: DiscordInteractionEntryPointCommandHandlerType
; id
: string
; integrationTypes
: DiscordApplicationIntegrationType
[]; name
: string
; nameLocalizations
: null
| { bg
: string
; cs
: string
; da
: string
; de
: string
; el
: string
; en-GB
: string
; en-US
: string
; es-419
: string
; es-ES
: string
; fi
: string
; fr
: string
; hi
: string
; hr
: string
; hu
: string
; id
: string
; it
: string
; ja
: string
; ko
: string
; lt
: string
; nl
: string
; no
: string
; pl
: string
; pt-BR
: string
; ro
: string
; ru
: string
; sv-SE
: string
; th
: string
; tr
: string
; uk
: string
; vi
: string
; zh-CN
: string
; zh-TW
: string
; }; nsfw
: boolean
; options
: object
[]; type
: ApplicationCommandTypes
; version
: string
; }>
An instance of the created DiscordApplicationCommand.
Remarks
⚠️ Creating a command with the same name as an existing command for your application will overwrite the old command. ⚠️ You can only create up to 200 new commands daily.
When using the bearer token the token needs the applications.commands.update
scope and must be a Client grant
token.
You will be able to update only your own application commands
See
createGuildFromTemplate()
createGuildFromTemplate: (
templateCode
,options
) =>Promise
<{afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; }>
Defined in: rest/src/types.ts:516
Creates a guild from a template.
Parameters
templateCode
string
The code of the template.
options
The parameters for the creation of the guild.
Returns
Promise
<{ afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }>
An instance of the created DiscordGuild.
Remarks
⚠️ This route can only be used by bots in fewer than 10 guilds.
Fires a Guild Create gateway event.
See
https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
createGuildSoundboardSound()
createGuildSoundboardSound: (
guildId
,options
,reason
?) =>Promise
<{available
:boolean
;emojiId
:null
|string
;emojiName
:null
|string
;guildId
:string
;name
:string
;soundId
:string
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };volume
:number
; }>
Defined in: rest/src/types.ts:3093
Create a new soundboard sound for the guild.
Parameters
guildId
The guild to create the sounds in
options
The options to create the sound
reason?
string
The audit log reason
Returns
Promise
<{ available
: boolean
; emojiId
: null
| string
; emojiName
: null
| string
; guildId
: string
; name
: string
; soundId
: string
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; volume
: number
; }>
Remarks
Fires a Guild Soundboard Sound Create Gateway event.
Requires the CREATE_GUILD_EXPRESSIONS
permission.
createGuildSticker()
createGuildSticker: (
guildId
,options
,reason
?) =>Promise
<{available
:boolean
;description
:string
;formatType
:StickerFormatTypes
;guildId
:string
;id
:string
;name
:string
;packId
:string
;sortValue
:number
;tags
:string
;type
:StickerTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:532
Create a new sticker for the guild.
Parameters
guildId
The ID of the guild to get
options
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ available
: boolean
; description
: string
; formatType
: StickerFormatTypes
; guildId
: string
; id
: string
; name
: string
; packId
: string
; sortValue
: number
; tags
: string
; type
: StickerTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
Remarks
Requires the CREATE_GUILD_EXPRESSIONS
permission.
Fires a Guild Stickers Update Gateway event.
Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
Lottie stickers can only be uploaded on guilds that have either the VERIFIED
and/or the PARTNERED
guild feature.
See
https://discord.com/developers/docs/resources/sticker#create-guild-sticker
createGuildTemplate()
createGuildTemplate: (
guildId
,options
) =>Promise
<{code
:string
;createdAt
:string
;creator
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };creatorId
:string
;description
:null
|string
;isDirty
:null
|boolean
;name
:string
;serializedSourceGuild
: {afkChannelId
:null
|number
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|number
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };sourceGuildId
:string
;updatedAt
:string
;usageCount
:number
; }>
Defined in: rest/src/types.ts:547
Creates a template from a guild.
Parameters
guildId
The ID of the guild to create the template from.
options
The parameters for the creation of the template.
Returns
Promise
<{ code
: string
; createdAt
: string
; creator
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; creatorId
: string
; description
: null
| string
; isDirty
: null
| boolean
; name
: string
; serializedSourceGuild
: { afkChannelId
: null
| number
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| number
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; sourceGuildId
: string
; updatedAt
: string
; usageCount
: number
; }>
An instance of the created DiscordTemplate.
Remarks
Requires the MANAGE_GUILD
permission.
Fires a Guild Update gateway event.
See
https://discord.com/developers/docs/resources/guild-template#create-guild-template
createInvite()
createInvite: (
channelId
,options
?,reason
?) =>Promise
<{approximateMemberCount
:number
;approximatePresenceCount
:number
;channel
:null
| {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };code
:string
;expiresAt
:null
|string
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildScheduledEvent
: {channelId
:null
|string
;creator
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };creatorId
:null
|string
;description
:string
;entityId
:null
|string
;entityMetadata
:null
| {location
:string
; };entityType
:ScheduledEventEntityType
;guildId
:string
;id
:string
;image
:null
|string
;name
:string
;privacyLevel
:GuildOnly
;recurrenceRule
:null
| {byMonth
:null
|DiscordScheduledEventRecurrenceRuleMonth
[];byMonthDay
:null
|number
[];byNWeekday
:null
|object
[];byWeekday
:null
|DiscordScheduledEventRecurrenceRuleWeekday
[];byYearDay
:null
|number
[];count
:null
|number
;end
:null
|string
;frequency
:DiscordScheduledEventRecurrenceRuleFrequency
;interval
:number
;start
:string
; };scheduledEndTime
:null
|string
;scheduledStartTime
:string
;status
:ScheduledEventStatus
;userCount
:number
; };inviter
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };stageInstance
: {members
:object
[];participantCount
:number
;speakerCount
:number
;topic
:string
; };targetApplication
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; };1
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };targetType
:TargetTypes
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };type
:DiscordInviteType
; }>
Defined in: rest/src/types.ts:566
Creates an invite to a channel in a guild.
Parameters
channelId
The ID of the channel to create the invite to.
options?
The parameters for the creation of the invite.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ approximateMemberCount
: number
; approximatePresenceCount
: number
; channel
: null
| { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; code
: string
; expiresAt
: null
| string
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildScheduledEvent
: { channelId
: null
| string
; creator
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; creatorId
: null
| string
; description
: string
; entityId
: null
| string
; entityMetadata
: null
| { location
: string
; }; entityType
: ScheduledEventEntityType
; guildId
: string
; id
: string
; image
: null
| string
; name
: string
; privacyLevel
: GuildOnly
; recurrenceRule
: null
| { byMonth
: null
| DiscordScheduledEventRecurrenceRuleMonth
[]; byMonthDay
: null
| number
[]; byNWeekday
: null
| object
[]; byWeekday
: null
| DiscordScheduledEventRecurrenceRuleWeekday
[]; byYearDay
: null
| number
[]; count
: null
| number
; end
: null
| string
; frequency
: DiscordScheduledEventRecurrenceRuleFrequency
; interval
: number
; start
: string
; }; scheduledEndTime
: null
| string
; scheduledStartTime
: string
; status
: ScheduledEventStatus
; userCount
: number
; }; inviter
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; stageInstance
: { members
: object
[]; participantCount
: number
; speakerCount
: number
; topic
: string
; }; targetApplication
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; 1
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; targetType
: TargetTypes
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; type
: DiscordInviteType
; }>
An instance of the created DiscordInvite.
Remarks
Requires the CREATE_INSTANT_INVITE
permission.
Fires an Invite Create gateway event.
See
https://discord.com/developers/docs/resources/channel#create-channel-invite
createRequestBody()
createRequestBody: (
method
,options
?) =>RequestBody
Defined in: rest/src/types.ts:244
Creates the request body and headers that are necessary to send a request. Will handle different types of methods and everything necessary for discord.
Parameters
method
options?
Returns
createRole()
createRole: (
guildId
,options
,reason
?) =>Promise
<{color
:number
;flags
:RoleFlags
;hoist
:boolean
;icon
:string
;id
:string
;managed
:boolean
;mentionable
:boolean
;name
:string
;permissions
:string
;position
:number
;tags
: {availableForPurchase
:null
;botId
:string
;guildConnections
:null
;integrationId
:string
;premiumSubscriber
:null
;subscriptionListingId
:string
; };unicodeEmoji
:string
; }>
Defined in: rest/src/types.ts:582
Creates a role in a guild.
Parameters
guildId
The ID of the guild to create the role in.
options
The parameters for the creation of the role.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ color
: number
; flags
: RoleFlags
; hoist
: boolean
; icon
: string
; id
: string
; managed
: boolean
; mentionable
: boolean
; name
: string
; permissions
: string
; position
: number
; tags
: { availableForPurchase
: null
; botId
: string
; guildConnections
: null
; integrationId
: string
; premiumSubscriber
: null
; subscriptionListingId
: string
; }; unicodeEmoji
: string
; }>
An instance of the created DiscordRole.
Remarks
Requires the MANAGE_ROLES
permission.
Fires a Guild Role Create gateway event.
See
https://discord.com/developers/docs/resources/guild#create-guild-role
createScheduledEvent()
createScheduledEvent: (
guildId
,options
,reason
?) =>Promise
<{channelId
:null
|string
;creator
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };creatorId
:null
|string
;description
:string
;entityId
:null
|string
;entityMetadata
:null
| {location
:string
; };entityType
:ScheduledEventEntityType
;guildId
:string
;id
:string
;image
:null
|string
;name
:string
;privacyLevel
:GuildOnly
;recurrenceRule
:null
| {byMonth
:null
|DiscordScheduledEventRecurrenceRuleMonth
[];byMonthDay
:null
|number
[];byNWeekday
:null
|object
[];byWeekday
:null
|DiscordScheduledEventRecurrenceRuleWeekday
[];byYearDay
:null
|number
[];count
:null
|number
;end
:null
|string
;frequency
:DiscordScheduledEventRecurrenceRuleFrequency
;interval
:number
;start
:string
; };scheduledEndTime
:null
|string
;scheduledStartTime
:string
;status
:ScheduledEventStatus
;userCount
:number
; }>
Defined in: rest/src/types.ts:600
Creates a scheduled event in a guild.
Parameters
guildId
The ID of the guild to create the scheduled event in.
options
The parameters for the creation of the scheduled event.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ channelId
: null
| string
; creator
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; creatorId
: null
| string
; description
: string
; entityId
: null
| string
; entityMetadata
: null
| { location
: string
; }; entityType
: ScheduledEventEntityType
; guildId
: string
; id
: string
; image
: null
| string
; name
: string
; privacyLevel
: GuildOnly
; recurrenceRule
: null
| { byMonth
: null
| DiscordScheduledEventRecurrenceRuleMonth
[]; byMonthDay
: null
| number
[]; byNWeekday
: null
| object
[]; byWeekday
: null
| DiscordScheduledEventRecurrenceRuleWeekday
[]; byYearDay
: null
| number
[]; count
: null
| number
; end
: null
| string
; frequency
: DiscordScheduledEventRecurrenceRuleFrequency
; interval
: number
; start
: string
; }; scheduledEndTime
: null
| string
; scheduledStartTime
: string
; status
: ScheduledEventStatus
; userCount
: number
; }>
An instance of the created DiscordScheduledEvent.
Remarks
Requires the MANAGE_EVENTS
permission.
A guild can only have a maximum of 100 events with a status of ScheduledEventStatus.Active or ScheduledEventStatus.Scheduled (inclusive).
Fires a Guild Scheduled Event Create gateway event.
See
https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
createStageInstance()
createStageInstance: (
options
,reason
?) =>Promise
<{channelId
:string
;guildId
:string
;guildScheduledEventId
:string
;id
:string
;topic
:string
; }>
Defined in: rest/src/types.ts:615
Creates a stage instance associated with a stage channel.
Parameters
options
The parameters for the creation of the stage instance.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ channelId
: string
; guildId
: string
; guildScheduledEventId
: string
; id
: string
; topic
: string
; }>
An instance of the created DiscordStageInstance.
Remarks
Requires the user to be a moderator of the stage channel.
Fires a Stage Instance Create gateway event.
See
https://discord.com/developers/docs/resources/stage-instance#create-stage-instance
createTestEntitlement()
createTestEntitlement: (
applicationId
,body
) =>Promise
<Partial
<{applicationId
:string
;consumed
:boolean
;deleted
:boolean
;endsAt
:null
|string
;guildId
:string
;id
:string
;skuId
:string
;startsAt
:null
|string
;type
:DiscordEntitlementType
;userId
:string
; }>>
Defined in: rest/src/types.ts:3015
Creates a test entitlement to a given SKU for a given guild or user. Discord will act as though that user or guild has entitlement to your premium offering.
Parameters
applicationId
The id of the application to create the entitlement
body
The options for new entitlement
Returns
Promise
<Partial
<{ applicationId
: string
; consumed
: boolean
; deleted
: boolean
; endsAt
: null
| string
; guildId
: string
; id
: string
; skuId
: string
; startsAt
: null
| string
; type
: DiscordEntitlementType
; userId
: string
; }>>
Remarks
This endpoint returns a partial entitlement object. It will not contain subscription_id, starts_at, or ends_at, as it's valid in perpetuity.
createWebhook()
createWebhook: (
channelId
,options
,reason
?) =>Promise
<Camelize
<DiscordWebhook
>>
Defined in: rest/src/types.ts:633
Creates a webhook.
Parameters
channelId
The ID of the channel to create the webhook in.
options
The parameters for the creation of the webhook.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<Camelize
<DiscordWebhook
>>
An instance of the created DiscordWebhook.
Remarks
Requires the MANAGE_WEBHOOKS
permission.
⚠️ The webhook name must not contain the substrings 'clyde', or 'discord' (case-insensitive).
Fires a Webhooks Update gateway event.
See
https://discord.com/developers/docs/resources/webhook#create-webhook
delete()
delete: (
url
,options
?) =>Promise
<void
>
Defined in: rest/src/types.ts:264
Make a delete request to the api.
Parameters
url
string
options?
Omit
<MakeRequestOptions
, "body"
>
Returns
Promise
<void
>
deleteApplicationEmoji()
deleteApplicationEmoji: (
id
) =>Promise
<void
>
Defined in: rest/src/types.ts:713
Deletes an emoji from the application.
Parameters
id
The ID of the emoji to delete.
Returns
Promise
<void
>
See
https://discord.com/developers/docs/resources/emoji#delete-application-emoji
deleteAutomodRule()
deleteAutomodRule: (
guildId
,ruleId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:648
Deletes an automod rule.
Parameters
guildId
The ID of the guild to delete the rule from.
ruleId
The ID of the automod rule to delete.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
Requires the MANAGE_GUILD
permission.
Fires an Auto Moderation Rule Delete gateway event.
See
https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule
deleteChannel()
deleteChannel: (
channelId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:674
Deletes a channel from within a guild.
Parameters
channelId
The ID of the channel to delete.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
nothing
Remarks
For community guilds, the Rules, Guidelines and Community Update channels cannot be deleted.
If the channel is a thread:
-
Requires the
MANAGE_THREADS
permission. -
Fires a Thread Delete gateway event.
Otherwise:
-
Requires the
MANAGE_CHANNELS
permission. -
⚠️ Deleting a category channel does not delete its child channels. Instead, they will have their
parent_id
property removed, and aChannel Update
gateway event will fire for each of them. -
Fires a Channel Delete gateway event.
See
https://discord.com/developers/docs/resources/channel#deleteclose-channel
deleteChannelPermissionOverride()
deleteChannelPermissionOverride: (
channelId
,overwriteId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:689
Deletes a permission override for a user or role in a channel.
Parameters
channelId
The ID of the channel to delete the permission override of.
overwriteId
The ID of the permission override to delete.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
Requires the MANAGE_ROLES
permission.
Fires a Channel Update gateway event.
See
https://discord.com/developers/docs/resources/channel#delete-channel-permission
deleteEmoji()
deleteEmoji: (
guildId
,id
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:705
Deletes an emoji from a guild.
Parameters
guildId
The ID of the guild from which to delete the emoji.
id
The ID of the emoji to delete.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
For emojis created by the current user, requires either the CREATE_GUILD_EXPRESSIONS
or MANAGE_GUILD_EXPRESSIONS
permission.
For other emojis, requires the MANAGE_GUILD_EXPRESSIONS
permission.
Fires a Guild Emojis Update gateway event.
See
https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
deleteFollowupMessage()
deleteFollowupMessage: (
token
,messageId
) =>Promise
<void
>
Defined in: rest/src/types.ts:727
Deletes a follow-up message to an interaction.
Parameters
token
string
The interaction token to use, provided in the original interaction.
messageId
The ID of the message to delete.
Returns
Promise
<void
>
Remarks
Unlike deleteMessage()
, this endpoint allows the bot user to act without needing to see the channel the message is in.
Fires a Message Delete event.
See
https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message
deleteGlobalApplicationCommand()
deleteGlobalApplicationCommand: (
commandId
) =>Promise
<void
>
Defined in: rest/src/types.ts:735
Deletes an application command registered globally.
Parameters
commandId
The ID of the command to delete.
Returns
Promise
<void
>
See
deleteGuild()
deleteGuild: (
guildId
) =>Promise
<void
>
Defined in: rest/src/types.ts:748
Deletes a guild.
Parameters
guildId
The ID of the guild to delete.
Returns
Promise
<void
>
Remarks
The bot user must be the owner of the guild.
Fires a Guild Delete gateway event.
See
https://discord.com/developers/docs/resources/guild#delete-guild
deleteGuildApplicationCommand()
deleteGuildApplicationCommand: (
commandId
,guildId
) =>Promise
<void
>
Defined in: rest/src/types.ts:757
Deletes an application command registered in a guild.
Parameters
commandId
The ID of the command to delete from the guild.
guildId
The ID of the guild to delete the command from.
Returns
Promise
<void
>
See
deleteGuildSoundboardSound()
deleteGuildSoundboardSound: (
guildId
,soundId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:3127
Delete the given soundboard sound.
Parameters
guildId
The guild to create the sounds in
soundId
The sound id to delete
reason?
string
The audit log reason
Returns
Promise
<void
>
Remarks
Fires a Guild Soundboard Sound Delete Gateway event.
For sounds created by the current user, requires either the CREATE_GUILD_EXPRESSIONS
or MANAGE_GUILD_EXPRESSIONS
permission.
For other sounds, requires the MANAGE_GUILD_EXPRESSIONS
permission.
deleteGuildSticker()
deleteGuildSticker: (
guildId
,stickerId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:774
Delete a new sticker for the guild.
Parameters
guildId
The ID of the guild to get
stickerId
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
For stickers created by the current user, requires either the CREATE_GUILD_EXPRESSIONS
or MANAGE_GUILD_EXPRESSIONS
permission.
For other stickers, requires the MANAGE_GUILD_EXPRESSIONS
permission.
Fires a Guild Stickers Update Gateway event.
Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
Lottie stickers can only be uploaded on guilds that have either the VERIFIED
and/or the PARTNERED
guild feature.
See
https://discord.com/developers/docs/resources/sticker#delete-guild-sticker
deleteGuildTemplate()
deleteGuildTemplate: (
guildId
,templateCode
) =>Promise
<void
>
Defined in: rest/src/types.ts:788
Deletes a template from a guild.
Parameters
guildId
The ID of the guild to delete the template from.
templateCode
string
The code of the template to delete.
Returns
Promise
<void
>
Remarks
Requires the MANAGE_GUILD
permission.
Fires a Guild Update gateway event.
See
https://discord.com/developers/docs/resources/guild-template#delete-guild-template
deleteIntegration()
deleteIntegration: (
guildId
,integrationId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:806
Deletes an integration attached to a guild.
Parameters
guildId
The ID of the guild from which to delete the integration.
integrationId
The ID of the integration to delete from the guild.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
Requires the MANAGE_GUILD
permission.
Deletes all webhooks associated with the integration, and kicks the associated bot if there is one.
Fires a Guild Integrations Update gateway event. Fires a Integration Delete gateway event.
See
https://discord.com/developers/docs/resources/guild#delete-guild-integration
deleteInvite()
deleteInvite: (
inviteCode
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:820
Deletes an invite to a channel.
Parameters
inviteCode
string
The invite code of the invite to delete.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
Requires the MANAGE_CHANNELS
permission.
Fires an Invite Delete gateway event.
See
https://discord.com/developers/docs/resources/channel#delete-channel-invite
deleteMessage()
deleteMessage: (
channelId
,messageId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:836
Deletes a message from a channel.
Parameters
channelId
The ID of the channel to delete the message from.
messageId
The ID of the message to delete from the channel.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
If not deleting own message:
- Requires the
MANAGE_MESSAGES
permission.
Fires a Message Delete gateway event.
See
https://discord.com/developers/docs/resources/channel#delete-message
deleteMessages()
deleteMessages: (
channelId
,messageIds
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:853
Deletes multiple messages from a channel.
Parameters
channelId
The ID of the channel to delete the messages from.
messageIds
The IDs of the messages to delete from the channel.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
Requires the MANAGE_MESSAGES
permission.
⚠️ Messages older than 2 weeks old cannot be deleted.
Fires a Message Delete Bulk gateway event.
See
https://discord.com/developers/docs/resources/channel#bulk-delete-messages
deleteOriginalInteractionResponse()
deleteOriginalInteractionResponse: (
token
) =>Promise
<void
>
Defined in: rest/src/types.ts:866
Deletes the initial message response to an interaction.
Parameters
token
string
The interaction token to use, provided in the original interaction.
Returns
Promise
<void
>
Remarks
Unlike deleteMessage()
, this endpoint allows the bot user to act without needing to see the channel the message is in.
Fires a Message Delete event.
See
deleteOwnReaction()
deleteOwnReaction: (
channelId
,messageId
,reaction
) =>Promise
<void
>
Defined in: rest/src/types.ts:881
Deletes a reaction added by the bot user from a message.
Parameters
channelId
The ID of the channel the message to delete the reaction from is in.
messageId
The ID of the message to delete the reaction from.
reaction
string
The reaction to delete from the message.
Returns
Promise
<void
>
Remarks
Requires the READ_MESSAGE_HISTORY
permission.
Fires a Message Reaction Remove gateway event.
See
https://discord.com/developers/docs/resources/channel#delete-own-reaction
deleteQueueDelay
deleteQueueDelay:
number
Defined in: rest/src/types.ts:222
The time in milliseconds to wait before deleting this queue if it is empty. Defaults to 60000(one minute).
deleteReactionsAll()
deleteReactionsAll: (
channelId
,messageId
) =>Promise
<void
>
Defined in: rest/src/types.ts:897
Deletes all reactions for all emojis from a message.
Parameters
channelId
The ID of the channel the message to delete the reactions from is in.
messageId
The ID of the message to delete the reactions from.
Returns
Promise
<void
>
Remarks
Requires the READ_MESSAGE_HISTORY
permission.
Requires the MANAGE_MESSAGES
permission.
Fires a Message Reaction Remove All gateway event.
See
https://discord.com/developers/docs/resources/channel#delete-all-reactions
deleteReactionsEmoji()
deleteReactionsEmoji: (
channelId
,messageId
,reaction
) =>Promise
<void
>
Defined in: rest/src/types.ts:914
Deletes all reactions for an emoji from a message.
Parameters
channelId
The ID of the channel the message to delete the reactions from is in.
messageId
The ID of the message to delete the reactions from.
reaction
string
The reaction to remove from the message.
Returns
Promise
<void
>
Remarks
Requires the READ_MESSAGE_HISTORY
permission.
Requires the MANAGE_MESSAGES
permission.
Fires a Message Reaction Remove Emoji gateway event.
See
https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji
deleteRole()
deleteRole: (
guildId
,roleId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:929
Deletes a role from a guild.
Parameters
guildId
The ID of the guild to delete the role from.
roleId
The ID of the role to delete.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
Requires the MANAGE_ROLES
permission.
Fires a Guild Role Delete gateway event.
See
https://discord.com/developers/docs/resources/guild#delete-guild-role
deleteScheduledEvent()
deleteScheduledEvent: (
guildId
,eventId
) =>Promise
<void
>
Defined in: rest/src/types.ts:943
Deletes a scheduled event from a guild.
Parameters
guildId
The ID of the guild to delete the scheduled event from.
eventId
The ID of the scheduled event to delete.
Returns
Promise
<void
>
Remarks
Requires the MANAGE_EVENTS
permission.
Fires a Guild Scheduled Event Delete gateway event.
See
https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event
deleteStageInstance()
deleteStageInstance: (
channelId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:957
Deletes the stage instance associated with a stage channel, if one exists.
Parameters
channelId
The ID of the stage channel the stage instance is associated with.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
Requires the user to be a moderator of the stage channel.
Fires a Stage Instance Delete gateway event.
See
https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance
deleteTestEntitlement()
deleteTestEntitlement: (
applicationId
,entitlementId
) =>Promise
<void
>
Defined in: rest/src/types.ts:3022
Deletes a currently-active test entitlement. Discord will act as though that user or guild no longer has entitlement to your premium offering.
Parameters
applicationId
The id of the application from where delete the entitlement
entitlementId
The id of the entitlement to delete
Returns
Promise
<void
>
deleteUserReaction()
deleteUserReaction: (
channelId
,messageId
,userId
,reaction
) =>Promise
<void
>
Defined in: rest/src/types.ts:975
Deletes a user's reaction from a message.
Parameters
channelId
The ID of the channel the message to delete the reaction from is in.
messageId
The ID of the message to delete the reaction from.
userId
The ID of the user whose reaction to delete.
reaction
string
The reaction to delete from the message.
Returns
Promise
<void
>
Remarks
Requires the READ_MESSAGE_HISTORY
permission.
Requires the MANAGE_MESSAGES
permission.
Fires a Message Reaction Remove gateway event.
See
https://discord.com/developers/docs/resources/channel#delete-user-reaction
deleteWebhook()
deleteWebhook: (
webhookId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:988
Deletes a webhook.
Parameters
webhookId
The ID of the webhook to delete.
reason?
string
Returns
Promise
<void
>
Remarks
Requires the MANAGE_WEBHOOKS
permission.
Fires a Webhooks Update gateway event.
See
https://discord.com/developers/docs/resources/webhook#delete-webhook
deleteWebhookMessage()
deleteWebhookMessage: (
webhookId
,token
,messageId
,options
?) =>Promise
<void
>
Defined in: rest/src/types.ts:1002
Deletes a webhook message.
Parameters
webhookId
The ID of the webhook to delete the message belonging to.
token
string
The webhook token, used to manage the webhook.
messageId
The ID of the message to delete.
options?
The parameters for the deletion of the message.
Returns
Promise
<void
>
Remarks
Fires a Message Delete gateway event.
See
https://discord.com/developers/docs/resources/webhook#delete-webhook
deleteWebhookWithToken()
deleteWebhookWithToken: (
webhookId
,token
) =>Promise
<void
>
Defined in: rest/src/types.ts:1014
Deletes a webhook message using the webhook token, thereby bypassing the need for authentication + permissions.
Parameters
webhookId
The ID of the webhook to delete the message belonging to.
token
string
The webhook token, used to delete the webhook.
Returns
Promise
<void
>
Remarks
Fires a Message Delete gateway event.
See
https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token
editApplicationCommandPermissions()
editApplicationCommandPermissions: (
guildId
,commandId
,bearerToken
,options
) =>Promise
<{applicationId
:string
;guildId
:string
;id
:string
;permissions
:object
[]; }>
Defined in: rest/src/types.ts:1029
Edits the permissions for a guild application command.
Parameters
guildId
The ID of the guild the command is registered in.
commandId
The ID of the command to edit the permissions of.
bearerToken
string
The bearer token to use to make the request.
options
object
[]
The parameters for the edit of the command permissions.
Returns
Promise
<{ applicationId
: string
; guildId
: string
; id
: string
; permissions
: object
[]; }>
An instance of the edited DiscordGuildApplicationCommandPermissions.
Remarks
The bearer token requires the applications.commands.permissions.update
scope to be enabled, and to have access to the guild whose ID has been provided in the parameters.
See
editApplicationEmoji()
editApplicationEmoji: (
id
,options
) =>Promise
<{animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:1151
Edits an application emoji.
Parameters
id
The ID of the emoji to edit.
options
The parameters for the edit of the emoji.
Returns
Promise
<{ animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
An instance of the updated DiscordEmoji.
See
https://discord.com/developers/docs/resources/emoji#modify-application-emoji
editApplicationInfo()
editApplicationInfo: (
body
) =>Promise
<{approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; }; };1
: {oauth2InstallParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; }>
Defined in: rest/src/types.ts:1572
Edit properties of the app associated with the requesting bot user.
Parameters
body
Returns
Promise
<{ approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; }; 1
: { oauth2InstallParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }>
Remarks
Only properties that are passed will be updated.
editAutomodRule()
editAutomodRule: (
guildId
,ruleId
,options
,reason
?) =>Promise
<{actions
:object
[];creatorId
:string
;enabled
:boolean
;eventType
:AutoModerationEventTypes
;exemptChannels
:string
[];exemptRoles
:string
[];guildId
:string
;id
:string
;name
:string
;triggerMetadata
: {allowList
:string
[];keywordFilter
:string
[];mentionRaidProtectionEnabled
:boolean
;mentionTotalLimit
:number
;presets
:DiscordAutoModerationRuleTriggerMetadataPresets
[];regexPatterns
:string
[]; };triggerType
:AutoModerationTriggerTypes
; }>
Defined in: rest/src/types.ts:1051
Edits an automod rule.
Parameters
guildId
The ID of the guild to edit the rule in.
ruleId
The ID of the rule to edit.
options
Partial
<EditAutoModerationRuleOptions
>
The parameters for the edit of the rule.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ actions
: object
[]; creatorId
: string
; enabled
: boolean
; eventType
: AutoModerationEventTypes
; exemptChannels
: string
[]; exemptRoles
: string
[]; guildId
: string
; id
: string
; name
: string
; triggerMetadata
: { allowList
: string
[]; keywordFilter
: string
[]; mentionRaidProtectionEnabled
: boolean
; mentionTotalLimit
: number
; presets
: DiscordAutoModerationRuleTriggerMetadataPresets
[]; regexPatterns
: string
[]; }; triggerType
: AutoModerationTriggerTypes
; }>
An instance of the edited DiscordAutoModerationRule.
Remarks
Requires the MANAGE_GUILD
permission.
Fires an Auto Moderation Rule Update gateway event.
See
https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
editBotMember()
editBotMember: (
guildId
,options
,reason
?) =>Promise
<{avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:2800
Edits the nickname of the bot user.
Parameters
guildId
The ID of the guild to edit the nickname of the bot user in.
options
The parameters for the edit of the nickname.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
An instance of the edited DiscordMember
Remarks
Fires a Guild Member Update gateway event.
See
https://discord.com/developers/docs/resources/guild#modify-current-member
editBotProfile()
editBotProfile: (
options
) =>Promise
<{accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }>
Defined in: rest/src/types.ts:1061
Modifies the bot's username, avatar or banner. NOTE: username: if changed may cause the bot's discriminator to be randomized.
Parameters
options
botAvatarURL
null
| string
botBannerURL
null
| string
username
string
Returns
Promise
<{ accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }>
editChannel()
editChannel: (
channelId
,options
,reason
?) =>Promise
<{applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; }>
Defined in: rest/src/types.ts:1092
Edits a channel's settings.
Parameters
channelId
The ID of the channel to edit.
options
The parameters for the edit of the channel.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }>
An instance of the edited DiscordChannel.
Remarks
If editing a channel of type ChannelTypes.GroupDm:
- Fires a Channel Update gateway event.
If editing a thread channel:
-
Requires the
MANAGE_THREADS
permission unless if setting thearchived
property tofalse
when thelocked
property is alsofalse
, in which case only theSEND_MESSAGES
permission is required. -
Fires a Thread Update gateway event.
If editing a guild channel:
-
Requires the
MANAGE_CHANNELS
permission. -
If modifying permission overrides:
-
Requires the
MANAGE_ROLES
permission. -
Only permissions the bot user has in the guild or parent channel can be allowed/denied unless the bot user has a
MANAGE_ROLES
permission override in the channel.
-
-
If modifying a channel of type ChannelTypes.GuildCategory:
- Fires a Channel Update gateway event for each child channel impacted in this change.
-
Otherwise:
- Fires a Channel Update gateway event.
editChannelPermissionOverrides()
editChannelPermissionOverrides: (
channelId
,options
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:1109
Edits the permission overrides for a user or role in a channel.
Parameters
channelId
The ID of the channel to edit the permission overrides of.
options
EditChannelPermissionOverridesOptions
The permission override.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
Requires the MANAGE_ROLES
permission.
Only permissions the bot user has in the guild or parent channel can be allowed/denied unless the bot user has a MANAGE_ROLES
permission override in the channel.
Fires a Channel Update gateway event.
See
https://discord.com/developers/docs/resources/channel#edit-channel-permissions
editChannelPositions()
editChannelPositions: (
guildId
,channelPositions
) =>Promise
<void
>
Defined in: rest/src/types.ts:1123
Edits the positions of a set of channels in a guild.
Parameters
guildId
The ID of the guild in which to edit the positions of the channels.
channelPositions
A set of objects defining the updated positions of the channels.
Returns
Promise
<void
>
Remarks
Requires the MANAGE_CHANNELS
permission.
Fires a Channel Update gateway event for every channel impacted in this change.
See
https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
editEmoji()
editEmoji: (
guildId
,id
,options
,reason
?) =>Promise
<{animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:1141
Edits an emoji.
Parameters
guildId
The ID of the guild in which to edit the emoji.
id
The ID of the emoji to edit.
options
The parameters for the edit of the emoji.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
An instance of the updated DiscordEmoji.
Remarks
For emojis created by the current user, requires either the CREATE_GUILD_EXPRESSIONS
or MANAGE_GUILD_EXPRESSIONS
permission.
For other emojis, requires the MANAGE_GUILD_EXPRESSIONS
permission.
Fires a Guild Emojis Update
gateway event.
See
https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
editFollowupMessage()
editFollowupMessage: (
token
,messageId
,options
) =>Promise
<{activity
: {partyId
:string
;type
:MessageActivityTypes
; };application
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; };1
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };applicationId
:string
;attachments
:object
[];author
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };call
: {endedTimestamp
:string
;participants
:string
[]; };channelId
:string
;components
: ({components
: ({channelTypes
: ... | ...;customId
:string
;defaultValues
: ... | ...;disabled
: ... | ... | ...;maxValues
: ... | ...;minValues
: ... | ...;options
: ... | ...;placeholder
: ... | ...;type
: ... | ... | ... | ... | ...; } | {customId
: ... | ...;disabled
: ... | ... | ...;emoji
: ... | ...;label
: ... | ...;skuId
: ... | ...;style
:ButtonStyles
;type
:Button
;url
: ... | ...; } | {customId
:string
;label
:string
;maxLength
: ... | ...;minLength
: ... | ...;placeholder
: ... | ...;required
: ... | ... | ...;style
:TextStyles
;type
:InputText
;value
: ... | ...; })[];type
:ActionRow
; } | {channelTypes
:ChannelTypes
[];customId
:string
;defaultValues
:object
[];disabled
:boolean
;maxValues
:number
;minValues
:number
;options
:object
[];placeholder
:string
;type
:SelectMenu
|SelectMenuUsers
|SelectMenuRoles
|SelectMenuUsersAndRoles
|SelectMenuChannels
; } | {customId
:string
;disabled
:boolean
;emoji
: {animated
:boolean
;id
:string
;name
:string
; };label
:string
;skuId
:string
;style
:ButtonStyles
;type
:Button
;url
:string
; } | {customId
:string
;label
:string
;maxLength
:number
;minLength
:number
;placeholder
:string
;required
:boolean
;style
:TextStyles
;type
:InputText
;value
:string
; })[];content
:string
;editedTimestamp
:null
|string
;embeds
:object
[];flags
:MessageFlags
;guildId
:string
;id
:string
;interaction
: {id
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
: ...;skuId
: ...; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };name
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };interactionMetadata
: {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;targetMessageId
:string
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;interactedMessageId
:string
;originalResponseMessageId
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mentionChannels
:object
[];mentionEveryone
:boolean
;mentionRoles
:string
[];mentions
:object
[];messageReference
: {channelId
:string
;failIfNotExists
:boolean
;guildId
:string
;messageId
:string
;type
:DiscordMessageReferenceType
; };messageSnapshots
:object
[];nonce
:string
|number
;pinned
:boolean
;poll
: {allowMultiselect
:boolean
;answers
:object
[];expiry
:null
|string
;layoutType
:Default
;question
: {emoji
: {animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
: ... | ...;avatar
: ... | ...;avatarDecorationData
: ... | ...;banner
: ... | ...;bot
: ... | ... | ...;discriminator
:string
;flags
: ... | ...;globalName
: ... | ...;id
:string
;locale
: ... | ...;mfaEnabled
: ... | ... | ...;premiumType
: ... | ...;publicFlags
: ... | ...;system
: ... | ... | ...;username
:string
;verified
: ... | ... | ...; }; };text
:string
; };results
: {answerCounts
:object
[];isFinalized
:boolean
; }; };position
:number
;reactions
:object
[];referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...;stickerItems
:object
[];stickers
:object
[];thread
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };timestamp
:string
;tts
:boolean
;type
:MessageTypes
;webhookId
:string
; }>
Defined in: rest/src/types.ts:1169
Edits a follow-up message to an interaction.
Parameters
token
string
The interaction token to use, provided in the original interaction.
messageId
The ID of the message to edit.
options
The parameters for the edit of the message.
Returns
Promise
<{ activity
: { partyId
: string
; type
: MessageActivityTypes
; }; application
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; 1
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; applicationId
: string
; attachments
: object
[]; author
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; call
: { endedTimestamp
: string
; participants
: string
[]; }; channelId
: string
; components
: ({ components
: ({ channelTypes
: ... | ...; customId
: string
; defaultValues
: ... | ...; disabled
: ... | ... | ...; maxValues
: ... | ...; minValues
: ... | ...; options
: ... | ...; placeholder
: ... | ...; type
: ... | ... | ... | ... | ...; } | { customId
: ... | ...; disabled
: ... | ... | ...; emoji
: ... | ...; label
: ... | ...; skuId
: ... | ...; style
: ButtonStyles
; type
: Button
; url
: ... | ...; } | { customId
: string
; label
: string
; maxLength
: ... | ...; minLength
: ... | ...; placeholder
: ... | ...; required
: ... | ... | ...; style
: TextStyles
; type
: InputText
; value
: ... | ...; })[]; type
: ActionRow
; } | { channelTypes
: ChannelTypes
[]; customId
: string
; defaultValues
: object
[]; disabled
: boolean
; maxValues
: number
; minValues
: number
; options
: object
[]; placeholder
: string
; type
: SelectMenu
| SelectMenuUsers
| SelectMenuRoles
| SelectMenuUsersAndRoles
| SelectMenuChannels
; } | { customId
: string
; disabled
: boolean
; emoji
: { animated
: boolean
; id
: string
; name
: string
; }; label
: string
; skuId
: string
; style
: ButtonStyles
; type
: Button
; url
: string
; } | { customId
: string
; label
: string
; maxLength
: number
; minLength
: number
; placeholder
: string
; required
: boolean
; style
: TextStyles
; type
: InputText
; value
: string
; })[]; content
: string
; editedTimestamp
: null
| string
; embeds
: object
[]; flags
: MessageFlags
; guildId
: string
; id
: string
; interaction
: { id
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: ...; skuId
: ...; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; name
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; interactionMetadata
: { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; targetMessageId
: string
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; interactedMessageId
: string
; originalResponseMessageId
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mentionChannels
: object
[]; mentionEveryone
: boolean
; mentionRoles
: string
[]; mentions
: object
[]; messageReference
: { channelId
: string
; failIfNotExists
: boolean
; guildId
: string
; messageId
: string
; type
: DiscordMessageReferenceType
; }; messageSnapshots
: object
[]; nonce
: string
| number
; pinned
: boolean
; poll
: { allowMultiselect
: boolean
; answers
: object
[]; expiry
: null
| string
; layoutType
: Default
; question
: { emoji
: { animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: ... | ...; avatar
: ... | ...; avatarDecorationData
: ... | ...; banner
: ... | ...; bot
: ... | ... | ...; discriminator
: string
; email
: ... | ... | ...; flags
: ... | ...; globalName
: ... | ...; id
: string
; locale
: ... | ...; mfaEnabled
: ... | ... | ...; premiumType
: ... | ...; publicFlags
: ... | ...; system
: ... | ... | ...; username
: string
; verified
: ... | ... | ...; }; }; text
: string
; }; results
: { answerCounts
: object
[]; isFinalized
: boolean
; }; }; position
: number
; reactions
: object
[]; referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...; stickerItems
: object
[]; stickers
: object
[]; thread
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; timestamp
: string
; tts
: boolean
; type
: MessageTypes
; webhookId
: string
; }>
An instance of the edited DiscordMessage.
Remarks
Unlike editMessage()
, this endpoint allows the bot user to act without needing to see the channel the message is in.
Does not support ephemeral follow-up messages due to these being stateless.
Fires a Message Update event.
See
https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message
editGlobalApplicationCommand()
editGlobalApplicationCommand: (
commandId
,options
) =>Promise
<{applicationId
:string
;contexts
:null
|DiscordInteractionContextType
[];defaultMemberPermissions
:null
|string
;description
:string
;descriptionLocalizations
:null
| {bg
:string
;cs
:string
;da
:string
;de
:string
;el
:string
;en-GB
:string
;en-US
:string
;es-419
:string
;es-ES
:string
;fi
:string
;fr
:string
;hi
:string
;hr
:string
;hu
:string
;id
:string
;it
:string
;ja
:string
;ko
:string
;lt
:string
;nl
:string
;no
:string
;pl
:string
;pt-BR
:string
;ro
:string
;ru
:string
;sv-SE
:string
;th
:string
;tr
:string
;uk
:string
;vi
:string
;zh-CN
:string
;zh-TW
:string
; };dmPermission
:boolean
;guildId
:string
;handler
:DiscordInteractionEntryPointCommandHandlerType
;id
:string
;integrationTypes
:DiscordApplicationIntegrationType
[];name
:string
;nameLocalizations
:null
| {bg
:string
;cs
:string
;da
:string
;de
:string
;el
:string
;en-GB
:string
;en-US
:string
;es-419
:string
;es-ES
:string
;fi
:string
;fr
:string
;hi
:string
;hr
:string
;hu
:string
;id
:string
;it
:string
;ja
:string
;ko
:string
;lt
:string
;nl
:string
;no
:string
;pl
:string
;pt-BR
:string
;ro
:string
;ru
:string
;sv-SE
:string
;th
:string
;tr
:string
;uk
:string
;vi
:string
;zh-CN
:string
;zh-TW
:string
; };nsfw
:boolean
;options
:object
[];type
:ApplicationCommandTypes
;version
:string
; }>
Defined in: rest/src/types.ts:1179
Edits a global application command.
Parameters
commandId
The ID of the command to edit.
options
The parameters for the edit of the command.
Returns
Promise
<{ applicationId
: string
; contexts
: null
| DiscordInteractionContextType
[]; defaultMemberPermissions
: null
| string
; description
: string
; descriptionLocalizations
: null
| { bg
: string
; cs
: string
; da
: string
; de
: string
; el
: string
; en-GB
: string
; en-US
: string
; es-419
: string
; es-ES
: string
; fi
: string
; fr
: string
; hi
: string
; hr
: string
; hu
: string
; id
: string
; it
: string
; ja
: string
; ko
: string
; lt
: string
; nl
: string
; no
: string
; pl
: string
; pt-BR
: string
; ro
: string
; ru
: string
; sv-SE
: string
; th
: string
; tr
: string
; uk
: string
; vi
: string
; zh-CN
: string
; zh-TW
: string
; }; dmPermission
: boolean
; guildId
: string
; handler
: DiscordInteractionEntryPointCommandHandlerType
; id
: string
; integrationTypes
: DiscordApplicationIntegrationType
[]; name
: string
; nameLocalizations
: null
| { bg
: string
; cs
: string
; da
: string
; de
: string
; el
: string
; en-GB
: string
; en-US
: string
; es-419
: string
; es-ES
: string
; fi
: string
; fr
: string
; hi
: string
; hr
: string
; hu
: string
; id
: string
; it
: string
; ja
: string
; ko
: string
; lt
: string
; nl
: string
; no
: string
; pl
: string
; pt-BR
: string
; ro
: string
; ru
: string
; sv-SE
: string
; th
: string
; tr
: string
; uk
: string
; vi
: string
; zh-CN
: string
; zh-TW
: string
; }; nsfw
: boolean
; options
: object
[]; type
: ApplicationCommandTypes
; version
: string
; }>
An instance of the edited DiscordApplicationCommand.
See
editGuild()
editGuild: (
guildId
,options
,reason
?) =>Promise
<{afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; }>
Defined in: rest/src/types.ts:1198
Edits a guild's settings.
Parameters
guildId
The ID of the guild to edit.
options
The parameters for the edit of the guild.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }>
An instance of the edited DiscordGuild.
Remarks
Requires the MANAGE_GUILD
permission.
If attempting to add or remove the GuildFeatures.Community feature:
- Requires the
ADMINISTRATOR
permission.
Fires a Guild Update gateway event.
See
https://discord.com/developers/docs/resources/guild#modify-guild
editGuildApplicationCommand()
editGuildApplicationCommand: (
commandId
,guildId
,options
) =>Promise
<{applicationId
:string
;contexts
:null
|DiscordInteractionContextType
[];defaultMemberPermissions
:null
|string
;description
:string
;descriptionLocalizations
:null
| {bg
:string
;cs
:string
;da
:string
;de
:string
;el
:string
;en-GB
:string
;en-US
:string
;es-419
:string
;es-ES
:string
;fi
:string
;fr
:string
;hi
:string
;hr
:string
;hu
:string
;id
:string
;it
:string
;ja
:string
;ko
:string
;lt
:string
;nl
:string
;no
:string
;pl
:string
;pt-BR
:string
;ro
:string
;ru
:string
;sv-SE
:string
;th
:string
;tr
:string
;uk
:string
;vi
:string
;zh-CN
:string
;zh-TW
:string
; };dmPermission
:boolean
;guildId
:string
;handler
:DiscordInteractionEntryPointCommandHandlerType
;id
:string
;integrationTypes
:DiscordApplicationIntegrationType
[];name
:string
;nameLocalizations
:null
| {bg
:string
;cs
:string
;da
:string
;de
:string
;el
:string
;en-GB
:string
;en-US
:string
;es-419
:string
;es-ES
:string
;fi
:string
;fr
:string
;hi
:string
;hr
:string
;hu
:string
;id
:string
;it
:string
;ja
:string
;ko
:string
;lt
:string
;nl
:string
;no
:string
;pl
:string
;pt-BR
:string
;ro
:string
;ru
:string
;sv-SE
:string
;th
:string
;tr
:string
;uk
:string
;vi
:string
;zh-CN
:string
;zh-TW
:string
; };nsfw
:boolean
;options
:object
[];type
:ApplicationCommandTypes
;version
:string
; }>
Defined in: rest/src/types.ts:1209
Edits an application command registered in a guild.
Parameters
commandId
The ID of the command to edit.
guildId
The ID of the guild the command is registered in.
options
The parameters for the edit of the command.
Returns
Promise
<{ applicationId
: string
; contexts
: null
| DiscordInteractionContextType
[]; defaultMemberPermissions
: null
| string
; description
: string
; descriptionLocalizations
: null
| { bg
: string
; cs
: string
; da
: string
; de
: string
; el
: string
; en-GB
: string
; en-US
: string
; es-419
: string
; es-ES
: string
; fi
: string
; fr
: string
; hi
: string
; hr
: string
; hu
: string
; id
: string
; it
: string
; ja
: string
; ko
: string
; lt
: string
; nl
: string
; no
: string
; pl
: string
; pt-BR
: string
; ro
: string
; ru
: string
; sv-SE
: string
; th
: string
; tr
: string
; uk
: string
; vi
: string
; zh-CN
: string
; zh-TW
: string
; }; dmPermission
: boolean
; guildId
: string
; handler
: DiscordInteractionEntryPointCommandHandlerType
; id
: string
; integrationTypes
: DiscordApplicationIntegrationType
[]; name
: string
; nameLocalizations
: null
| { bg
: string
; cs
: string
; da
: string
; de
: string
; el
: string
; en-GB
: string
; en-US
: string
; es-419
: string
; es-ES
: string
; fi
: string
; fr
: string
; hi
: string
; hr
: string
; hu
: string
; id
: string
; it
: string
; ja
: string
; ko
: string
; lt
: string
; nl
: string
; no
: string
; pl
: string
; pt-BR
: string
; ro
: string
; ru
: string
; sv-SE
: string
; th
: string
; tr
: string
; uk
: string
; vi
: string
; zh-CN
: string
; zh-TW
: string
; }; nsfw
: boolean
; options
: object
[]; type
: ApplicationCommandTypes
; version
: string
; }>
An instance of the edited DiscordApplicationCommand.
See
https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command
editGuildMfaLevel()
editGuildMfaLevel: (
guildId
,mfaLevel
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:1217
Modify a guild's MFA level. Requires guild ownership.
Parameters
guildId
mfaLevel
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
editGuildOnboarding()
editGuildOnboarding: (
guildId
,options
,reason
?) =>Promise
<{defaultChannelIds
:string
[];enabled
:boolean
;guildId
:string
;mode
:DiscordGuildOnboardingMode
;prompts
:object
[]; }>
Defined in: rest/src/types.ts:2990
Modifies the onboarding configuration of the guild.
Parameters
guildId
The guild to get the onboarding from
options
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ defaultChannelIds
: string
[]; enabled
: boolean
; guildId
: string
; mode
: DiscordGuildOnboardingMode
; prompts
: object
[]; }>
Remarks
Requires the MANAGE_GUILD
and MANAGE_ROLES
permissions.
Onboarding enforces constraints when enabled. These constraints are:
- at least 7 default channels
- at least 5 of the 7 channels must allow sending messages to the @everyone role
The mode
field modifies what is considered when enforcing these constraints.
editGuildSticker()
editGuildSticker: (
guildId
,stickerId
,options
,reason
?) =>Promise
<{available
:boolean
;description
:string
;formatType
:StickerFormatTypes
;guildId
:string
;id
:string
;name
:string
;packId
:string
;sortValue
:number
;tags
:string
;type
:StickerTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:1232
Edit the given sticker.
Parameters
guildId
The ID of the guild to get
stickerId
options
AtLeastOne
<EditGuildStickerOptions
>
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ available
: boolean
; description
: string
; formatType
: StickerFormatTypes
; guildId
: string
; id
: string
; name
: string
; packId
: string
; sortValue
: number
; tags
: string
; type
: StickerTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
Remarks
For stickers created by the current user, requires either the CREATE_GUILD_EXPRESSIONS
or MANAGE_GUILD_EXPRESSIONS
permission.
For other stickers, requires the MANAGE_GUILD_EXPRESSIONS
permission.
Fires a Guild Stickers Update Gateway event.
See
https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
editGuildTemplate()
editGuildTemplate: (
guildId
,templateCode
,options
) =>Promise
<{code
:string
;createdAt
:string
;creator
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };creatorId
:string
;description
:null
|string
;isDirty
:null
|boolean
;name
:string
;serializedSourceGuild
: {afkChannelId
:null
|number
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|number
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };sourceGuildId
:string
;updatedAt
:string
;usageCount
:number
; }>
Defined in: rest/src/types.ts:1253
Edits a template's settings.
Parameters
guildId
The ID of the guild to edit a template of.
templateCode
string
The code of the template to edit.
options
The parameters for the edit of the template.
Returns
Promise
<{ code
: string
; createdAt
: string
; creator
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; creatorId
: string
; description
: null
| string
; isDirty
: null
| boolean
; name
: string
; serializedSourceGuild
: { afkChannelId
: null
| number
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| number
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; sourceGuildId
: string
; updatedAt
: string
; usageCount
: number
; }>
An instance of the edited DiscordTemplate.
Remarks
Requires the MANAGE_GUILD
permission.
Fires a Guild Update gateway event.
See
https://discord.com/developers/docs/resources/guild-template#modify-guild-template
editMember()
editMember: (
guildId
,userId
,options
,reason
?) =>Promise
<{avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:2817
Edits a member's properties.
Parameters
guildId
The ID of the guild to edit the member of.
userId
The user ID of the member to edit.
options
The parameters for the edit of the user.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
Remarks
This endpoint requires various permissions depending on what is edited about the member. To find out the required permission to enact a change, read the documentation of this endpoint's parameters.
Fires a Guild Member Update gateway event.
See
https://discord.com/developers/docs/resources/guild#modify-guild-member
editMessage()
editMessage: (
channelId
,messageId
,options
) =>Promise
<{activity
: {partyId
:string
;type
:MessageActivityTypes
; };application
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; };1
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };applicationId
:string
;attachments
:object
[];author
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };call
: {endedTimestamp
:string
;participants
:string
[]; };channelId
:string
;components
: ({components
: ({channelTypes
: ... | ...;customId
:string
;defaultValues
: ... | ...;disabled
: ... | ... | ...;maxValues
: ... | ...;minValues
: ... | ...;options
: ... | ...;placeholder
: ... | ...;type
: ... | ... | ... | ... | ...; } | {customId
: ... | ...;disabled
: ... | ... | ...;emoji
: ... | ...;label
: ... | ...;skuId
: ... | ...;style
:ButtonStyles
;type
:Button
;url
: ... | ...; } | {customId
:string
;label
:string
;maxLength
: ... | ...;minLength
: ... | ...;placeholder
: ... | ...;required
: ... | ... | ...;style
:TextStyles
;type
:InputText
;value
: ... | ...; })[];type
:ActionRow
; } | {channelTypes
:ChannelTypes
[];customId
:string
;defaultValues
:object
[];disabled
:boolean
;maxValues
:number
;minValues
:number
;options
:object
[];placeholder
:string
;type
:SelectMenu
|SelectMenuUsers
|SelectMenuRoles
|SelectMenuUsersAndRoles
|SelectMenuChannels
; } | {customId
:string
;disabled
:boolean
;emoji
: {animated
:boolean
;id
:string
;name
:string
; };label
:string
;skuId
:string
;style
:ButtonStyles
;type
:Button
;url
:string
; } | {customId
:string
;label
:string
;maxLength
:number
;minLength
:number
;placeholder
:string
;required
:boolean
;style
:TextStyles
;type
:InputText
;value
:string
; })[];content
:string
;editedTimestamp
:null
|string
;embeds
:object
[];flags
:MessageFlags
;guildId
:string
;id
:string
;interaction
: {id
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
: ...;skuId
: ...; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };name
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };interactionMetadata
: {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;targetMessageId
:string
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;interactedMessageId
:string
;originalResponseMessageId
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mentionChannels
:object
[];mentionEveryone
:boolean
;mentionRoles
:string
[];mentions
:object
[];messageReference
: {channelId
:string
;failIfNotExists
:boolean
;guildId
:string
;messageId
:string
;type
:DiscordMessageReferenceType
; };messageSnapshots
:object
[];nonce
:string
|number
;pinned
:boolean
;poll
: {allowMultiselect
:boolean
;answers
:object
[];expiry
:null
|string
;layoutType
:Default
;question
: {emoji
: {animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
: ... | ...;avatar
: ... | ...;avatarDecorationData
: ... | ...;banner
: ... | ...;bot
: ... | ... | ...;discriminator
:string
;flags
: ... | ...;globalName
: ... | ...;id
:string
;locale
: ... | ...;mfaEnabled
: ... | ... | ...;premiumType
: ... | ...;publicFlags
: ... | ...;system
: ... | ... | ...;username
:string
;verified
: ... | ... | ...; }; };text
:string
; };results
: {answerCounts
:object
[];isFinalized
:boolean
; }; };position
:number
;reactions
:object
[];referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...;stickerItems
:object
[];stickers
:object
[];thread
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };timestamp
:string
;tts
:boolean
;type
:MessageTypes
;webhookId
:string
; }>
Defined in: rest/src/types.ts:1271
Edits a message.
Parameters
channelId
The ID of the channel to edit the message in.
messageId
The IDs of the message to edit.
options
The parameters for the edit of the message.
Returns
Promise
<{ activity
: { partyId
: string
; type
: MessageActivityTypes
; }; application
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; 1
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; applicationId
: string
; attachments
: object
[]; author
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; call
: { endedTimestamp
: string
; participants
: string
[]; }; channelId
: string
; components
: ({ components
: ({ channelTypes
: ... | ...; customId
: string
; defaultValues
: ... | ...; disabled
: ... | ... | ...; maxValues
: ... | ...; minValues
: ... | ...; options
: ... | ...; placeholder
: ... | ...; type
: ... | ... | ... | ... | ...; } | { customId
: ... | ...; disabled
: ... | ... | ...; emoji
: ... | ...; label
: ... | ...; skuId
: ... | ...; style
: ButtonStyles
; type
: Button
; url
: ... | ...; } | { customId
: string
; label
: string
; maxLength
: ... | ...; minLength
: ... | ...; placeholder
: ... | ...; required
: ... | ... | ...; style
: TextStyles
; type
: InputText
; value
: ... | ...; })[]; type
: ActionRow
; } | { channelTypes
: ChannelTypes
[]; customId
: string
; defaultValues
: object
[]; disabled
: boolean
; maxValues
: number
; minValues
: number
; options
: object
[]; placeholder
: string
; type
: SelectMenu
| SelectMenuUsers
| SelectMenuRoles
| SelectMenuUsersAndRoles
| SelectMenuChannels
; } | { customId
: string
; disabled
: boolean
; emoji
: { animated
: boolean
; id
: string
; name
: string
; }; label
: string
; skuId
: string
; style
: ButtonStyles
; type
: Button
; url
: string
; } | { customId
: string
; label
: string
; maxLength
: number
; minLength
: number
; placeholder
: string
; required
: boolean
; style
: TextStyles
; type
: InputText
; value
: string
; })[]; content
: string
; editedTimestamp
: null
| string
; embeds
: object
[]; flags
: MessageFlags
; guildId
: string
; id
: string
; interaction
: { id
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: ...; skuId
: ...; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; name
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; interactionMetadata
: { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; targetMessageId
: string
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; interactedMessageId
: string
; originalResponseMessageId
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mentionChannels
: object
[]; mentionEveryone
: boolean
; mentionRoles
: string
[]; mentions
: object
[]; messageReference
: { channelId
: string
; failIfNotExists
: boolean
; guildId
: string
; messageId
: string
; type
: DiscordMessageReferenceType
; }; messageSnapshots
: object
[]; nonce
: string
| number
; pinned
: boolean
; poll
: { allowMultiselect
: boolean
; answers
: object
[]; expiry
: null
| string
; layoutType
: Default
; question
: { emoji
: { animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: ... | ...; avatar
: ... | ...; avatarDecorationData
: ... | ...; banner
: ... | ...; bot
: ... | ... | ...; discriminator
: string
; email
: ... | ... | ...; flags
: ... | ...; globalName
: ... | ...; id
: string
; locale
: ... | ...; mfaEnabled
: ... | ... | ...; premiumType
: ... | ...; publicFlags
: ... | ...; system
: ... | ... | ...; username
: string
; verified
: ... | ... | ...; }; }; text
: string
; }; results
: { answerCounts
: object
[]; isFinalized
: boolean
; }; }; position
: number
; reactions
: object
[]; referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...; stickerItems
: object
[]; stickers
: object
[]; thread
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; timestamp
: string
; tts
: boolean
; type
: MessageTypes
; webhookId
: string
; }>
An instance of the edited DiscordMessage.
Remarks
If editing another user's message:
- Requires the
MANAGE_MESSAGES
permission. - Only the flags property of the options object parameter can be edited.
Fires a Message Update gateway event.
See
https://discord.com/developers/docs/resources/channel#edit-message
editOriginalInteractionResponse()
editOriginalInteractionResponse: (
token
,options
) =>Promise
<{activity
: {partyId
:string
;type
:MessageActivityTypes
; };application
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; };1
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };applicationId
:string
;attachments
:object
[];author
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };call
: {endedTimestamp
:string
;participants
:string
[]; };channelId
:string
;components
: ({components
: ({channelTypes
: ... | ...;customId
:string
;defaultValues
: ... | ...;disabled
: ... | ... | ...;maxValues
: ... | ...;minValues
: ... | ...;options
: ... | ...;placeholder
: ... | ...;type
: ... | ... | ... | ... | ...; } | {customId
: ... | ...;disabled
: ... | ... | ...;emoji
: ... | ...;label
: ... | ...;skuId
: ... | ...;style
:ButtonStyles
;type
:Button
;url
: ... | ...; } | {customId
:string
;label
:string
;maxLength
: ... | ...;minLength
: ... | ...;placeholder
: ... | ...;required
: ... | ... | ...;style
:TextStyles
;type
:InputText
;value
: ... | ...; })[];type
:ActionRow
; } | {channelTypes
:ChannelTypes
[];customId
:string
;defaultValues
:object
[];disabled
:boolean
;maxValues
:number
;minValues
:number
;options
:object
[];placeholder
:string
;type
:SelectMenu
|SelectMenuUsers
|SelectMenuRoles
|SelectMenuUsersAndRoles
|SelectMenuChannels
; } | {customId
:string
;disabled
:boolean
;emoji
: {animated
:boolean
;id
:string
;name
:string
; };label
:string
;skuId
:string
;style
:ButtonStyles
;type
:Button
;url
:string
; } | {customId
:string
;label
:string
;maxLength
:number
;minLength
:number
;placeholder
:string
;required
:boolean
;style
:TextStyles
;type
:InputText
;value
:string
; })[];content
:string
;editedTimestamp
:null
|string
;embeds
:object
[];flags
:MessageFlags
;guildId
:string
;id
:string
;interaction
: {id
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
: ...;skuId
: ...; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };name
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };interactionMetadata
: {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;targetMessageId
:string
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;interactedMessageId
:string
;originalResponseMessageId
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mentionChannels
:object
[];mentionEveryone
:boolean
;mentionRoles
:string
[];mentions
:object
[];messageReference
: {channelId
:string
;failIfNotExists
:boolean
;guildId
:string
;messageId
:string
;type
:DiscordMessageReferenceType
; };messageSnapshots
:object
[];nonce
:string
|number
;pinned
:boolean
;poll
: {allowMultiselect
:boolean
;answers
:object
[];expiry
:null
|string
;layoutType
:Default
;question
: {emoji
: {animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
: ... | ...;avatar
: ... | ...;avatarDecorationData
: ... | ...;banner
: ... | ...;bot
: ... | ... | ...;discriminator
:string
;flags
: ... | ...;globalName
: ... | ...;id
:string
;locale
: ... | ...;mfaEnabled
: ... | ... | ...;premiumType
: ... | ...;publicFlags
: ... | ...;system
: ... | ... | ...;username
:string
;verified
: ... | ... | ...; }; };text
:string
; };results
: {answerCounts
:object
[];isFinalized
:boolean
; }; };position
:number
;reactions
:object
[];referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...;stickerItems
:object
[];stickers
:object
[];thread
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };timestamp
:string
;tts
:boolean
;type
:MessageTypes
;webhookId
:string
; }>
Defined in: rest/src/types.ts:1288
Edits the initial message response to an interaction.
Parameters
token
string
The interaction token to use, provided in the original interaction.
options
The parameters for the edit of the response.
Returns
Promise
<{ activity
: { partyId
: string
; type
: MessageActivityTypes
; }; application
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; 1
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; applicationId
: string
; attachments
: object
[]; author
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; call
: { endedTimestamp
: string
; participants
: string
[]; }; channelId
: string
; components
: ({ components
: ({ channelTypes
: ... | ...; customId
: string
; defaultValues
: ... | ...; disabled
: ... | ... | ...; maxValues
: ... | ...; minValues
: ... | ...; options
: ... | ...; placeholder
: ... | ...; type
: ... | ... | ... | ... | ...; } | { customId
: ... | ...; disabled
: ... | ... | ...; emoji
: ... | ...; label
: ... | ...; skuId
: ... | ...; style
: ButtonStyles
; type
: Button
; url
: ... | ...; } | { customId
: string
; label
: string
; maxLength
: ... | ...; minLength
: ... | ...; placeholder
: ... | ...; required
: ... | ... | ...; style
: TextStyles
; type
: InputText
; value
: ... | ...; })[]; type
: ActionRow
; } | { channelTypes
: ChannelTypes
[]; customId
: string
; defaultValues
: object
[]; disabled
: boolean
; maxValues
: number
; minValues
: number
; options
: object
[]; placeholder
: string
; type
: SelectMenu
| SelectMenuUsers
| SelectMenuRoles
| SelectMenuUsersAndRoles
| SelectMenuChannels
; } | { customId
: string
; disabled
: boolean
; emoji
: { animated
: boolean
; id
: string
; name
: string
; }; label
: string
; skuId
: string
; style
: ButtonStyles
; type
: Button
; url
: string
; } | { customId
: string
; label
: string
; maxLength
: number
; minLength
: number
; placeholder
: string
; required
: boolean
; style
: TextStyles
; type
: InputText
; value
: string
; })[]; content
: string
; editedTimestamp
: null
| string
; embeds
: object
[]; flags
: MessageFlags
; guildId
: string
; id
: string
; interaction
: { id
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: ...; skuId
: ...; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; name
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; interactionMetadata
: { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; targetMessageId
: string
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; interactedMessageId
: string
; originalResponseMessageId
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mentionChannels
: object
[]; mentionEveryone
: boolean
; mentionRoles
: string
[]; mentions
: object
[]; messageReference
: { channelId
: string
; failIfNotExists
: boolean
; guildId
: string
; messageId
: string
; type
: DiscordMessageReferenceType
; }; messageSnapshots
: object
[]; nonce
: string
| number
; pinned
: boolean
; poll
: { allowMultiselect
: boolean
; answers
: object
[]; expiry
: null
| string
; layoutType
: Default
; question
: { emoji
: { animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: ... | ...; avatar
: ... | ...; avatarDecorationData
: ... | ...; banner
: ... | ...; bot
: ... | ... | ...; discriminator
: string
; email
: ... | ... | ...; flags
: ... | ...; globalName
: ... | ...; id
: string
; locale
: ... | ...; mfaEnabled
: ... | ... | ...; premiumType
: ... | ...; publicFlags
: ... | ...; system
: ... | ... | ...; username
: string
; verified
: ... | ... | ...; }; }; text
: string
; }; results
: { answerCounts
: object
[]; isFinalized
: boolean
; }; }; position
: number
; reactions
: object
[]; referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...; stickerItems
: object
[]; stickers
: object
[]; thread
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; timestamp
: string
; tts
: boolean
; type
: MessageTypes
; webhookId
: string
; }>
An instance of the edited DiscordMessage.
Remarks
Unlike editMessage()
, this endpoint allows the bot user to act without needing to see the channel the message is in.
Does not support ephemeral follow-up messages due to these being stateless.
Fires a Message Update event.
See
editOriginalWebhookMessage()
editOriginalWebhookMessage: (
webhookId
,token
,options
) =>Promise
<{activity
: {partyId
:string
;type
:MessageActivityTypes
; };application
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; };1
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };applicationId
:string
;attachments
:object
[];author
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };call
: {endedTimestamp
:string
;participants
:string
[]; };channelId
:string
;components
: ({components
: ({channelTypes
: ... | ...;customId
:string
;defaultValues
: ... | ...;disabled
: ... | ... | ...;maxValues
: ... | ...;minValues
: ... | ...;options
: ... | ...;placeholder
: ... | ...;type
: ... | ... | ... | ... | ...; } | {customId
: ... | ...;disabled
: ... | ... | ...;emoji
: ... | ...;label
: ... | ...;skuId
: ... | ...;style
:ButtonStyles
;type
:Button
;url
: ... | ...; } | {customId
:string
;label
:string
;maxLength
: ... | ...;minLength
: ... | ...;placeholder
: ... | ...;required
: ... | ... | ...;style
:TextStyles
;type
:InputText
;value
: ... | ...; })[];type
:ActionRow
; } | {channelTypes
:ChannelTypes
[];customId
:string
;defaultValues
:object
[];disabled
:boolean
;maxValues
:number
;minValues
:number
;options
:object
[];placeholder
:string
;type
:SelectMenu
|SelectMenuUsers
|SelectMenuRoles
|SelectMenuUsersAndRoles
|SelectMenuChannels
; } | {customId
:string
;disabled
:boolean
;emoji
: {animated
:boolean
;id
:string
;name
:string
; };label
:string
;skuId
:string
;style
:ButtonStyles
;type
:Button
;url
:string
; } | {customId
:string
;label
:string
;maxLength
:number
;minLength
:number
;placeholder
:string
;required
:boolean
;style
:TextStyles
;type
:InputText
;value
:string
; })[];content
:string
;editedTimestamp
:null
|string
;embeds
:object
[];flags
:MessageFlags
;guildId
:string
;id
:string
;interaction
: {id
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
: ...;skuId
: ...; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };name
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };interactionMetadata
: {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;targetMessageId
:string
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;interactedMessageId
:string
;originalResponseMessageId
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mentionChannels
:object
[];mentionEveryone
:boolean
;mentionRoles
:string
[];mentions
:object
[];messageReference
: {channelId
:string
;failIfNotExists
:boolean
;guildId
:string
;messageId
:string
;type
:DiscordMessageReferenceType
; };messageSnapshots
:object
[];nonce
:string
|number
;pinned
:boolean
;poll
: {allowMultiselect
:boolean
;answers
:object
[];expiry
:null
|string
;layoutType
:Default
;question
: {emoji
: {animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
: ... | ...;avatar
: ... | ...;avatarDecorationData
: ... | ...;banner
: ... | ...;bot
: ... | ... | ...;discriminator
:string
;flags
: ... | ...;globalName
: ... | ...;id
:string
;locale
: ... | ...;mfaEnabled
: ... | ... | ...;premiumType
: ... | ...;publicFlags
: ... | ...;system
: ... | ... | ...;username
:string
;verified
: ... | ... | ...; }; };text
:string
; };results
: {answerCounts
:object
[];isFinalized
:boolean
; }; };position
:number
;reactions
:object
[];referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...;stickerItems
:object
[];stickers
:object
[];thread
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };timestamp
:string
;tts
:boolean
;type
:MessageTypes
;webhookId
:string
; }>
Defined in: rest/src/types.ts:1302
Edits the original webhook message.
Parameters
webhookId
The ID of the webhook to edit the original message of.
token
string
The webhook token, used to edit the message.
options
InteractionCallbackData
& object
The parameters for the edit of the message.
Returns
Promise
<{ activity
: { partyId
: string
; type
: MessageActivityTypes
; }; application
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; 1
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; applicationId
: string
; attachments
: object
[]; author
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; call
: { endedTimestamp
: string
; participants
: string
[]; }; channelId
: string
; components
: ({ components
: ({ channelTypes
: ... | ...; customId
: string
; defaultValues
: ... | ...; disabled
: ... | ... | ...; maxValues
: ... | ...; minValues
: ... | ...; options
: ... | ...; placeholder
: ... | ...; type
: ... | ... | ... | ... | ...; } | { customId
: ... | ...; disabled
: ... | ... | ...; emoji
: ... | ...; label
: ... | ...; skuId
: ... | ...; style
: ButtonStyles
; type
: Button
; url
: ... | ...; } | { customId
: string
; label
: string
; maxLength
: ... | ...; minLength
: ... | ...; placeholder
: ... | ...; required
: ... | ... | ...; style
: TextStyles
; type
: InputText
; value
: ... | ...; })[]; type
: ActionRow
; } | { channelTypes
: ChannelTypes
[]; customId
: string
; defaultValues
: object
[]; disabled
: boolean
; maxValues
: number
; minValues
: number
; options
: object
[]; placeholder
: string
; type
: SelectMenu
| SelectMenuUsers
| SelectMenuRoles
| SelectMenuUsersAndRoles
| SelectMenuChannels
; } | { customId
: string
; disabled
: boolean
; emoji
: { animated
: boolean
; id
: string
; name
: string
; }; label
: string
; skuId
: string
; style
: ButtonStyles
; type
: Button
; url
: string
; } | { customId
: string
; label
: string
; maxLength
: number
; minLength
: number
; placeholder
: string
; required
: boolean
; style
: TextStyles
; type
: InputText
; value
: string
; })[]; content
: string
; editedTimestamp
: null
| string
; embeds
: object
[]; flags
: MessageFlags
; guildId
: string
; id
: string
; interaction
: { id
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: ...; skuId
: ...; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; name
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; interactionMetadata
: { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; targetMessageId
: string
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; interactedMessageId
: string
; originalResponseMessageId
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mentionChannels
: object
[]; mentionEveryone
: boolean
; mentionRoles
: string
[]; mentions
: object
[]; messageReference
: { channelId
: string
; failIfNotExists
: boolean
; guildId
: string
; messageId
: string
; type
: DiscordMessageReferenceType
; }; messageSnapshots
: object
[]; nonce
: string
| number
; pinned
: boolean
; poll
: { allowMultiselect
: boolean
; answers
: object
[]; expiry
: null
| string
; layoutType
: Default
; question
: { emoji
: { animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: ... | ...; avatar
: ... | ...; avatarDecorationData
: ... | ...; banner
: ... | ...; bot
: ... | ... | ...; discriminator
: string
; email
: ... | ... | ...; flags
: ... | ...; globalName
: ... | ...; id
: string
; locale
: ... | ...; mfaEnabled
: ... | ... | ...; premiumType
: ... | ...; publicFlags
: ... | ...; system
: ... | ... | ...; username
: string
; verified
: ... | ... | ...; }; }; text
: string
; }; results
: { answerCounts
: object
[]; isFinalized
: boolean
; }; }; position
: number
; reactions
: object
[]; referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...; stickerItems
: object
[]; stickers
: object
[]; thread
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; timestamp
: string
; tts
: boolean
; type
: MessageTypes
; webhookId
: string
; }>
An instance of the edited DiscordMessage.
Remarks
Fires a Message Update gateway event.
See
https://discord.com/developers/docs/resources/webhook#edit-webhook-message
editOwnVoiceState()
editOwnVoiceState: (
guildId
,options
) =>Promise
<void
>
Defined in: rest/src/types.ts:1324
Edits the voice state of the bot user.
Parameters
guildId
The ID of the guild in which to edit the voice state of the bot user.
options
The parameters for the edit of the voice state.
Returns
Promise
<void
>
Remarks
The channelId property of the options object parameter must point to a stage channel, and the bot user must already have joined it.
If attempting to unmute oneself:
- Requires the
MUTE_MEMBERS
permission.
If attempting to request to speak:
- Requires the
REQUEST_TO_SPEAK
permission.
See
https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
editRole()
editRole: (
guildId
,roleId
,options
,reason
?) =>Promise
<{color
:number
;flags
:RoleFlags
;hoist
:boolean
;icon
:string
;id
:string
;managed
:boolean
;mentionable
:boolean
;name
:string
;permissions
:string
;position
:number
;tags
: {availableForPurchase
:null
;botId
:string
;guildConnections
:null
;integrationId
:string
;premiumSubscriber
:null
;subscriptionListingId
:string
; };unicodeEmoji
:string
; }>
Defined in: rest/src/types.ts:1341
Edits a role in a guild.
Parameters
guildId
The ID of the guild to edit the role in.
roleId
The ID of the role to edit.
options
The parameters for the edit of the role.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ color
: number
; flags
: RoleFlags
; hoist
: boolean
; icon
: string
; id
: string
; managed
: boolean
; mentionable
: boolean
; name
: string
; permissions
: string
; position
: number
; tags
: { availableForPurchase
: null
; botId
: string
; guildConnections
: null
; integrationId
: string
; premiumSubscriber
: null
; subscriptionListingId
: string
; }; unicodeEmoji
: string
; }>
An instance of the edited DiscordRole.
Remarks
Requires the MANAGE_ROLES
permission.
Fires a Guild Role Update gateway event.
See
https://discord.com/developers/docs/resources/guild#modify-guild-role
editRolePositions()
editRolePositions: (
guildId
,options
,reason
?) =>Promise
<object
[]>
Defined in: rest/src/types.ts:1357
Edits the positions of a set of roles.
Parameters
guildId
The ID of the guild to edit the role positions in.
options
The parameters for the edit of the role positions.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<object
[]>
A collection of DiscordRole objects assorted by role ID.
Remarks
Requires the MANAGE_ROLES
permission.
Fires a Guild Role Update gateway event for every role impacted in this change.
See
https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
editScheduledEvent()
editScheduledEvent: (
guildId
,eventId
,options
,reason
?) =>Promise
<{channelId
:null
|string
;creator
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };creatorId
:null
|string
;description
:string
;entityId
:null
|string
;entityMetadata
:null
| {location
:string
; };entityType
:ScheduledEventEntityType
;guildId
:string
;id
:string
;image
:null
|string
;name
:string
;privacyLevel
:GuildOnly
;recurrenceRule
:null
| {byMonth
:null
|DiscordScheduledEventRecurrenceRuleMonth
[];byMonthDay
:null
|number
[];byNWeekday
:null
|object
[];byWeekday
:null
|DiscordScheduledEventRecurrenceRuleWeekday
[];byYearDay
:null
|number
[];count
:null
|number
;end
:null
|string
;frequency
:DiscordScheduledEventRecurrenceRuleFrequency
;interval
:number
;start
:string
; };scheduledEndTime
:null
|string
;scheduledStartTime
:string
;status
:ScheduledEventStatus
;userCount
:number
; }>
Defined in: rest/src/types.ts:1377
Edits a scheduled event.
Parameters
guildId
The ID of the guild to edit the scheduled event in.
eventId
The ID of the scheduled event to edit.
options
Partial
<EditScheduledEvent
>
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ channelId
: null
| string
; creator
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; creatorId
: null
| string
; description
: string
; entityId
: null
| string
; entityMetadata
: null
| { location
: string
; }; entityType
: ScheduledEventEntityType
; guildId
: string
; id
: string
; image
: null
| string
; name
: string
; privacyLevel
: GuildOnly
; recurrenceRule
: null
| { byMonth
: null
| DiscordScheduledEventRecurrenceRuleMonth
[]; byMonthDay
: null
| number
[]; byNWeekday
: null
| object
[]; byWeekday
: null
| DiscordScheduledEventRecurrenceRuleWeekday
[]; byYearDay
: null
| number
[]; count
: null
| number
; end
: null
| string
; frequency
: DiscordScheduledEventRecurrenceRuleFrequency
; interval
: number
; start
: string
; }; scheduledEndTime
: null
| string
; scheduledStartTime
: string
; status
: ScheduledEventStatus
; userCount
: number
; }>
An instance of the edited DiscordScheduledEvent.
Remarks
Requires the MANAGE_EVENTS
permission.
To start or end an event, modify the event's status
property.
The entity_metadata
property is discarded for events whose entity_type
is not ScheduledEventEntityType.External.
Fires a Guild Scheduled Event Update gateway event.
See
https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
editStageInstance()
editStageInstance: (
channelId
,topic
,reason
?) =>Promise
<{channelId
:string
;guildId
:string
;guildScheduledEventId
:string
;id
:string
;topic
:string
; }>
Defined in: rest/src/types.ts:1398
Edits a stage instance.
Parameters
channelId
The ID of the stage channel the stage instance is associated with.
topic
string
Topic of the Stage instance (1-120 characters).
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ channelId
: string
; guildId
: string
; guildScheduledEventId
: string
; id
: string
; topic
: string
; }>
An instance of the updated DiscordStageInstance.
Remarks
Requires the user to be a moderator of the stage channel.
Fires a Stage Instance Update event.
See
https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance
editUserApplicationRoleConnection()
editUserApplicationRoleConnection: (
bearerToken
,applicationId
,options
) =>Promise
<{metadata
: {};platformName
:null
|string
;platformUsername
:null
|string
; }>
Defined in: rest/src/types.ts:1426
Edit the current user application role connection for the application.
Parameters
bearerToken
string
The access token of the user
applicationId
The id of the application to edit the role connection
options
The options to edit
metadata
{}
platformName
null
| string
platformUsername
null
| string
Returns
Promise
<{ metadata
: {}; platformName
: null
| string
; platformUsername
: null
| string
; }>
Remarks
This requires the role_connections.write
scope.
See
https://discord.com/developers/docs/resources/user#update-user-application-role-connection
editUserVoiceState()
editUserVoiceState: (
guildId
,options
) =>Promise
<void
>
Defined in: rest/src/types.ts:1412
Edits the voice state of another user.
Parameters
guildId
The ID of the guild in which to edit the voice state of the bot user.
options
The parameters for the edit of the voice state.
Returns
Promise
<void
>
Remarks
The channelId property of the options object parameter must point to a stage channel, and the user must already have joined it.
Requires the MUTE_MEMBERS
permission.
See
https://discord.com/developers/docs/resources/voice#modify-user-voice-state
editWebhook()
editWebhook: (
webhookId
,options
,reason
?) =>Promise
<Camelize
<DiscordWebhook
>>
Defined in: rest/src/types.ts:1445
Edits a webhook.
Parameters
webhookId
The ID of the webhook to edit.
options
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<Camelize
<DiscordWebhook
>>
An instance of the edited DiscordWebhook.
Remarks
Requires the MANAGE_WEBHOOKS
permission.
Fires a Webhooks Update gateway event.
See
https://discord.com/developers/docs/resources/webhook#edit-webhook
editWebhookMessage()
editWebhookMessage: (
webhookId
,token
,messageId
,options
) =>Promise
<{activity
: {partyId
:string
;type
:MessageActivityTypes
; };application
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; };1
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };applicationId
:string
;attachments
:object
[];author
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };call
: {endedTimestamp
:string
;participants
:string
[]; };channelId
:string
;components
: ({components
: ({channelTypes
: ... | ...;customId
:string
;defaultValues
: ... | ...;disabled
: ... | ... | ...;maxValues
: ... | ...;minValues
: ... | ...;options
: ... | ...;placeholder
: ... | ...;type
: ... | ... | ... | ... | ...; } | {customId
: ... | ...;disabled
: ... | ... | ...;emoji
: ... | ...;label
: ... | ...;skuId
: ... | ...;style
:ButtonStyles
;type
:Button
;url
: ... | ...; } | {customId
:string
;label
:string
;maxLength
: ... | ...;minLength
: ... | ...;placeholder
: ... | ...;required
: ... | ... | ...;style
:TextStyles
;type
:InputText
;value
: ... | ...; })[];type
:ActionRow
; } | {channelTypes
:ChannelTypes
[];customId
:string
;defaultValues
:object
[];disabled
:boolean
;maxValues
:number
;minValues
:number
;options
:object
[];placeholder
:string
;type
:SelectMenu
|SelectMenuUsers
|SelectMenuRoles
|SelectMenuUsersAndRoles
|SelectMenuChannels
; } | {customId
:string
;disabled
:boolean
;emoji
: {animated
:boolean
;id
:string
;name
:string
; };label
:string
;skuId
:string
;style
:ButtonStyles
;type
:Button
;url
:string
; } | {customId
:string
;label
:string
;maxLength
:number
;minLength
:number
;placeholder
:string
;required
:boolean
;style
:TextStyles
;type
:InputText
;value
:string
; })[];content
:string
;editedTimestamp
:null
|string
;embeds
:object
[];flags
:MessageFlags
;guildId
:string
;id
:string
;interaction
: {id
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
: ...;skuId
: ...; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };name
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };interactionMetadata
: {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;targetMessageId
:string
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;interactedMessageId
:string
;originalResponseMessageId
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mentionChannels
:object
[];mentionEveryone
:boolean
;mentionRoles
:string
[];mentions
:object
[];messageReference
: {channelId
:string
;failIfNotExists
:boolean
;guildId
:string
;messageId
:string
;type
:DiscordMessageReferenceType
; };messageSnapshots
:object
[];nonce
:string
|number
;pinned
:boolean
;poll
: {allowMultiselect
:boolean
;answers
:object
[];expiry
:null
|string
;layoutType
:Default
;question
: {emoji
: {animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
: ... | ...;avatar
: ... | ...;avatarDecorationData
: ... | ...;banner
: ... | ...;bot
: ... | ... | ...;discriminator
:string
;flags
: ... | ...;globalName
: ... | ...;id
:string
;locale
: ... | ...;mfaEnabled
: ... | ... | ...;premiumType
: ... | ...;publicFlags
: ... | ...;system
: ... | ... | ...;username
:string
;verified
: ... | ... | ...; }; };text
:string
; };results
: {answerCounts
:object
[];isFinalized
:boolean
; }; };position
:number
;reactions
:object
[];referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...;stickerItems
:object
[];stickers
:object
[];thread
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };timestamp
:string
;tts
:boolean
;type
:MessageTypes
;webhookId
:string
; }>
Defined in: rest/src/types.ts:1460
Edits a webhook message.
Parameters
webhookId
The ID of the webhook to edit the message of.
token
string
The webhook token, used to edit the message.
messageId
The ID of the message to edit.
options
InteractionCallbackData
& object
The parameters for the edit of the message.
Returns
Promise
<{ activity
: { partyId
: string
; type
: MessageActivityTypes
; }; application
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; 1
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; applicationId
: string
; attachments
: object
[]; author
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; call
: { endedTimestamp
: string
; participants
: string
[]; }; channelId
: string
; components
: ({ components
: ({ channelTypes
: ... | ...; customId
: string
; defaultValues
: ... | ...; disabled
: ... | ... | ...; maxValues
: ... | ...; minValues
: ... | ...; options
: ... | ...; placeholder
: ... | ...; type
: ... | ... | ... | ... | ...; } | { customId
: ... | ...; disabled
: ... | ... | ...; emoji
: ... | ...; label
: ... | ...; skuId
: ... | ...; style
: ButtonStyles
; type
: Button
; url
: ... | ...; } | { customId
: string
; label
: string
; maxLength
: ... | ...; minLength
: ... | ...; placeholder
: ... | ...; required
: ... | ... | ...; style
: TextStyles
; type
: InputText
; value
: ... | ...; })[]; type
: ActionRow
; } | { channelTypes
: ChannelTypes
[]; customId
: string
; defaultValues
: object
[]; disabled
: boolean
; maxValues
: number
; minValues
: number
; options
: object
[]; placeholder
: string
; type
: SelectMenu
| SelectMenuUsers
| SelectMenuRoles
| SelectMenuUsersAndRoles
| SelectMenuChannels
; } | { customId
: string
; disabled
: boolean
; emoji
: { animated
: boolean
; id
: string
; name
: string
; }; label
: string
; skuId
: string
; style
: ButtonStyles
; type
: Button
; url
: string
; } | { customId
: string
; label
: string
; maxLength
: number
; minLength
: number
; placeholder
: string
; required
: boolean
; style
: TextStyles
; type
: InputText
; value
: string
; })[]; content
: string
; editedTimestamp
: null
| string
; embeds
: object
[]; flags
: MessageFlags
; guildId
: string
; id
: string
; interaction
: { id
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: ...; skuId
: ...; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; name
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; interactionMetadata
: { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; targetMessageId
: string
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; interactedMessageId
: string
; originalResponseMessageId
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mentionChannels
: object
[]; mentionEveryone
: boolean
; mentionRoles
: string
[]; mentions
: object
[]; messageReference
: { channelId
: string
; failIfNotExists
: boolean
; guildId
: string
; messageId
: string
; type
: DiscordMessageReferenceType
; }; messageSnapshots
: object
[]; nonce
: string
| number
; pinned
: boolean
; poll
: { allowMultiselect
: boolean
; answers
: object
[]; expiry
: null
| string
; layoutType
: Default
; question
: { emoji
: { animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: ... | ...; avatar
: ... | ...; avatarDecorationData
: ... | ...; banner
: ... | ...; bot
: ... | ... | ...; discriminator
: string
; email
: ... | ... | ...; flags
: ... | ...; globalName
: ... | ...; id
: string
; locale
: ... | ...; mfaEnabled
: ... | ... | ...; premiumType
: ... | ...; publicFlags
: ... | ...; system
: ... | ... | ...; username
: string
; verified
: ... | ... | ...; }; }; text
: string
; }; results
: { answerCounts
: object
[]; isFinalized
: boolean
; }; }; position
: number
; reactions
: object
[]; referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...; stickerItems
: object
[]; stickers
: object
[]; thread
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; timestamp
: string
; tts
: boolean
; type
: MessageTypes
; webhookId
: string
; }>
An instance of the edited DiscordMessage.
Remarks
Fires a Message Update gateway event.
See
https://discord.com/developers/docs/resources/webhook#edit-webhook-message
editWebhookWithToken()
editWebhookWithToken: (
webhookId
,token
,options
) =>Promise
<Camelize
<DiscordWebhook
>>
Defined in: rest/src/types.ts:1480
Edits a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
Parameters
webhookId
The ID of the webhook to edit.
token
string
The webhook token, used to edit the webhook.
options
Omit
<ModifyWebhook
, "channelId"
>
Returns
Promise
<Camelize
<DiscordWebhook
>>
An instance of the edited DiscordWebhook.
Remarks
Requires the MANAGE_WEBHOOKS
permission.
Fires a Webhooks Update gateway event.
See
https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token
editWelcomeScreen()
editWelcomeScreen: (
guildId
,options
,reason
?) =>Promise
<{description
:null
|string
;welcomeChannels
:object
[]; }>
Defined in: rest/src/types.ts:1496
Edits a guild's welcome screen.
Parameters
guildId
The ID of the guild to edit the welcome screen of.
options
The parameters for the edit of the welcome screen.
description
null
| string
enabled
null
| boolean
welcomeScreen
null
| object
[]
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ description
: null
| string
; welcomeChannels
: object
[]; }>
An instance of the edited DiscordWelcomeScreen.
Remarks
Requires the MANAGE_GUILD
permission.
Fires a Guild Update gateway event.
See
https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
editWidgetSettings()
editWidgetSettings: (
guildId
,options
,reason
?) =>Promise
<{channelId
:null
|string
;enabled
:boolean
; }>
Defined in: rest/src/types.ts:1515
Edits the settings of a guild's widget.
Parameters
guildId
The ID of the guild to edit the settings of the widget of.
options
channelId
null
| string
enabled
boolean
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ channelId
: null
| string
; enabled
: boolean
; }>
An instance of the edited DiscordGuildWidgetSettings.
Remarks
Requires the MANAGE_GUILD
permission.
Fires a Guild Update gateway event.
See
https://discord.com/developers/docs/resources/guild#modify-guild-widget
endPoll()
endPoll: (
channelId
,messageId
) =>Promise
<{activity
: {partyId
:string
;type
:MessageActivityTypes
; };application
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; };1
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };applicationId
:string
;attachments
:object
[];author
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };call
: {endedTimestamp
:string
;participants
:string
[]; };channelId
:string
;components
: ({components
: ({channelTypes
: ... | ...;customId
:string
;defaultValues
: ... | ...;disabled
: ... | ... | ...;maxValues
: ... | ...;minValues
: ... | ...;options
: ... | ...;placeholder
: ... | ...;type
: ... | ... | ... | ... | ...; } | {customId
: ... | ...;disabled
: ... | ... | ...;emoji
: ... | ...;label
: ... | ...;skuId
: ... | ...;style
:ButtonStyles
;type
:Button
;url
: ... | ...; } | {customId
:string
;label
:string
;maxLength
: ... | ...;minLength
: ... | ...;placeholder
: ... | ...;required
: ... | ... | ...;style
:TextStyles
;type
:InputText
;value
: ... | ...; })[];type
:ActionRow
; } | {channelTypes
:ChannelTypes
[];customId
:string
;defaultValues
:object
[];disabled
:boolean
;maxValues
:number
;minValues
:number
;options
:object
[];placeholder
:string
;type
:SelectMenu
|SelectMenuUsers
|SelectMenuRoles
|SelectMenuUsersAndRoles
|SelectMenuChannels
; } | {customId
:string
;disabled
:boolean
;emoji
: {animated
:boolean
;id
:string
;name
:string
; };label
:string
;skuId
:string
;style
:ButtonStyles
;type
:Button
;url
:string
; } | {customId
:string
;label
:string
;maxLength
:number
;minLength
:number
;placeholder
:string
;required
:boolean
;style
:TextStyles
;type
:InputText
;value
:string
; })[];content
:string
;editedTimestamp
:null
|string
;embeds
:object
[];flags
:MessageFlags
;guildId
:string
;id
:string
;interaction
: {id
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
: ...;skuId
: ...; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };name
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };interactionMetadata
: {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;targetMessageId
:string
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;interactedMessageId
:string
;originalResponseMessageId
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mentionChannels
:object
[];mentionEveryone
:boolean
;mentionRoles
:string
[];mentions
:object
[];messageReference
: {channelId
:string
;failIfNotExists
:boolean
;guildId
:string
;messageId
:string
;type
:DiscordMessageReferenceType
; };messageSnapshots
:object
[];nonce
:string
|number
;pinned
:boolean
;poll
: {allowMultiselect
:boolean
;answers
:object
[];expiry
:null
|string
;layoutType
:Default
;question
: {emoji
: {animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
: ... | ...;avatar
: ... | ...;avatarDecorationData
: ... | ...;banner
: ... | ...;bot
: ... | ... | ...;discriminator
:string
;flags
: ... | ...;globalName
: ... | ...;id
:string
;locale
: ... | ...;mfaEnabled
: ... | ... | ...;premiumType
: ... | ...;publicFlags
: ... | ...;system
: ... | ... | ...;username
:string
;verified
: ... | ... | ...; }; };text
:string
; };results
: {answerCounts
:object
[];isFinalized
:boolean
; }; };position
:number
;reactions
:object
[];referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...;stickerItems
:object
[];stickers
:object
[];thread
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };timestamp
:string
;tts
:boolean
;type
:MessageTypes
;webhookId
:string
; }>
Defined in: rest/src/types.ts:2680
Immediately ends the poll.
Parameters
channelId
The ID of the channel in which the message with the poll lives
messageId
The ID of the message in which the poll lives
Returns
Promise
<{ activity
: { partyId
: string
; type
: MessageActivityTypes
; }; application
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; 1
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; applicationId
: string
; attachments
: object
[]; author
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; call
: { endedTimestamp
: string
; participants
: string
[]; }; channelId
: string
; components
: ({ components
: ({ channelTypes
: ... | ...; customId
: string
; defaultValues
: ... | ...; disabled
: ... | ... | ...; maxValues
: ... | ...; minValues
: ... | ...; options
: ... | ...; placeholder
: ... | ...; type
: ... | ... | ... | ... | ...; } | { customId
: ... | ...; disabled
: ... | ... | ...; emoji
: ... | ...; label
: ... | ...; skuId
: ... | ...; style
: ButtonStyles
; type
: Button
; url
: ... | ...; } | { customId
: string
; label
: string
; maxLength
: ... | ...; minLength
: ... | ...; placeholder
: ... | ...; required
: ... | ... | ...; style
: TextStyles
; type
: InputText
; value
: ... | ...; })[]; type
: ActionRow
; } | { channelTypes
: ChannelTypes
[]; customId
: string
; defaultValues
: object
[]; disabled
: boolean
; maxValues
: number
; minValues
: number
; options
: object
[]; placeholder
: string
; type
: SelectMenu
| SelectMenuUsers
| SelectMenuRoles
| SelectMenuUsersAndRoles
| SelectMenuChannels
; } | { customId
: string
; disabled
: boolean
; emoji
: { animated
: boolean
; id
: string
; name
: string
; }; label
: string
; skuId
: string
; style
: ButtonStyles
; type
: Button
; url
: string
; } | { customId
: string
; label
: string
; maxLength
: number
; minLength
: number
; placeholder
: string
; required
: boolean
; style
: TextStyles
; type
: InputText
; value
: string
; })[]; content
: string
; editedTimestamp
: null
| string
; embeds
: object
[]; flags
: MessageFlags
; guildId
: string
; id
: string
; interaction
: { id
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: ...; skuId
: ...; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; name
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; interactionMetadata
: { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; targetMessageId
: string
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; interactedMessageId
: string
; originalResponseMessageId
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mentionChannels
: object
[]; mentionEveryone
: boolean
; mentionRoles
: string
[]; mentions
: object
[]; messageReference
: { channelId
: string
; failIfNotExists
: boolean
; guildId
: string
; messageId
: string
; type
: DiscordMessageReferenceType
; }; messageSnapshots
: object
[]; nonce
: string
| number
; pinned
: boolean
; poll
: { allowMultiselect
: boolean
; answers
: object
[]; expiry
: null
| string
; layoutType
: Default
; question
: { emoji
: { animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: ... | ...; avatar
: ... | ...; avatarDecorationData
: ... | ...; banner
: ... | ...; bot
: ... | ... | ...; discriminator
: string
; email
: ... | ... | ...; flags
: ... | ...; globalName
: ... | ...; id
: string
; locale
: ... | ...; mfaEnabled
: ... | ... | ...; premiumType
: ... | ...; publicFlags
: ... | ...; system
: ... | ... | ...; username
: string
; verified
: ... | ... | ...; }; }; text
: string
; }; results
: { answerCounts
: object
[]; isFinalized
: boolean
; }; }; position
: number
; reactions
: object
[]; referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...; stickerItems
: object
[]; stickers
: object
[]; thread
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; timestamp
: string
; tts
: boolean
; type
: MessageTypes
; webhookId
: string
; }>
The message with the expired poll
Remarks
You cannot end polls from other users.
Fires a Message Update gateway event
exchangeToken()
exchangeToken: (
clientId
,clientSecret
,options
) =>Promise
<{accessToken
:string
;expiresIn
:number
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };refreshToken
:string
;scope
:string
;tokenType
:string
;webhook
: {applicationId
:null
|string
;avatar
:null
|string
;channelId
:string
;guildId
:string
;id
:string
;name
:null
|string
;sourceChannel
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };sourceGuild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };token
:string
;type
:WebhookTypes
;url
:string
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }; }>
Defined in: rest/src/types.ts:1591
Exchange the information to get a OAuth2 accessToken token
Parameters
clientId
Application's client id
clientSecret
string
application's client secret
options
Camelize
<DiscordTokenExchange
>
The options to make the exchange with discord
Returns
Promise
<{ accessToken
: string
; expiresIn
: number
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; refreshToken
: string
; scope
: string
; tokenType
: string
; webhook
: { applicationId
: null
| string
; avatar
: null
| string
; channelId
: string
; guildId
: string
; id
: string
; name
: null
| string
; sourceChannel
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; sourceGuild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; token
: string
; type
: WebhookTypes
; url
: string
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; }>
executeWebhook()
executeWebhook: (
webhookId
,token
,options
) =>Promise
<undefined
| {activity
: {partyId
:string
;type
:MessageActivityTypes
; };application
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
: ... | ...;welcomeChannels
: ...[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: ... | ...; };1
: {oauth2InstallParams
: ... | ...; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };applicationId
:string
;attachments
:object
[];author
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };call
: {endedTimestamp
:string
;participants
:string
[]; };channelId
:string
;components
: ({components
: ({channelTypes
: ...;customId
: ...;defaultValues
: ...;disabled
: ...;maxValues
: ...;minValues
: ...;options
: ...;placeholder
: ...;type
: ...; } | {customId
: ...;disabled
: ...;emoji
: ...;label
: ...;skuId
: ...;style
: ...;type
: ...;url
: ...; } | {customId
: ...;label
: ...;maxLength
: ...;minLength
: ...;placeholder
: ...;required
: ...;style
: ...;type
: ...;value
: ...; })[];type
:ActionRow
; } | {channelTypes
:ChannelTypes
[];customId
:string
;defaultValues
:object
[];disabled
:boolean
;maxValues
:number
;minValues
:number
;options
:object
[];placeholder
:string
;type
:SelectMenu
|SelectMenuUsers
|SelectMenuRoles
|SelectMenuUsersAndRoles
|SelectMenuChannels
; } | {customId
:string
;disabled
:boolean
;emoji
: {animated
: ... | ... | ...;id
: ... | ...;name
: ... | ...; };label
:string
;skuId
:string
;style
:ButtonStyles
;type
:Button
;url
:string
; } | {customId
:string
;label
:string
;maxLength
:number
;minLength
:number
;placeholder
:string
;required
:boolean
;style
:TextStyles
;type
:InputText
;value
:string
; })[];content
:string
;editedTimestamp
:null
|string
;embeds
:object
[];flags
:MessageFlags
;guildId
:string
;id
:string
;interaction
: {id
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
: ... | ...;avatar
: ... | ...;avatarDecorationData
: ... | ...;banner
: ... | ...;bot
: ... | ... | ...;discriminator
:string
;flags
: ... | ...;globalName
: ... | ...;id
:string
;locale
: ... | ...;mfaEnabled
: ... | ... | ...;premiumType
: ... | ...;publicFlags
: ... | ...;system
: ... | ... | ...;username
:string
;verified
: ... | ... | ...; }; };name
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };interactionMetadata
: {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;targetMessageId
:string
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;interactedMessageId
:string
;originalResponseMessageId
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mentionChannels
:object
[];mentionEveryone
:boolean
;mentionRoles
:string
[];mentions
:object
[];messageReference
: {channelId
:string
;failIfNotExists
:boolean
;guildId
:string
;messageId
:string
;type
:DiscordMessageReferenceType
; };messageSnapshots
:object
[];nonce
:string
|number
;pinned
:boolean
;poll
: {allowMultiselect
:boolean
;answers
:object
[];expiry
:null
|string
;layoutType
:Default
;question
: {emoji
: {animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
: ...[];user
: {accentColor
: ...;avatar
: ...;avatarDecorationData
: ...;banner
: ...;bot
: ...;discriminator
: ...;flags
: ...;globalName
: ...;id
: ...;locale
: ...;mfaEnabled
: ...;premiumType
: ...;publicFlags
: ...;system
: ...;username
: ...;verified
: ...; }; };text
:string
; };results
: {answerCounts
:object
[];isFinalized
:boolean
; }; };position
:number
;reactions
:object
[];referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...;stickerItems
:object
[];stickers
:object
[];thread
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };timestamp
:string
;tts
:boolean
;type
:MessageTypes
;webhookId
:string
; }>
Defined in: rest/src/types.ts:1533
Executes a webhook, causing a message to be posted in the channel configured for the webhook.
Parameters
webhookId
The ID of the webhook to execute.
token
string
The webhook token, used to execute the webhook.
options
The parameters for the execution of the webhook.
Returns
Promise
<undefined
| { activity
: { partyId
: string
; type
: MessageActivityTypes
; }; application
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: ... | ...; welcomeChannels
: ...[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: ... | ...; }; 1
: { oauth2InstallParams
: ... | ...; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; applicationId
: string
; attachments
: object
[]; author
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; call
: { endedTimestamp
: string
; participants
: string
[]; }; channelId
: string
; components
: ({ components
: ({ channelTypes
: ...; customId
: ...; defaultValues
: ...; disabled
: ...; maxValues
: ...; minValues
: ...; options
: ...; placeholder
: ...; type
: ...; } | { customId
: ...; disabled
: ...; emoji
: ...; label
: ...; skuId
: ...; style
: ...; type
: ...; url
: ...; } | { customId
: ...; label
: ...; maxLength
: ...; minLength
: ...; placeholder
: ...; required
: ...; style
: ...; type
: ...; value
: ...; })[]; type
: ActionRow
; } | { channelTypes
: ChannelTypes
[]; customId
: string
; defaultValues
: object
[]; disabled
: boolean
; maxValues
: number
; minValues
: number
; options
: object
[]; placeholder
: string
; type
: SelectMenu
| SelectMenuUsers
| SelectMenuRoles
| SelectMenuUsersAndRoles
| SelectMenuChannels
; } | { customId
: string
; disabled
: boolean
; emoji
: { animated
: ... | ... | ...; id
: ... | ...; name
: ... | ...; }; label
: string
; skuId
: string
; style
: ButtonStyles
; type
: Button
; url
: string
; } | { customId
: string
; label
: string
; maxLength
: number
; minLength
: number
; placeholder
: string
; required
: boolean
; style
: TextStyles
; type
: InputText
; value
: string
; })[]; content
: string
; editedTimestamp
: null
| string
; embeds
: object
[]; flags
: MessageFlags
; guildId
: string
; id
: string
; interaction
: { id
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: ... | ...; avatar
: ... | ...; avatarDecorationData
: ... | ...; banner
: ... | ...; bot
: ... | ... | ...; discriminator
: string
; email
: ... | ... | ...; flags
: ... | ...; globalName
: ... | ...; id
: string
; locale
: ... | ...; mfaEnabled
: ... | ... | ...; premiumType
: ... | ...; publicFlags
: ... | ...; system
: ... | ... | ...; username
: string
; verified
: ... | ... | ...; }; }; name
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; interactionMetadata
: { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; targetMessageId
: string
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; interactedMessageId
: string
; originalResponseMessageId
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mentionChannels
: object
[]; mentionEveryone
: boolean
; mentionRoles
: string
[]; mentions
: object
[]; messageReference
: { channelId
: string
; failIfNotExists
: boolean
; guildId
: string
; messageId
: string
; type
: DiscordMessageReferenceType
; }; messageSnapshots
: object
[]; nonce
: string
| number
; pinned
: boolean
; poll
: { allowMultiselect
: boolean
; answers
: object
[]; expiry
: null
| string
; layoutType
: Default
; question
: { emoji
: { animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: ...[]; user
: { accentColor
: ...; avatar
: ...; avatarDecorationData
: ...; banner
: ...; bot
: ...; discriminator
: ...; email
: ...; flags
: ...; globalName
: ...; id
: ...; locale
: ...; mfaEnabled
: ...; premiumType
: ...; publicFlags
: ...; system
: ...; username
: ...; verified
: ...; }; }; text
: string
; }; results
: { answerCounts
: object
[]; isFinalized
: boolean
; }; }; position
: number
; reactions
: object
[]; referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...; stickerItems
: object
[]; stickers
: object
[]; thread
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; timestamp
: string
; tts
: boolean
; type
: MessageTypes
; webhookId
: string
; }>
An instance of the created DiscordMessage, or undefined
if the wait property of the options object parameter is set to false
.
Remarks
If the webhook channel is a forum channel, you must provide a value for either threadId
or threadName
.
See
https://discord.com/developers/docs/resources/webhook#execute-webhook
followAnnouncement()
followAnnouncement: (
sourceChannelId
,targetChannelId
,reason
?) =>Promise
<{channelId
:string
;webhookId
:string
; }>
Defined in: rest/src/types.ts:1549
Follows an announcement channel, allowing messages posted within it to be cross-posted into the target channel.
Parameters
sourceChannelId
The ID of the announcement channel to follow.
targetChannelId
The ID of the target channel - the channel to cross-post to.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ channelId
: string
; webhookId
: string
; }>
An instance of DiscordFollowedChannel.
Remarks
Requires the MANAGE_WEBHOOKS
permission in the target channel.
Fires a Webhooks Update gateway event.
See
https://discord.com/developers/docs/resources/channel#follow-announcement-channel
get()
get: <
T
>(url
,options
?) =>Promise
<Camelize
<T
>>
Defined in: rest/src/types.ts:258
Make a get request to the api
Type Parameters
• T = void
Parameters
url
string
options?
Omit
<MakeRequestOptions
, "body"
>
Returns
Promise
<Camelize
<T
>>
getActiveThreads()
getActiveThreads: (
guildId
) =>Promise
<{members
:object
[];threads
:object
[]; }>
Defined in: rest/src/types.ts:1563
Gets the list of all active threads for a guild.
Parameters
guildId
The ID of the guild to get the threads of.
Returns
Promise
<{ members
: object
[]; threads
: object
[]; }>
An instance of DiscordActiveThreads.
Remarks
Returns both public and private threads.
Threads are ordered by the id
property in descending order.
See
https://discord.com/developers/docs/resources/guild#list-active-guild-threads
getApplicationActivityInstance()
getApplicationActivityInstance: (
applicationId
,instanceId
) =>Promise
<{applicationId
:string
;instanceId
:string
;launchId
:string
;location
: {channelId
:string
;guildId
:null
|string
;id
:string
;kind
:DiscordActivityLocationKind
; };users
:string
[]; }>
Defined in: rest/src/types.ts:2867
Returns a serialized activity instance, if it exists. Useful for preventing unwanted activity sessions.
Parameters
applicationId
The ID of the application
instanceId
string
The ID of the activity instance
Returns
Promise
<{ applicationId
: string
; instanceId
: string
; launchId
: string
; location
: { channelId
: string
; guildId
: null
| string
; id
: string
; kind
: DiscordActivityLocationKind
; }; users
: string
[]; }>
getApplicationCommandPermission()
getApplicationCommandPermission: (
guildId
,commandId
,options
?) =>Promise
<{applicationId
:string
;guildId
:string
;id
:string
;permissions
:object
[]; }>
Defined in: rest/src/types.ts:1613
Gets the permissions of a guild application command.
Parameters
guildId
The ID of the guild the command is registered in.
commandId
The ID of the command to get the permissions of.
options?
GetApplicationCommandPermissionOptions
The OAuth2 related optional parameters for the endpoint
Returns
Promise
<{ applicationId
: string
; guildId
: string
; id
: string
; permissions
: object
[]; }>
An instance of DiscordGuildApplicationCommandPermissions.
Remarks
Then specifying the options object the access token passed-in requires the OAuth2 scope applications.commands.permissions.update
See
getApplicationCommandPermissions()
getApplicationCommandPermissions: (
guildId
,options
?) =>Promise
<object
[]>
Defined in: rest/src/types.ts:1630
Gets the permissions of all application commands registered in a guild by the ID of the guild and optionally an external application.
Parameters
guildId
The ID of the guild to get the permissions objects of.
options?
GetApplicationCommandPermissionOptions
The OAuth2 related optional parameters for the endpoint
Returns
Promise
<object
[]>
A collection of DiscordGuildApplicationCommandPermissions objects assorted by command ID.
Remarks
Then specifying the options object the access token passed-in requires the OAuth2 scope applications.commands.permissions.update
See
getApplicationEmoji()
getApplicationEmoji: (
emojiId
) =>Promise
<{animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:1806
Gets an application emoji by its ID.
Parameters
emojiId
The ID of the emoji to get.
Returns
Promise
<{ animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
An instance of DiscordEmoji.
Remarks
Always includes the user
object for the team member that uploaded the emoji from the app's settings, or for the bot user if uploaded using the API.
See
https://discord.com/developers/docs/resources/emoji#get-application-emoji
getApplicationEmojis()
getApplicationEmojis: () =>
Promise
<{items
:object
[]; }>
Defined in: rest/src/types.ts:1829
Gets the list of emojis for an application.
Returns
Promise
<{ items
: object
[]; }>
An object with the array of DiscordEmoji objects.
Remarks
Always includes the user
object for the team member that uploaded the emoji from the app's settings, or for the bot user if uploaded using the API.
See
https://discord.com/developers/docs/resources/emoji#list-application-emojis
getApplicationInfo()
getApplicationInfo: () =>
Promise
<{approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; }; };1
: {oauth2InstallParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; }>
Defined in: rest/src/types.ts:1565
Get the applications info
Returns
Promise
<{ approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; }; 1
: { oauth2InstallParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }>
getAuditLog()
getAuditLog: (
guildId
,options
?) =>Promise
<{applicationCommands
:object
[];auditLogEntries
:object
[];autoModerationRules
:object
[];guildScheduledEvents
:object
[];integrations
:object
[];threads
:object
[];users
:object
[];webhooks
: ({applicationId
:null
|string
;avatar
:null
|string
;channelId
:string
;guildId
:string
;id
:string
;name
:null
|string
;sourceChannel
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
: ... | ...; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
: ... | ... | ... | ...;createTimestamp
: ... | ... | ...;invitable
: ... | ... | ...;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };sourceGuild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
: ... | ...;welcomeChannels
: ...[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };token
:string
;type
:WebhookTypes
;url
:string
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {applicationId
:null
|string
;avatar
:null
|string
;channelId
:null
|string
;guildId
:null
|string
;id
:string
;name
:null
|string
;sourceChannel
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
: ... | ...; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
: ... | ... | ... | ...;createTimestamp
: ... | ... | ...;invitable
: ... | ... | ...;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };sourceGuild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
: ... | ...;welcomeChannels
: ...[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };token
:string
;type
:Application
;url
:string
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; })[]; }>
Defined in: rest/src/types.ts:1646
Gets a guild's audit log.
Parameters
guildId
The ID of the guild to get the audit log of.
options?
The parameters for the fetching of the audit log.
Returns
Promise
<{ applicationCommands
: object
[]; auditLogEntries
: object
[]; autoModerationRules
: object
[]; guildScheduledEvents
: object
[]; integrations
: object
[]; threads
: object
[]; users
: object
[]; webhooks
: ({ applicationId
: null
| string
; avatar
: null
| string
; channelId
: string
; guildId
: string
; id
: string
; name
: null
| string
; sourceChannel
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: ... | ...; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: ... | ... | ... | ...; createTimestamp
: ... | ... | ...; invitable
: ... | ... | ...; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; sourceGuild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: ... | ...; welcomeChannels
: ...[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; token
: string
; type
: WebhookTypes
; url
: string
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { applicationId
: null
| string
; avatar
: null
| string
; channelId
: null
| string
; guildId
: null
| string
; id
: string
; name
: null
| string
; sourceChannel
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: ... | ...; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: ... | ... | ... | ...; createTimestamp
: ... | ... | ...; invitable
: ... | ... | ...; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; sourceGuild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: ... | ...; welcomeChannels
: ...[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; token
: string
; type
: Application
; url
: string
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; })[]; }>
An instance of DiscordAuditLog.
Remarks
Requires the VIEW_AUDIT_LOG
permission.
See
https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log
getAutomodRule()
getAutomodRule: (
guildId
,ruleId
) =>Promise
<{actions
:object
[];creatorId
:string
;enabled
:boolean
;eventType
:AutoModerationEventTypes
;exemptChannels
:string
[];exemptRoles
:string
[];guildId
:string
;id
:string
;name
:string
;triggerMetadata
: {allowList
:string
[];keywordFilter
:string
[];mentionRaidProtectionEnabled
:boolean
;mentionTotalLimit
:number
;presets
:DiscordAutoModerationRuleTriggerMetadataPresets
[];regexPatterns
:string
[]; };triggerType
:AutoModerationTriggerTypes
; }>
Defined in: rest/src/types.ts:1659
Gets an automod rule by its ID.
Parameters
guildId
The ID of the guild to get the rule of.
ruleId
The ID of the rule to get.
Returns
Promise
<{ actions
: object
[]; creatorId
: string
; enabled
: boolean
; eventType
: AutoModerationEventTypes
; exemptChannels
: string
[]; exemptRoles
: string
[]; guildId
: string
; id
: string
; name
: string
; triggerMetadata
: { allowList
: string
[]; keywordFilter
: string
[]; mentionRaidProtectionEnabled
: boolean
; mentionTotalLimit
: number
; presets
: DiscordAutoModerationRuleTriggerMetadataPresets
[]; regexPatterns
: string
[]; }; triggerType
: AutoModerationTriggerTypes
; }>
An instance of DiscordAutoModerationRule.
Remarks
Requires the MANAGE_GUILD
permission.
See
https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule
getAutomodRules()
getAutomodRules: (
guildId
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:1671
Gets the list of automod rules for a guild.
Parameters
guildId
The ID of the guild to get the rules from.
Returns
Promise
<object
[]>
A collection of DiscordAutoModerationRule objects assorted by rule ID.
Remarks
Requires the MANAGE_GUILD
permission.
See
https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild
getAvailableVoiceRegions()
getAvailableVoiceRegions: () =>
Promise
<object
[]>
Defined in: rest/src/types.ts:1677
Gets the list of available voice regions.
Returns
Promise
<object
[]>
A collection of DiscordVoiceRegion objects assorted by voice region ID.
getBan()
getBan: (
guildId
,userId
) =>Promise
<{reason
:null
|string
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:1690
Gets a ban by user ID.
Parameters
guildId
The ID of the guild to get the ban from.
userId
The ID of the user to get the ban for.
Returns
Promise
<{ reason
: null
| string
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
An instance of DiscordBan.
Remarks
Requires the BAN_MEMBERS
permission.
See
https://discord.com/developers/docs/resources/guild#get-guild-ban
getBans()
getBans: (
guildId
,options
?) =>Promise
<object
[]>
Defined in: rest/src/types.ts:1705
Gets the list of bans for a guild.
Parameters
guildId
The ID of the guild to get the list of bans for.
options?
The parameters for the fetching of the list of bans.
Returns
Promise
<object
[]>
A collection of DiscordBan objects assorted by user ID.
Remarks
Requires the BAN_MEMBERS
permission.
Users are ordered by their IDs in ascending order.
See
https://discord.com/developers/docs/resources/guild#get-guild-bans
getChannel()
getChannel: (
channelId
) =>Promise
<{applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; }>
Defined in: rest/src/types.ts:1717
Gets a channel by its ID.
Parameters
channelId
The ID of the channel to get.
Returns
Promise
<{ applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }>
An instance of DiscordChannel.
Remarks
If the channel is a thread, a DiscordThreadMember object is included in the result.
See
https://discord.com/developers/docs/resources/channel#get-channel
getChannelInvites()
getChannelInvites: (
channelId
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:1731
Gets the list of invites for a channel.
Parameters
channelId
The ID of the channel to get the invites of.
Returns
Promise
<object
[]>
A collection of DiscordInviteMetadata objects assorted by invite code.
Remarks
Requires the MANAGE_CHANNELS
permission.
Only usable for guild channels.
See
https://discord.com/developers/docs/resources/channel#get-channel-invites
getChannels()
getChannels: (
guildId
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:1743
Gets the list of channels for a guild.
Parameters
guildId
The ID of the guild to get the channels of.
Returns
Promise
<object
[]>
A collection of DiscordChannel objects assorted by channel ID.
Remarks
Excludes threads.
See
https://discord.com/developers/docs/resources/guild#get-guild-channels
getChannelWebhooks()
getChannelWebhooks: (
channelId
) =>Promise
<Camelize
<DiscordWebhook
>[]>
Defined in: rest/src/types.ts:1755
Gets a list of webhooks for a channel.
Parameters
channelId
The ID of the channel which to get the webhooks of.
Returns
Promise
<Camelize
<DiscordWebhook
>[]>
A collection of DiscordWebhook objects assorted by webhook ID.
Remarks
Requires the MANAGE_WEBHOOKS
permission.
See
https://discord.com/developers/docs/resources/webhook#get-channel-webhooks
getCurrentAuthenticationInfo()
getCurrentAuthenticationInfo: (
bearerToken
) =>Promise
<{application
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
:string
;scopes
: ...[]; }; };1
: {oauth2InstallParams
: {permissions
:string
;scopes
: ...[]; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };expires
:string
;scopes
:OAuth2Scope
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:1583
Get the current authentication info for the authenticated user
Parameters
bearerToken
string
Any OAuth2 derived access token
Returns
Promise
<{ application
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: string
; scopes
: ...[]; }; }; 1
: { oauth2InstallParams
: { permissions
: string
; scopes
: ...[]; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; expires
: string
; scopes
: OAuth2Scope
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
An instance of DiscordCurrentAuthorization
Remarks
The user object is not defined if the scopes do not include identify
.
In the user object, if defined, the email is not included if the scopes do not include email
getCurrentMember()
getCurrentMember: (
guildId
,bearerToken
) =>Promise
<{avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:2841
Gets the current member object.
Parameters
guildId
The ID of the guild to get the member object for.
bearerToken
string
The access token of the user
Returns
Promise
<{ avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
An instance of DiscordMemberWithUser.
Remarks
The access tokens needs the guilds.members.read
scope
See
https://discord.com/developers/docs/resources/user#get-current-user-guild-member
getCurrentUser()
getCurrentUser: (
bearerToken
) =>Promise
<{accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }>
Defined in: rest/src/types.ts:2312
Get the current user data.
Parameters
bearerToken
string
The access token of the user
Returns
Promise
<{ accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }>
Remarks
This requires the identify
scope.
To get the mail this also requires the email
scope
getDmChannel()
getDmChannel: (
userId
) =>Promise
<{applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; }>
Defined in: rest/src/types.ts:1764
Gets or creates a DM channel with a user.
Parameters
userId
The ID of the user to create the DM channel with.
Returns
Promise
<{ applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }>
An instance of DiscordChannel.
See
https://discord.com/developers/docs/resources/user#create-dm
getEmoji()
getEmoji: (
guildId
,emojiId
) =>Promise
<{animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:1794
Gets an emoji by its ID.
Parameters
guildId
The ID of the guild from which to get the emoji.
emojiId
The ID of the emoji to get.
Returns
Promise
<{ animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
An instance of DiscordEmoji.
Remarks
Includes the user
field if the bot has the MANAGE_GUILD_EXPRESSIONS
permission,
or if the bot created the emoji and has the the CREATE_GUILD_EXPRESSIONS
permission.
See
https://discord.com/developers/docs/resources/emoji#get-guild-emoji
getEmojis()
getEmojis: (
guildId
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:1818
Gets the list of emojis for a guild.
Parameters
guildId
The ID of the guild which to get the emojis of.
Returns
Promise
<object
[]>
A collection of DiscordEmoji objects assorted by emoji ID.
Remarks
Includes user
fields if the bot has the CREATE_GUILD_EXPRESSIONS
or MANAGE_GUILD_EXPRESSIONS
permission.
See
https://discord.com/developers/docs/resources/emoji#list-guild-emojis
getEntitlement()
getEntitlement: (
applicationId
,entitlementId
) =>Promise
<{applicationId
:string
;consumed
:boolean
;deleted
:boolean
;endsAt
:null
|string
;guildId
:string
;id
:string
;skuId
:string
;startsAt
:null
|string
;type
:DiscordEntitlementType
;userId
:string
; }>
Defined in: rest/src/types.ts:3004
Returns an entitlement.
Parameters
applicationId
The id of the application to get the entitlement
entitlementId
The id of the entitlement to get
Returns
Promise
<{ applicationId
: string
; consumed
: boolean
; deleted
: boolean
; endsAt
: null
| string
; guildId
: string
; id
: string
; skuId
: string
; startsAt
: null
| string
; type
: DiscordEntitlementType
; userId
: string
; }>
getFollowupMessage()
getFollowupMessage: (
token
,messageId
) =>Promise
<{activity
: {partyId
:string
;type
:MessageActivityTypes
; };application
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; };1
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };applicationId
:string
;attachments
:object
[];author
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };call
: {endedTimestamp
:string
;participants
:string
[]; };channelId
:string
;components
: ({components
: ({channelTypes
: ... | ...;customId
:string
;defaultValues
: ... | ...;disabled
: ... | ... | ...;maxValues
: ... | ...;minValues
: ... | ...;options
: ... | ...;placeholder
: ... | ...;type
: ... | ... | ... | ... | ...; } | {customId
: ... | ...;disabled
: ... | ... | ...;emoji
: ... | ...;label
: ... | ...;skuId
: ... | ...;style
:ButtonStyles
;type
:Button
;url
: ... | ...; } | {customId
:string
;label
:string
;maxLength
: ... | ...;minLength
: ... | ...;placeholder
: ... | ...;required
: ... | ... | ...;style
:TextStyles
;type
:InputText
;value
: ... | ...; })[];type
:ActionRow
; } | {channelTypes
:ChannelTypes
[];customId
:string
;defaultValues
:object
[];disabled
:boolean
;maxValues
:number
;minValues
:number
;options
:object
[];placeholder
:string
;type
:SelectMenu
|SelectMenuUsers
|SelectMenuRoles
|SelectMenuUsersAndRoles
|SelectMenuChannels
; } | {customId
:string
;disabled
:boolean
;emoji
: {animated
:boolean
;id
:string
;name
:string
; };label
:string
;skuId
:string
;style
:ButtonStyles
;type
:Button
;url
:string
; } | {customId
:string
;label
:string
;maxLength
:number
;minLength
:number
;placeholder
:string
;required
:boolean
;style
:TextStyles
;type
:InputText
;value
:string
; })[];content
:string
;editedTimestamp
:null
|string
;embeds
:object
[];flags
:MessageFlags
;guildId
:string
;id
:string
;interaction
: {id
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
: ...;skuId
: ...; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };name
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };interactionMetadata
: {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;targetMessageId
:string
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;interactedMessageId
:string
;originalResponseMessageId
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mentionChannels
:object
[];mentionEveryone
:boolean
;mentionRoles
:string
[];mentions
:object
[];messageReference
: {channelId
:string
;failIfNotExists
:boolean
;guildId
:string
;messageId
:string
;type
:DiscordMessageReferenceType
; };messageSnapshots
:object
[];nonce
:string
|number
;pinned
:boolean
;poll
: {allowMultiselect
:boolean
;answers
:object
[];expiry
:null
|string
;layoutType
:Default
;question
: {emoji
: {animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
: ... | ...;avatar
: ... | ...;avatarDecorationData
: ... | ...;banner
: ... | ...;bot
: ... | ... | ...;discriminator
:string
;flags
: ... | ...;globalName
: ... | ...;id
:string
;locale
: ... | ...;mfaEnabled
: ... | ... | ...;premiumType
: ... | ...;publicFlags
: ... | ...;system
: ... | ... | ...;username
:string
;verified
: ... | ... | ...; }; };text
:string
; };results
: {answerCounts
:object
[];isFinalized
:boolean
; }; };position
:number
;reactions
:object
[];referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...;stickerItems
:object
[];stickers
:object
[];thread
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };timestamp
:string
;tts
:boolean
;type
:MessageTypes
;webhookId
:string
; }>
Defined in: rest/src/types.ts:1846
Gets a follow-up message to an interaction by the ID of the message.
Parameters
token
string
The interaction token to use, provided in the original interaction.
messageId
The ID of the message to get.
Returns
Promise
<{ activity
: { partyId
: string
; type
: MessageActivityTypes
; }; application
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; 1
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; applicationId
: string
; attachments
: object
[]; author
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; call
: { endedTimestamp
: string
; participants
: string
[]; }; channelId
: string
; components
: ({ components
: ({ channelTypes
: ... | ...; customId
: string
; defaultValues
: ... | ...; disabled
: ... | ... | ...; maxValues
: ... | ...; minValues
: ... | ...; options
: ... | ...; placeholder
: ... | ...; type
: ... | ... | ... | ... | ...; } | { customId
: ... | ...; disabled
: ... | ... | ...; emoji
: ... | ...; label
: ... | ...; skuId
: ... | ...; style
: ButtonStyles
; type
: Button
; url
: ... | ...; } | { customId
: string
; label
: string
; maxLength
: ... | ...; minLength
: ... | ...; placeholder
: ... | ...; required
: ... | ... | ...; style
: TextStyles
; type
: InputText
; value
: ... | ...; })[]; type
: ActionRow
; } | { channelTypes
: ChannelTypes
[]; customId
: string
; defaultValues
: object
[]; disabled
: boolean
; maxValues
: number
; minValues
: number
; options
: object
[]; placeholder
: string
; type
: SelectMenu
| SelectMenuUsers
| SelectMenuRoles
| SelectMenuUsersAndRoles
| SelectMenuChannels
; } | { customId
: string
; disabled
: boolean
; emoji
: { animated
: boolean
; id
: string
; name
: string
; }; label
: string
; skuId
: string
; style
: ButtonStyles
; type
: Button
; url
: string
; } | { customId
: string
; label
: string
; maxLength
: number
; minLength
: number
; placeholder
: string
; required
: boolean
; style
: TextStyles
; type
: InputText
; value
: string
; })[]; content
: string
; editedTimestamp
: null
| string
; embeds
: object
[]; flags
: MessageFlags
; guildId
: string
; id
: string
; interaction
: { id
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: ...; skuId
: ...; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; name
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; interactionMetadata
: { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; targetMessageId
: string
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; interactedMessageId
: string
; originalResponseMessageId
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mentionChannels
: object
[]; mentionEveryone
: boolean
; mentionRoles
: string
[]; mentions
: object
[]; messageReference
: { channelId
: string
; failIfNotExists
: boolean
; guildId
: string
; messageId
: string
; type
: DiscordMessageReferenceType
; }; messageSnapshots
: object
[]; nonce
: string
| number
; pinned
: boolean
; poll
: { allowMultiselect
: boolean
; answers
: object
[]; expiry
: null
| string
; layoutType
: Default
; question
: { emoji
: { animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: ... | ...; avatar
: ... | ...; avatarDecorationData
: ... | ...; banner
: ... | ...; bot
: ... | ... | ...; discriminator
: string
; email
: ... | ... | ...; flags
: ... | ...; globalName
: ... | ...; id
: string
; locale
: ... | ...; mfaEnabled
: ... | ... | ...; premiumType
: ... | ...; publicFlags
: ... | ...; system
: ... | ... | ...; username
: string
; verified
: ... | ... | ...; }; }; text
: string
; }; results
: { answerCounts
: object
[]; isFinalized
: boolean
; }; }; position
: number
; reactions
: object
[]; referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...; stickerItems
: object
[]; stickers
: object
[]; thread
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; timestamp
: string
; tts
: boolean
; type
: MessageTypes
; webhookId
: string
; }>
An instance of DiscordMessage.
Remarks
Unlike getMessage()
, this endpoint allows the bot user to act without:
- Needing to be able to see the contents of the channel that the message is in. (
READ_MESSAGES
permission.) - Requiring the
MESSAGE_CONTENT
intent.
Does not support ephemeral follow-up messages due to these being stateless.
See
https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message
getGatewayBot()
getGatewayBot: () =>
Promise
<{sessionStartLimit
: {maxConcurrency
:number
;remaining
:number
;resetAfter
:number
;total
:number
; };shards
:number
;url
:string
; }>
Defined in: rest/src/types.ts:1848
Get the bots Gateway metadata that can help during the operation of large or sharded bots.
Returns
Promise
<{ sessionStartLimit
: { maxConcurrency
: number
; remaining
: number
; resetAfter
: number
; total
: number
; }; shards
: number
; url
: string
; }>
getGlobalApplicationCommand()
getGlobalApplicationCommand: (
commandId
) =>Promise
<{applicationId
:string
;contexts
:null
|DiscordInteractionContextType
[];defaultMemberPermissions
:null
|string
;description
:string
;descriptionLocalizations
:null
| {bg
:string
;cs
:string
;da
:string
;de
:string
;el
:string
;en-GB
:string
;en-US
:string
;es-419
:string
;es-ES
:string
;fi
:string
;fr
:string
;hi
:string
;hr
:string
;hu
:string
;id
:string
;it
:string
;ja
:string
;ko
:string
;lt
:string
;nl
:string
;no
:string
;pl
:string
;pt-BR
:string
;ro
:string
;ru
:string
;sv-SE
:string
;th
:string
;tr
:string
;uk
:string
;vi
:string
;zh-CN
:string
;zh-TW
:string
; };dmPermission
:boolean
;guildId
:string
;handler
:DiscordInteractionEntryPointCommandHandlerType
;id
:string
;integrationTypes
:DiscordApplicationIntegrationType
[];name
:string
;nameLocalizations
:null
| {bg
:string
;cs
:string
;da
:string
;de
:string
;el
:string
;en-GB
:string
;en-US
:string
;es-419
:string
;es-ES
:string
;fi
:string
;fr
:string
;hi
:string
;hr
:string
;hu
:string
;id
:string
;it
:string
;ja
:string
;ko
:string
;lt
:string
;nl
:string
;no
:string
;pl
:string
;pt-BR
:string
;ro
:string
;ru
:string
;sv-SE
:string
;th
:string
;tr
:string
;uk
:string
;vi
:string
;zh-CN
:string
;zh-TW
:string
; };nsfw
:boolean
;options
:object
[];type
:ApplicationCommandTypes
;version
:string
; }>
Defined in: rest/src/types.ts:1857
Gets a global application command by its ID.
Parameters
commandId
The ID of the command to get.
Returns
Promise
<{ applicationId
: string
; contexts
: null
| DiscordInteractionContextType
[]; defaultMemberPermissions
: null
| string
; description
: string
; descriptionLocalizations
: null
| { bg
: string
; cs
: string
; da
: string
; de
: string
; el
: string
; en-GB
: string
; en-US
: string
; es-419
: string
; es-ES
: string
; fi
: string
; fr
: string
; hi
: string
; hr
: string
; hu
: string
; id
: string
; it
: string
; ja
: string
; ko
: string
; lt
: string
; nl
: string
; no
: string
; pl
: string
; pt-BR
: string
; ro
: string
; ru
: string
; sv-SE
: string
; th
: string
; tr
: string
; uk
: string
; vi
: string
; zh-CN
: string
; zh-TW
: string
; }; dmPermission
: boolean
; guildId
: string
; handler
: DiscordInteractionEntryPointCommandHandlerType
; id
: string
; integrationTypes
: DiscordApplicationIntegrationType
[]; name
: string
; nameLocalizations
: null
| { bg
: string
; cs
: string
; da
: string
; de
: string
; el
: string
; en-GB
: string
; en-US
: string
; es-419
: string
; es-ES
: string
; fi
: string
; fr
: string
; hi
: string
; hr
: string
; hu
: string
; id
: string
; it
: string
; ja
: string
; ko
: string
; lt
: string
; nl
: string
; no
: string
; pl
: string
; pt-BR
: string
; ro
: string
; ru
: string
; sv-SE
: string
; th
: string
; tr
: string
; uk
: string
; vi
: string
; zh-CN
: string
; zh-TW
: string
; }; nsfw
: boolean
; options
: object
[]; type
: ApplicationCommandTypes
; version
: string
; }>
An instance of DiscordApplicationCommand.
See
https://discord.com/developers/docs/interactions/application-commands#get-global-application-command
getGlobalApplicationCommands()
getGlobalApplicationCommands: () =>
Promise
<object
[]>
Defined in: rest/src/types.ts:1865
Gets the list of your bot's global application commands.
Returns
Promise
<object
[]>
A collection of DiscordApplicationCommand objects assorted by command ID.
See
getGroupDmChannel()
getGroupDmChannel: (
options
) =>Promise
<{applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; }>
Defined in: rest/src/types.ts:1780
Create a new group DM channel with multiple users.
Parameters
options
The options for create a new group dm
Returns
Promise
<{ applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }>
An instance of DiscordChannel.
Remarks
The access tokens require to have the gdm.join
scope
This endpoint is limited to 10 active group DMs.
Fires a Channel create gateway event.
See
https://discord.com/developers/docs/resources/user#create-group-dm
getGuild()
getGuild: (
guildId
,options
?) =>Promise
<{afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; }>
Defined in: rest/src/types.ts:1875
Gets a guild by its ID.
Parameters
guildId
The ID of the guild to get.
options?
The parameters for the fetching of the guild.
counts
boolean
Returns
Promise
<{ afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }>
An instance of DiscordGuild.
See
https://discord.com/developers/docs/resources/guild#get-guild
getGuildApplicationCommand()
getGuildApplicationCommand: (
commandId
,guildId
) =>Promise
<{applicationId
:string
;contexts
:null
|DiscordInteractionContextType
[];defaultMemberPermissions
:null
|string
;description
:string
;descriptionLocalizations
:null
| {bg
:string
;cs
:string
;da
:string
;de
:string
;el
:string
;en-GB
:string
;en-US
:string
;es-419
:string
;es-ES
:string
;fi
:string
;fr
:string
;hi
:string
;hr
:string
;hu
:string
;id
:string
;it
:string
;ja
:string
;ko
:string
;lt
:string
;nl
:string
;no
:string
;pl
:string
;pt-BR
:string
;ro
:string
;ru
:string
;sv-SE
:string
;th
:string
;tr
:string
;uk
:string
;vi
:string
;zh-CN
:string
;zh-TW
:string
; };dmPermission
:boolean
;guildId
:string
;handler
:DiscordInteractionEntryPointCommandHandlerType
;id
:string
;integrationTypes
:DiscordApplicationIntegrationType
[];name
:string
;nameLocalizations
:null
| {bg
:string
;cs
:string
;da
:string
;de
:string
;el
:string
;en-GB
:string
;en-US
:string
;es-419
:string
;es-ES
:string
;fi
:string
;fr
:string
;hi
:string
;hr
:string
;hu
:string
;id
:string
;it
:string
;ja
:string
;ko
:string
;lt
:string
;nl
:string
;no
:string
;pl
:string
;pt-BR
:string
;ro
:string
;ru
:string
;sv-SE
:string
;th
:string
;tr
:string
;uk
:string
;vi
:string
;zh-CN
:string
;zh-TW
:string
; };nsfw
:boolean
;options
:object
[];type
:ApplicationCommandTypes
;version
:string
; }>
Defined in: rest/src/types.ts:1898
Gets a guild application command by its ID.
Parameters
commandId
The ID of the command to get.
guildId
The ID of the guild the command is registered in.
Returns
Promise
<{ applicationId
: string
; contexts
: null
| DiscordInteractionContextType
[]; defaultMemberPermissions
: null
| string
; description
: string
; descriptionLocalizations
: null
| { bg
: string
; cs
: string
; da
: string
; de
: string
; el
: string
; en-GB
: string
; en-US
: string
; es-419
: string
; es-ES
: string
; fi
: string
; fr
: string
; hi
: string
; hr
: string
; hu
: string
; id
: string
; it
: string
; ja
: string
; ko
: string
; lt
: string
; nl
: string
; no
: string
; pl
: string
; pt-BR
: string
; ro
: string
; ru
: string
; sv-SE
: string
; th
: string
; tr
: string
; uk
: string
; vi
: string
; zh-CN
: string
; zh-TW
: string
; }; dmPermission
: boolean
; guildId
: string
; handler
: DiscordInteractionEntryPointCommandHandlerType
; id
: string
; integrationTypes
: DiscordApplicationIntegrationType
[]; name
: string
; nameLocalizations
: null
| { bg
: string
; cs
: string
; da
: string
; de
: string
; el
: string
; en-GB
: string
; en-US
: string
; es-419
: string
; es-ES
: string
; fi
: string
; fr
: string
; hi
: string
; hr
: string
; hu
: string
; id
: string
; it
: string
; ja
: string
; ko
: string
; lt
: string
; nl
: string
; no
: string
; pl
: string
; pt-BR
: string
; ro
: string
; ru
: string
; sv-SE
: string
; th
: string
; tr
: string
; uk
: string
; vi
: string
; zh-CN
: string
; zh-TW
: string
; }; nsfw
: boolean
; options
: object
[]; type
: ApplicationCommandTypes
; version
: string
; }>
An instance of DiscordApplicationCommand.
See
https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command
getGuildApplicationCommands()
getGuildApplicationCommands: (
guildId
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:1907
Gets the list of application commands registered by your bot in a guild.
Parameters
guildId
The ID of the guild the commands are registered in.
Returns
Promise
<object
[]>
A collection of DiscordApplicationCommand objects assorted by command ID.
See
getGuildOnboarding()
getGuildOnboarding: (
guildId
) =>Promise
<{defaultChannelIds
:string
[];enabled
:boolean
;guildId
:string
;mode
:DiscordGuildOnboardingMode
;prompts
:object
[]; }>
Defined in: rest/src/types.ts:2974
Get the guild onboarding
Parameters
guildId
The guild to get the onboarding from
Returns
Promise
<{ defaultChannelIds
: string
[]; enabled
: boolean
; guildId
: string
; mode
: DiscordGuildOnboardingMode
; prompts
: object
[]; }>
getGuildPreview()
getGuildPreview: (
guildId
) =>Promise
<{approximateMemberCount
:number
;approximatePresenceCount
:number
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];features
:GuildFeatures
[];icon
:null
|string
;id
:string
;name
:string
;splash
:null
|string
;stickers
:object
[]; }>
Defined in: rest/src/types.ts:1919
Gets the preview of a guild by a guild's ID.
Parameters
guildId
The ID of the guild to get the preview of.
Returns
Promise
<{ approximateMemberCount
: number
; approximatePresenceCount
: number
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; features
: GuildFeatures
[]; icon
: null
| string
; id
: string
; name
: string
; splash
: null
| string
; stickers
: object
[]; }>
An instance of DiscordGuildPreview.
Remarks
If the bot user is not in the guild, the guild must be discoverable.
See
https://discord.com/developers/docs/resources/guild#get-guild-preview
getGuilds()
getGuilds: (
bearerToken
?,options
?) =>Promise
<Partial
<{afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; }>[]>
Defined in: rest/src/types.ts:1888
Get the user guilds.
Parameters
bearerToken?
string
The access token of the user, if unspecified the bot token is used instead
options?
The parameters for the fetching of the guild.
Returns
Promise
<Partial
<{ afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }>[]>
An array of partial DiscordGuild.
Remarks
If used with an access token, the token needs to have the guilds
scope
See
https://discord.com/developers/docs/resources/user#get-current-user-guilds
getGuildSoundboardSound()
getGuildSoundboardSound: (
guildId
,soundId
) =>Promise
<{available
:boolean
;emojiId
:null
|string
;emojiName
:null
|string
;guildId
:string
;name
:string
;soundId
:string
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };volume
:number
; }>
Defined in: rest/src/types.ts:3080
Returns a soundboard sound object for the given sound id.
Parameters
guildId
The guild to get the sounds from
soundId
The sound id
Returns
Promise
<{ available
: boolean
; emojiId
: null
| string
; emojiName
: null
| string
; guildId
: string
; name
: string
; soundId
: string
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; volume
: number
; }>
Remarks
Includes user
fields if the bot has the CREATE_GUILD_EXPRESSIONS
or MANAGE_GUILD_EXPRESSIONS
permission.
getGuildSticker()
getGuildSticker: (
guildId
,stickerId
) =>Promise
<{available
:boolean
;description
:string
;formatType
:StickerFormatTypes
;guildId
:string
;id
:string
;name
:string
;packId
:string
;sortValue
:number
;tags
:string
;type
:StickerTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:1931
Returns a sticker object for the given guild and sticker IDs.
Parameters
guildId
The ID of the guild to get
stickerId
The ID of the sticker to get
Returns
Promise
<{ available
: boolean
; description
: string
; formatType
: StickerFormatTypes
; guildId
: string
; id
: string
; name
: string
; packId
: string
; sortValue
: number
; tags
: string
; type
: StickerTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
Remarks
Includes the user field if the bot has the CREATE_GUILD_EXPRESSIONS
or MANAGE_GUILD_EXPRESSIONS
permission.
See
https://discord.com/developers/docs/resources/sticker#get-guild-sticker
getGuildStickers()
getGuildStickers: (
guildId
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:1942
Returns an array of sticker objects for the given guild.
Parameters
guildId
The ID of the guild to get
Returns
Promise
<object
[]>
A collection of DiscordSticker objects assorted by sticker ID.
Remarks
Includes user fields if the bot has the CREATE_GUILD_EXPRESSIONS
or MANAGE_GUILD_EXPRESSIONS
permission.
See
https://discord.com/developers/docs/resources/sticker#list-guild-stickers
getGuildTemplate()
getGuildTemplate: (
templateCode
) =>Promise
<{code
:string
;createdAt
:string
;creator
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };creatorId
:string
;description
:null
|string
;isDirty
:null
|boolean
;name
:string
;serializedSourceGuild
: {afkChannelId
:null
|number
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|number
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };sourceGuildId
:string
;updatedAt
:string
;usageCount
:number
; }>
Defined in: rest/src/types.ts:1954
Gets a template by its code.
Parameters
templateCode
string
The code of the template to get.
Returns
Promise
<{ code
: string
; createdAt
: string
; creator
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; creatorId
: string
; description
: null
| string
; isDirty
: null
| boolean
; name
: string
; serializedSourceGuild
: { afkChannelId
: null
| number
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| number
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; sourceGuildId
: string
; updatedAt
: string
; usageCount
: number
; }>
An instance of DiscordTemplate.
Remarks
Requires the MANAGE_GUILD
permission.
See
https://discord.com/developers/docs/resources/guild-template#get-guild-template
getGuildTemplates()
getGuildTemplates: (
guildId
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:1966
Gets the list of templates for a guild.
Parameters
guildId
The ID of the guild to get the list of templates for.
Returns
Promise
<object
[]>
A collection of DiscordTemplate objects assorted by template code.
Remarks
Requires the MANAGE_GUILD
permission.
See
https://discord.com/developers/docs/resources/guild-template#get-guild-templates
getGuildWebhooks()
getGuildWebhooks: (
guildId
) =>Promise
<Camelize
<DiscordWebhook
>[]>
Defined in: rest/src/types.ts:1978
Gets the list of webhooks for a guild.
Parameters
guildId
The ID of the guild to get the list of webhooks for.
Returns
Promise
<Camelize
<DiscordWebhook
>[]>
A collection of DiscordWebhook objects assorted by webhook ID.
Remarks
Requires the MANAGE_WEBHOOKS
permission.
See
https://discord.com/developers/docs/resources/webhook#get-guild-webhooks
getIntegrations()
getIntegrations: (
guildId
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:1990
Gets the list of integrations attached to a guild.
Parameters
guildId
The ID of the guild to get the list of integrations from.
Returns
Promise
<object
[]>
A collection of DiscordIntegration objects assorted by integration ID.
Remarks
Requires the MANAGE_GUILD
permission.
See
https://discord.com/developers/docs/resources/guild#get-guild-integrations
getInvite()
getInvite: (
inviteCode
,options
?) =>Promise
<{approximateMemberCount
:number
;approximatePresenceCount
:number
;channel
:null
| {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };code
:string
;createdAt
:string
;expiresAt
:null
|string
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildScheduledEvent
: {channelId
:null
|string
;creator
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };creatorId
:null
|string
;description
:string
;entityId
:null
|string
;entityMetadata
:null
| {location
:string
; };entityType
:ScheduledEventEntityType
;guildId
:string
;id
:string
;image
:null
|string
;name
:string
;privacyLevel
:GuildOnly
;recurrenceRule
:null
| {byMonth
:null
|DiscordScheduledEventRecurrenceRuleMonth
[];byMonthDay
:null
|number
[];byNWeekday
:null
|object
[];byWeekday
:null
|DiscordScheduledEventRecurrenceRuleWeekday
[];byYearDay
:null
|number
[];count
:null
|number
;end
:null
|string
;frequency
:DiscordScheduledEventRecurrenceRuleFrequency
;interval
:number
;start
:string
; };scheduledEndTime
:null
|string
;scheduledStartTime
:string
;status
:ScheduledEventStatus
;userCount
:number
; };inviter
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };maxAge
:number
;maxUses
:number
;stageInstance
: {members
:object
[];participantCount
:number
;speakerCount
:number
;topic
:string
; };targetApplication
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; };1
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };targetType
:TargetTypes
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };temporary
:boolean
;type
:DiscordInviteType
;uses
:number
; }>
Defined in: rest/src/types.ts:2000
Gets an invite to a channel by its invite code.
Parameters
inviteCode
string
The invite code of the invite to get.
options?
The parameters for the fetching of the invite.
Returns
Promise
<{ approximateMemberCount
: number
; approximatePresenceCount
: number
; channel
: null
| { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; code
: string
; createdAt
: string
; expiresAt
: null
| string
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildScheduledEvent
: { channelId
: null
| string
; creator
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; creatorId
: null
| string
; description
: string
; entityId
: null
| string
; entityMetadata
: null
| { location
: string
; }; entityType
: ScheduledEventEntityType
; guildId
: string
; id
: string
; image
: null
| string
; name
: string
; privacyLevel
: GuildOnly
; recurrenceRule
: null
| { byMonth
: null
| DiscordScheduledEventRecurrenceRuleMonth
[]; byMonthDay
: null
| number
[]; byNWeekday
: null
| object
[]; byWeekday
: null
| DiscordScheduledEventRecurrenceRuleWeekday
[]; byYearDay
: null
| number
[]; count
: null
| number
; end
: null
| string
; frequency
: DiscordScheduledEventRecurrenceRuleFrequency
; interval
: number
; start
: string
; }; scheduledEndTime
: null
| string
; scheduledStartTime
: string
; status
: ScheduledEventStatus
; userCount
: number
; }; inviter
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; maxAge
: number
; maxUses
: number
; stageInstance
: { members
: object
[]; participantCount
: number
; speakerCount
: number
; topic
: string
; }; targetApplication
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; 1
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; targetType
: TargetTypes
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; temporary
: boolean
; type
: DiscordInviteType
; uses
: number
; }>
An instance of DiscordInviteMetadata.
See
https://discord.com/developers/docs/resources/invite#get-invite
getInvites()
getInvites: (
guildId
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:2012
Gets the list of invites for a guild.
Parameters
guildId
The ID of the guild to get the invites from.
Returns
Promise
<object
[]>
A collection of DiscordInviteMetadata objects assorted by invite code.
Remarks
Requires the MANAGE_GUILD
permission.
See
https://discord.com/developers/docs/resources/invite#get-invites
getMember()
getMember: (
guildId
,userId
) =>Promise
<{avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:2828
Gets the member object by user ID.
Parameters
guildId
The ID of the guild to get the member object for.
userId
The ID of the user to get the member object for.
Returns
Promise
<{ avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
An instance of DiscordMemberWithUser.
See
https://discord.com/developers/docs/resources/guild#get-guild-member
getMembers()
getMembers: (
guildId
,options
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:2860
Gets the list of members for a guild.
Parameters
guildId
The ID of the guild to get the list of members for.
options
The parameters for the fetching of the members.
Returns
Promise
<object
[]>
A collection of DiscordMemberWithUser objects assorted by user ID.
Remarks
Requires the GUILD_MEMBERS
intent.
⚠️ It is not recommended to use this endpoint with very large bots. Instead, opt to use fetchMembers()
:
REST communication only permits 50 requests to be made per second, while gateways allow for up to 120 requests
per minute per shard. For more information, read https://discord.com/developers/docs/topics/rate-limits#rate-limits.
See
- https://discord.com/developers/docs/resources/guild#list-guild-members
- https://discord.com/developers/docs/topics/gateway#request-guild-members
- https://discord.com/developers/docs/topics/rate-limits#rate-limits
getMessage()
getMessage: (
channelId
,messageId
) =>Promise
<{activity
: {partyId
:string
;type
:MessageActivityTypes
; };application
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; };1
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };applicationId
:string
;attachments
:object
[];author
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };call
: {endedTimestamp
:string
;participants
:string
[]; };channelId
:string
;components
: ({components
: ({channelTypes
: ... | ...;customId
:string
;defaultValues
: ... | ...;disabled
: ... | ... | ...;maxValues
: ... | ...;minValues
: ... | ...;options
: ... | ...;placeholder
: ... | ...;type
: ... | ... | ... | ... | ...; } | {customId
: ... | ...;disabled
: ... | ... | ...;emoji
: ... | ...;label
: ... | ...;skuId
: ... | ...;style
:ButtonStyles
;type
:Button
;url
: ... | ...; } | {customId
:string
;label
:string
;maxLength
: ... | ...;minLength
: ... | ...;placeholder
: ... | ...;required
: ... | ... | ...;style
:TextStyles
;type
:InputText
;value
: ... | ...; })[];type
:ActionRow
; } | {channelTypes
:ChannelTypes
[];customId
:string
;defaultValues
:object
[];disabled
:boolean
;maxValues
:number
;minValues
:number
;options
:object
[];placeholder
:string
;type
:SelectMenu
|SelectMenuUsers
|SelectMenuRoles
|SelectMenuUsersAndRoles
|SelectMenuChannels
; } | {customId
:string
;disabled
:boolean
;emoji
: {animated
:boolean
;id
:string
;name
:string
; };label
:string
;skuId
:string
;style
:ButtonStyles
;type
:Button
;url
:string
; } | {customId
:string
;label
:string
;maxLength
:number
;minLength
:number
;placeholder
:string
;required
:boolean
;style
:TextStyles
;type
:InputText
;value
:string
; })[];content
:string
;editedTimestamp
:null
|string
;embeds
:object
[];flags
:MessageFlags
;guildId
:string
;id
:string
;interaction
: {id
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
: ...;skuId
: ...; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };name
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };interactionMetadata
: {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;targetMessageId
:string
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;interactedMessageId
:string
;originalResponseMessageId
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mentionChannels
:object
[];mentionEveryone
:boolean
;mentionRoles
:string
[];mentions
:object
[];messageReference
: {channelId
:string
;failIfNotExists
:boolean
;guildId
:string
;messageId
:string
;type
:DiscordMessageReferenceType
; };messageSnapshots
:object
[];nonce
:string
|number
;pinned
:boolean
;poll
: {allowMultiselect
:boolean
;answers
:object
[];expiry
:null
|string
;layoutType
:Default
;question
: {emoji
: {animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
: ... | ...;avatar
: ... | ...;avatarDecorationData
: ... | ...;banner
: ... | ...;bot
: ... | ... | ...;discriminator
:string
;flags
: ... | ...;globalName
: ... | ...;id
:string
;locale
: ... | ...;mfaEnabled
: ... | ... | ...;premiumType
: ... | ...;publicFlags
: ... | ...;system
: ... | ... | ...;username
:string
;verified
: ... | ... | ...; }; };text
:string
; };results
: {answerCounts
:object
[];isFinalized
:boolean
; }; };position
:number
;reactions
:object
[];referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...;stickerItems
:object
[];stickers
:object
[];thread
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };timestamp
:string
;tts
:boolean
;type
:MessageTypes
;webhookId
:string
; }>
Defined in: rest/src/types.ts:2028
Gets a message from a channel by the ID of the message.
Parameters
channelId
The ID of the channel from which to get the message.
messageId
The ID of the message to get.
Returns
Promise
<{ activity
: { partyId
: string
; type
: MessageActivityTypes
; }; application
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; 1
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; applicationId
: string
; attachments
: object
[]; author
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; call
: { endedTimestamp
: string
; participants
: string
[]; }; channelId
: string
; components
: ({ components
: ({ channelTypes
: ... | ...; customId
: string
; defaultValues
: ... | ...; disabled
: ... | ... | ...; maxValues
: ... | ...; minValues
: ... | ...; options
: ... | ...; placeholder
: ... | ...; type
: ... | ... | ... | ... | ...; } | { customId
: ... | ...; disabled
: ... | ... | ...; emoji
: ... | ...; label
: ... | ...; skuId
: ... | ...; style
: ButtonStyles
; type
: Button
; url
: ... | ...; } | { customId
: string
; label
: string
; maxLength
: ... | ...; minLength
: ... | ...; placeholder
: ... | ...; required
: ... | ... | ...; style
: TextStyles
; type
: InputText
; value
: ... | ...; })[]; type
: ActionRow
; } | { channelTypes
: ChannelTypes
[]; customId
: string
; defaultValues
: object
[]; disabled
: boolean
; maxValues
: number
; minValues
: number
; options
: object
[]; placeholder
: string
; type
: SelectMenu
| SelectMenuUsers
| SelectMenuRoles
| SelectMenuUsersAndRoles
| SelectMenuChannels
; } | { customId
: string
; disabled
: boolean
; emoji
: { animated
: boolean
; id
: string
; name
: string
; }; label
: string
; skuId
: string
; style
: ButtonStyles
; type
: Button
; url
: string
; } | { customId
: string
; label
: string
; maxLength
: number
; minLength
: number
; placeholder
: string
; required
: boolean
; style
: TextStyles
; type
: InputText
; value
: string
; })[]; content
: string
; editedTimestamp
: null
| string
; embeds
: object
[]; flags
: MessageFlags
; guildId
: string
; id
: string
; interaction
: { id
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: ...; skuId
: ...; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; name
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; interactionMetadata
: { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; targetMessageId
: string
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; interactedMessageId
: string
; originalResponseMessageId
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mentionChannels
: object
[]; mentionEveryone
: boolean
; mentionRoles
: string
[]; mentions
: object
[]; messageReference
: { channelId
: string
; failIfNotExists
: boolean
; guildId
: string
; messageId
: string
; type
: DiscordMessageReferenceType
; }; messageSnapshots
: object
[]; nonce
: string
| number
; pinned
: boolean
; poll
: { allowMultiselect
: boolean
; answers
: object
[]; expiry
: null
| string
; layoutType
: Default
; question
: { emoji
: { animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: ... | ...; avatar
: ... | ...; avatarDecorationData
: ... | ...; banner
: ... | ...; bot
: ... | ... | ...; discriminator
: string
; email
: ... | ... | ...; flags
: ... | ...; globalName
: ... | ...; id
: string
; locale
: ... | ...; mfaEnabled
: ... | ... | ...; premiumType
: ... | ...; publicFlags
: ... | ...; system
: ... | ... | ...; username
: string
; verified
: ... | ... | ...; }; }; text
: string
; }; results
: { answerCounts
: object
[]; isFinalized
: boolean
; }; }; position
: number
; reactions
: object
[]; referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...; stickerItems
: object
[]; stickers
: object
[]; thread
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; timestamp
: string
; tts
: boolean
; type
: MessageTypes
; webhookId
: string
; }>
An instance of DiscordMessage.
Remarks
Requires that the bot user be able to see the contents of the channel in which the message was posted.
If getting a message from a guild channel:
- Requires the
READ_MESSAGE_HISTORY
permission.
See
https://discord.com/developers/docs/resources/channel#get-channel-message
getMessages()
getMessages: (
channelId
,options
?) =>Promise
<object
[]>
Defined in: rest/src/types.ts:2044
Gets multiple messages from a channel.
Parameters
channelId
The ID of the channel from which to get the messages.
options?
The parameters for the fetching of the messages.
Returns
Promise
<object
[]>
A collection of DiscordMessage objects assorted by message ID.
Remarks
Requires that the bot user be able to see the contents of the channel in which the messages were posted.
If getting a messages from a guild channel:
- Requires the
READ_MESSAGE_HISTORY
permission.
See
https://discord.com/developers/docs/resources/channel#get-channel-messages
getOriginalInteractionResponse()
getOriginalInteractionResponse: (
token
) =>Promise
<{activity
: {partyId
:string
;type
:MessageActivityTypes
; };application
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; };1
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };applicationId
:string
;attachments
:object
[];author
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };call
: {endedTimestamp
:string
;participants
:string
[]; };channelId
:string
;components
: ({components
: ({channelTypes
: ... | ...;customId
:string
;defaultValues
: ... | ...;disabled
: ... | ... | ...;maxValues
: ... | ...;minValues
: ... | ...;options
: ... | ...;placeholder
: ... | ...;type
: ... | ... | ... | ... | ...; } | {customId
: ... | ...;disabled
: ... | ... | ...;emoji
: ... | ...;label
: ... | ...;skuId
: ... | ...;style
:ButtonStyles
;type
:Button
;url
: ... | ...; } | {customId
:string
;label
:string
;maxLength
: ... | ...;minLength
: ... | ...;placeholder
: ... | ...;required
: ... | ... | ...;style
:TextStyles
;type
:InputText
;value
: ... | ...; })[];type
:ActionRow
; } | {channelTypes
:ChannelTypes
[];customId
:string
;defaultValues
:object
[];disabled
:boolean
;maxValues
:number
;minValues
:number
;options
:object
[];placeholder
:string
;type
:SelectMenu
|SelectMenuUsers
|SelectMenuRoles
|SelectMenuUsersAndRoles
|SelectMenuChannels
; } | {customId
:string
;disabled
:boolean
;emoji
: {animated
:boolean
;id
:string
;name
:string
; };label
:string
;skuId
:string
;style
:ButtonStyles
;type
:Button
;url
:string
; } | {customId
:string
;label
:string
;maxLength
:number
;minLength
:number
;placeholder
:string
;required
:boolean
;style
:TextStyles
;type
:InputText
;value
:string
; })[];content
:string
;editedTimestamp
:null
|string
;embeds
:object
[];flags
:MessageFlags
;guildId
:string
;id
:string
;interaction
: {id
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
: ...;skuId
: ...; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };name
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };interactionMetadata
: {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;targetMessageId
:string
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;interactedMessageId
:string
;originalResponseMessageId
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mentionChannels
:object
[];mentionEveryone
:boolean
;mentionRoles
:string
[];mentions
:object
[];messageReference
: {channelId
:string
;failIfNotExists
:boolean
;guildId
:string
;messageId
:string
;type
:DiscordMessageReferenceType
; };messageSnapshots
:object
[];nonce
:string
|number
;pinned
:boolean
;poll
: {allowMultiselect
:boolean
;answers
:object
[];expiry
:null
|string
;layoutType
:Default
;question
: {emoji
: {animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
: ... | ...;avatar
: ... | ...;avatarDecorationData
: ... | ...;banner
: ... | ...;bot
: ... | ... | ...;discriminator
:string
;flags
: ... | ...;globalName
: ... | ...;id
:string
;locale
: ... | ...;mfaEnabled
: ... | ... | ...;premiumType
: ... | ...;publicFlags
: ... | ...;system
: ... | ... | ...;username
:string
;verified
: ... | ... | ...; }; };text
:string
; };results
: {answerCounts
:object
[];isFinalized
:boolean
; }; };position
:number
;reactions
:object
[];referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...;stickerItems
:object
[];stickers
:object
[];thread
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };timestamp
:string
;tts
:boolean
;type
:MessageTypes
;webhookId
:string
; }>
Defined in: rest/src/types.ts:2076
Gets the initial message response to an interaction.
Parameters
token
string
The interaction token to use, provided in the original interaction.
Returns
Promise
<{ activity
: { partyId
: string
; type
: MessageActivityTypes
; }; application
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; 1
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; applicationId
: string
; attachments
: object
[]; author
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; call
: { endedTimestamp
: string
; participants
: string
[]; }; channelId
: string
; components
: ({ components
: ({ channelTypes
: ... | ...; customId
: string
; defaultValues
: ... | ...; disabled
: ... | ... | ...; maxValues
: ... | ...; minValues
: ... | ...; options
: ... | ...; placeholder
: ... | ...; type
: ... | ... | ... | ... | ...; } | { customId
: ... | ...; disabled
: ... | ... | ...; emoji
: ... | ...; label
: ... | ...; skuId
: ... | ...; style
: ButtonStyles
; type
: Button
; url
: ... | ...; } | { customId
: string
; label
: string
; maxLength
: ... | ...; minLength
: ... | ...; placeholder
: ... | ...; required
: ... | ... | ...; style
: TextStyles
; type
: InputText
; value
: ... | ...; })[]; type
: ActionRow
; } | { channelTypes
: ChannelTypes
[]; customId
: string
; defaultValues
: object
[]; disabled
: boolean
; maxValues
: number
; minValues
: number
; options
: object
[]; placeholder
: string
; type
: SelectMenu
| SelectMenuUsers
| SelectMenuRoles
| SelectMenuUsersAndRoles
| SelectMenuChannels
; } | { customId
: string
; disabled
: boolean
; emoji
: { animated
: boolean
; id
: string
; name
: string
; }; label
: string
; skuId
: string
; style
: ButtonStyles
; type
: Button
; url
: string
; } | { customId
: string
; label
: string
; maxLength
: number
; minLength
: number
; placeholder
: string
; required
: boolean
; style
: TextStyles
; type
: InputText
; value
: string
; })[]; content
: string
; editedTimestamp
: null
| string
; embeds
: object
[]; flags
: MessageFlags
; guildId
: string
; id
: string
; interaction
: { id
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: ...; skuId
: ...; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; name
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; interactionMetadata
: { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; targetMessageId
: string
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; interactedMessageId
: string
; originalResponseMessageId
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mentionChannels
: object
[]; mentionEveryone
: boolean
; mentionRoles
: string
[]; mentions
: object
[]; messageReference
: { channelId
: string
; failIfNotExists
: boolean
; guildId
: string
; messageId
: string
; type
: DiscordMessageReferenceType
; }; messageSnapshots
: object
[]; nonce
: string
| number
; pinned
: boolean
; poll
: { allowMultiselect
: boolean
; answers
: object
[]; expiry
: null
| string
; layoutType
: Default
; question
: { emoji
: { animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: ... | ...; avatar
: ... | ...; avatarDecorationData
: ... | ...; banner
: ... | ...; bot
: ... | ... | ...; discriminator
: string
; email
: ... | ... | ...; flags
: ... | ...; globalName
: ... | ...; id
: string
; locale
: ... | ...; mfaEnabled
: ... | ... | ...; premiumType
: ... | ...; publicFlags
: ... | ...; system
: ... | ... | ...; username
: string
; verified
: ... | ... | ...; }; }; text
: string
; }; results
: { answerCounts
: object
[]; isFinalized
: boolean
; }; }; position
: number
; reactions
: object
[]; referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...; stickerItems
: object
[]; stickers
: object
[]; thread
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; timestamp
: string
; tts
: boolean
; type
: MessageTypes
; webhookId
: string
; }>
An instance of DiscordMessage.
Remarks
Unlike getMessage()
, this endpoint allows the bot user to act without:
- Needing to be able to see the contents of the channel that the message is in. (
READ_MESSAGES
permission.) - Requiring the
MESSAGE_CONTENT
intent.
Does not support ephemeral follow-up messages due to these being stateless.
See
getOwnVoiceState()
getOwnVoiceState: (
guildId
) =>Promise
<{channelId
:null
|string
;deaf
:boolean
;guildId
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mute
:boolean
;requestToSpeakTimestamp
:null
|string
;selfDeaf
:boolean
;selfMute
:boolean
;selfStream
:boolean
;selfVideo
:boolean
;sessionId
:string
;suppress
:boolean
;userId
:string
; }>
Defined in: rest/src/types.ts:2240
Returns the current user's voice state in the guild.
Parameters
guildId
The ID of the guild to get the voice state from.
Returns
Promise
<{ channelId
: null
| string
; deaf
: boolean
; guildId
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mute
: boolean
; requestToSpeakTimestamp
: null
| string
; selfDeaf
: boolean
; selfMute
: boolean
; selfStream
: boolean
; selfVideo
: boolean
; sessionId
: string
; suppress
: boolean
; userId
: string
; }>
An instance of DiscordVoiceState.
See
https://discord.com/developers/docs/resources/voice#get-current-user-voice-state
getPinnedMessages()
getPinnedMessages: (
channelId
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:2091
Gets the pinned messages for a channel.
Parameters
channelId
The ID of the channel to get the pinned messages for.
Returns
Promise
<object
[]>
A collection of DiscordMessage objects assorted by message ID.
Remarks
Requires that the bot user be able to see the contents of the channel in which the messages were posted.
If getting a message from a guild channel:
- Requires the
READ_MESSAGE_HISTORY
permission.
See
https://discord.com/developers/docs/resources/channel#get-pinned-messages
getPollAnswerVoters()
getPollAnswerVoters: (
channelId
,messageId
,answerId
,options
?) =>Promise
<{users
:object
[]; }>
Defined in: rest/src/types.ts:2662
Get a list of users that voted for this specific answer.
Parameters
channelId
The ID of the channel in which the message with the poll lives
messageId
The ID of the message in which the poll lives
answerId
number
The ID of the answer to get the users that voted that answer
options?
The options for the request
Returns
Promise
<{ users
: object
[]; }>
The list of users that voted for the specific answer.
getPrivateArchivedThreads()
getPrivateArchivedThreads: (
channelId
,options
?) =>Promise
<{hasMore
:boolean
;members
:object
[];threads
:object
[]; }>
Defined in: rest/src/types.ts:2109
Gets the list of private archived threads for a channel.
Parameters
channelId
The ID of the channel to get the archived threads for.
options?
The parameters for the fetching of threads.
Returns
Promise
<{ hasMore
: boolean
; members
: object
[]; threads
: object
[]; }>
An instance of DiscordArchivedThreads.
Remarks
Requires the READ_MESSAGE_HISTORY
permission.
Requires the MANAGE_THREADS
permission.
Returns threads of type ChannelTypes.GuildPrivateThread.
Threads are ordered by the archive_timestamp
property included in the metadata of the object in descending order.
See
https://discord.com/developers/docs/resources/channel#list-private-archived-threads
getPrivateJoinedArchivedThreads()
getPrivateJoinedArchivedThreads: (
channelId
,options
?) =>Promise
<{hasMore
:boolean
;members
:object
[];threads
:object
[]; }>
Defined in: rest/src/types.ts:2126
Gets the list of private archived threads the bot is a member of for a channel.
Parameters
channelId
The ID of the channel to get the archived threads for.
options?
The parameters for the fetching of threads.
Returns
Promise
<{ hasMore
: boolean
; members
: object
[]; threads
: object
[]; }>
An instance of DiscordArchivedThreads.
Remarks
Requires the READ_MESSAGE_HISTORY
permission.
Returns threads of type ChannelTypes.GuildPrivateThread.
Threads are ordered by the id
property in descending order.
See
https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads
getPruneCount()
getPruneCount: (
guildId
,options
?) =>Promise
<{pruned
:number
; }>
Defined in: rest/src/types.ts:2139
Gets the number of members that would be kicked from a guild during pruning.
Parameters
guildId
The ID of the guild to get the prune count of.
options?
The parameters for the fetching of the prune count.
Returns
Promise
<{ pruned
: number
; }>
A number indicating the number of members that would be kicked.
Remarks
Requires the MANAGE_GUILD
and KICK_MEMBERS
permissions.
See
https://discord.com/developers/docs/resources/guild#get-guild-prune-count
getPublicArchivedThreads()
getPublicArchivedThreads: (
channelId
,options
?) =>Promise
<{hasMore
:boolean
;members
:object
[];threads
:object
[]; }>
Defined in: rest/src/types.ts:2157
Gets the list of public archived threads for a channel.
Parameters
channelId
The ID of the channel to get the archived threads for.
options?
The parameters for the fetching of threads.
Returns
Promise
<{ hasMore
: boolean
; members
: object
[]; threads
: object
[]; }>
An instance of DiscordArchivedThreads.
Remarks
Requires the READ_MESSAGE_HISTORY
permission.
If called on a channel of type ChannelTypes.GuildText, returns threads of type ChannelTypes.GuildPublicThread. If called on a channel of type ChannelTypes.GuildNews, returns threads of type ChannelTypes.GuildNewsThread.
Threads are ordered by the archive_timestamp
property included in the metadata of the object in descending order.
See
https://discord.com/developers/docs/resources/channel#list-public-archived-threads
getReactions()
getReactions: (
channelId
,messageId
,reaction
,options
?) =>Promise
<object
[]>
Defined in: rest/src/types.ts:2293
Gets the list of users that reacted with an emoji to a message.
Parameters
channelId
The ID of the channel the message to get the users for is in.
messageId
The ID of the message to get the users for.
reaction
string
The reaction for which to get the users.
options?
The parameters for the fetching of the users.
Returns
Promise
<object
[]>
A collection of DiscordUser objects assorted by user ID.
See
https://discord.com/developers/docs/resources/channel#get-reactions
getRole()
getRole: (
guildId
,roleId
) =>Promise
<{color
:number
;flags
:RoleFlags
;hoist
:boolean
;icon
:string
;id
:string
;managed
:boolean
;mentionable
:boolean
;name
:string
;permissions
:string
;position
:number
;tags
: {availableForPurchase
:null
;botId
:string
;guildConnections
:null
;integrationId
:string
;premiumSubscriber
:null
;subscriptionListingId
:string
; };unicodeEmoji
:string
; }>
Defined in: rest/src/types.ts:2179
Gets a role by id for a guild.
Parameters
guildId
The ID of the guild to get role for.
roleId
The ID of the role.
Returns
Promise
<{ color
: number
; flags
: RoleFlags
; hoist
: boolean
; icon
: string
; id
: string
; managed
: boolean
; mentionable
: boolean
; name
: string
; permissions
: string
; position
: number
; tags
: { availableForPurchase
: null
; botId
: string
; guildConnections
: null
; integrationId
: string
; premiumSubscriber
: null
; subscriptionListingId
: string
; }; unicodeEmoji
: string
; }>
A DiscordRole object.
See
https://discord.com/developers/docs/resources/guild#get-guild-role
getRoles()
getRoles: (
guildId
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:2169
Gets the list of roles for a guild.
Parameters
guildId
The ID of the guild to get the list of roles for.
Returns
Promise
<object
[]>
A collection of DiscordRole objects assorted by role ID.
Remarks
⚠️ This endpoint should be used sparingly due to DiscordRole objects already being included in guild payloads.
See
https://discord.com/developers/docs/resources/guild#get-guild-roles
getScheduledEvent()
getScheduledEvent: (
guildId
,eventId
,options
?) =>Promise
<{channelId
:null
|string
;creator
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };creatorId
:null
|string
;description
:string
;entityId
:null
|string
;entityMetadata
:null
| {location
:string
; };entityType
:ScheduledEventEntityType
;guildId
:string
;id
:string
;image
:null
|string
;name
:string
;privacyLevel
:GuildOnly
;recurrenceRule
:null
| {byMonth
:null
|DiscordScheduledEventRecurrenceRuleMonth
[];byMonthDay
:null
|number
[];byNWeekday
:null
|object
[];byWeekday
:null
|DiscordScheduledEventRecurrenceRuleWeekday
[];byYearDay
:null
|number
[];count
:null
|number
;end
:null
|string
;frequency
:DiscordScheduledEventRecurrenceRuleFrequency
;interval
:number
;start
:string
; };scheduledEndTime
:null
|string
;scheduledStartTime
:string
;status
:ScheduledEventStatus
;userCount
:number
; }>
Defined in: rest/src/types.ts:2190
Gets a scheduled event by its ID.
Parameters
guildId
The ID of the guild to get the scheduled event from.
eventId
The ID of the scheduled event to get.
options?
The parameters for the fetching of the scheduled event.
withUserCount
boolean
Returns
Promise
<{ channelId
: null
| string
; creator
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; creatorId
: null
| string
; description
: string
; entityId
: null
| string
; entityMetadata
: null
| { location
: string
; }; entityType
: ScheduledEventEntityType
; guildId
: string
; id
: string
; image
: null
| string
; name
: string
; privacyLevel
: GuildOnly
; recurrenceRule
: null
| { byMonth
: null
| DiscordScheduledEventRecurrenceRuleMonth
[]; byMonthDay
: null
| number
[]; byNWeekday
: null
| object
[]; byWeekday
: null
| DiscordScheduledEventRecurrenceRuleWeekday
[]; byYearDay
: null
| number
[]; count
: null
| number
; end
: null
| string
; frequency
: DiscordScheduledEventRecurrenceRuleFrequency
; interval
: number
; start
: string
; }; scheduledEndTime
: null
| string
; scheduledStartTime
: string
; status
: ScheduledEventStatus
; userCount
: number
; }>
An instance of DiscordScheduledEvent.
See
https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event
getScheduledEvents()
getScheduledEvents: (
guildId
,options
?) =>Promise
<object
[]>
Defined in: rest/src/types.ts:2200
Gets the list of scheduled events for a guild.
Parameters
guildId
The ID of the guild to get the scheduled events from.
options?
The parameters for the fetching of the scheduled events.
Returns
Promise
<object
[]>
A collection of DiscordScheduledEvent objects assorted by event ID.
See
https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild
getScheduledEventUsers()
getScheduledEventUsers: (
guildId
,eventId
,options
?) =>Promise
<object
[]>
Defined in: rest/src/types.ts:2216
Gets the list of subscribers to a scheduled event from a guild.
Parameters
guildId
The ID of the guild to get the subscribers to the scheduled event from.
eventId
The ID of the scheduled event to get the subscribers of.
options?
The parameters for the fetching of the subscribers.
Returns
Promise
<object
[]>
A collection of DiscordUser objects assorted by user ID.
Remarks
Requires the MANAGE_EVENTS
permission.
Users are ordered by their IDs in ascending order.
See
https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users
getSessionInfo()
getSessionInfo: () =>
Promise
<{sessionStartLimit
: {maxConcurrency
:number
;remaining
:number
;resetAfter
:number
;total
:number
; };shards
:number
;url
:string
; }>
Defined in: rest/src/types.ts:2222
Get the bots Gateway metadata that can help during the operation of large or sharded bots.
Returns
Promise
<{ sessionStartLimit
: { maxConcurrency
: number
; remaining
: number
; resetAfter
: number
; total
: number
; }; shards
: number
; url
: string
; }>
getStageInstance()
getStageInstance: (
channelId
) =>Promise
<{channelId
:string
;guildId
:string
;guildScheduledEventId
:string
;id
:string
;topic
:string
; }>
Defined in: rest/src/types.ts:2231
Gets the stage instance associated with a stage channel, if one exists.
Parameters
channelId
The ID of the stage channel the stage instance is associated with.
Returns
Promise
<{ channelId
: string
; guildId
: string
; guildScheduledEventId
: string
; id
: string
; topic
: string
; }>
An instance of DiscordStageInstance.
See
https://discord.com/developers/docs/resources/stage-instance#get-stage-instance
getSticker()
getSticker: (
stickerId
) =>Promise
<{available
:boolean
;description
:string
;formatType
:StickerFormatTypes
;guildId
:string
;id
:string
;name
:string
;packId
:string
;sortValue
:number
;tags
:string
;type
:StickerTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; }>
Defined in: rest/src/types.ts:2259
Returns a sticker object for the given sticker ID.
Parameters
stickerId
The ID of the sticker to get
Returns
Promise
<{ available
: boolean
; description
: string
; formatType
: StickerFormatTypes
; guildId
: string
; id
: string
; name
: string
; packId
: string
; sortValue
: number
; tags
: string
; type
: StickerTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }>
See
https://discord.com/developers/docs/resources/sticker#get-sticker
getStickerPack()
getStickerPack: (
stickerPackId
) =>Promise
<{bannerAssetId
:string
;coverStickerId
:string
;description
:string
;id
:string
;name
:string
;skuId
:string
;stickers
:object
[]; }>
Defined in: rest/src/types.ts:2052
Returns a sticker pack for the given ID.
Parameters
stickerPackId
Returns
Promise
<{ bannerAssetId
: string
; coverStickerId
: string
; description
: string
; id
: string
; name
: string
; skuId
: string
; stickers
: object
[]; }>
A DiscordStickerPack object.
See
https://discord.com/developers/docs/resources/sticker#get-sticker-pack
getStickerPacks()
getStickerPacks: () =>
Promise
<object
[]>
Defined in: rest/src/types.ts:2060
Returns the list of sticker packs available.
Returns
Promise
<object
[]>
A collection of DiscordStickerPack objects assorted by sticker ID.
See
https://discord.com/developers/docs/resources/sticker#list-sticker-packs
getSubscription()
getSubscription: (
skuId
,subscriptionId
) =>Promise
<{canceledAt
:null
|string
;country
:string
;currentPeriodEnd
:string
;currentPeriodStart
:string
;entitlementIds
:string
[];id
:string
;renewalSkuIds
:null
|string
[];skuIds
:string
[];status
:DiscordSubscriptionStatus
;userId
:string
; }>
Defined in: rest/src/types.ts:3047
Get a subscription by its ID.
Parameters
skuId
The id of the sku of get the subscriptions for
subscriptionId
Returns
Promise
<{ canceledAt
: null
| string
; country
: string
; currentPeriodEnd
: string
; currentPeriodStart
: string
; entitlementIds
: string
[]; id
: string
; renewalSkuIds
: null
| string
[]; skuIds
: string
[]; status
: DiscordSubscriptionStatus
; userId
: string
; }>
getThreadMember()
getThreadMember: (
channelId
,userId
) =>Promise
<{flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; }>
Defined in: rest/src/types.ts:2269
Gets a thread member by their user ID.
Parameters
channelId
The ID of the thread to get the thread member of.
userId
The user ID of the thread member to get.
Returns
Promise
<{ flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }>
An instance of DiscordThreadMember.
See
https://discord.com/developers/docs/resources/channel#get-thread-member
getThreadMembers()
getThreadMembers: (
channelId
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:2281
Gets the list of thread members for a thread.
Parameters
channelId
The ID of the thread to get the thread members of.
Returns
Promise
<object
[]>
A collection of DiscordThreadMember assorted by user ID.
Remarks
Requires the application to have the GUILD_MEMBERS
privileged intent enabled.
See
https://discord.com/developers/docs/resources/channel#list-thread-members
getUser()
getUser: (
id
) =>Promise
<{accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }>
Defined in: rest/src/types.ts:2300
Get a user's data from the api
Parameters
id
The user's id
Returns
Promise
<{ accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }>
getUserApplicationRoleConnection()
getUserApplicationRoleConnection: (
bearerToken
,applicationId
) =>Promise
<{metadata
: {};platformName
:null
|string
;platformUsername
:null
|string
; }>
Defined in: rest/src/types.ts:2335
Get the current user application role connection for the application.
Parameters
bearerToken
string
The access token of the user
applicationId
The id of the application to get the role connection
Returns
Promise
<{ metadata
: {}; platformName
: null
| string
; platformUsername
: null
| string
; }>
Remarks
The access token requires the role_connections.write
scope.
See
https://discord.com/developers/docs/resources/user#get-user-application-role-connection
getUserConnections()
getUserConnections: (
bearerToken
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:2322
Get the current user connections.
Parameters
bearerToken
string
The access token of the user
Returns
Promise
<object
[]>
Remarks
This requires the connections
scope.
getUserVoiceState()
getUserVoiceState: (
guildId
,userId
) =>Promise
<{channelId
:null
|string
;deaf
:boolean
;guildId
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mute
:boolean
;requestToSpeakTimestamp
:null
|string
;selfDeaf
:boolean
;selfMute
:boolean
;selfStream
:boolean
;selfVideo
:boolean
;sessionId
:string
;suppress
:boolean
;userId
:string
; }>
Defined in: rest/src/types.ts:2250
Returns the specified user's voice state in the guild.
Parameters
guildId
The ID of the guild to get the voice state from.
userId
The ID of the user to get the voice state from
Returns
Promise
<{ channelId
: null
| string
; deaf
: boolean
; guildId
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mute
: boolean
; requestToSpeakTimestamp
: null
| string
; selfDeaf
: boolean
; selfMute
: boolean
; selfStream
: boolean
; selfVideo
: boolean
; sessionId
: string
; suppress
: boolean
; userId
: string
; }>
An instance of DiscordVoiceState.
See
https://discord.com/developers/docs/resources/voice#get-user-voice-state
getVanityUrl()
getVanityUrl: (
guildId
) =>Promise
<{code
:null
|string
;uses
:number
; }>
Defined in: rest/src/types.ts:2349
Gets information about the vanity url of a guild.
Parameters
guildId
The ID of the guild to get the vanity url information for.
Returns
Promise
<{ code
: null
| string
; uses
: number
; }>
An instance of DiscordVanityUrl.
Remarks
Requires the MANAGE_GUILD
permission.
The code
property will be null
if the guild does not have a set vanity url.
See
https://discord.com/developers/docs/resources/guild#get-guild-vanity-url
getVoiceRegions()
getVoiceRegions: (
guildId
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:2358
Gets the list of voice regions for a guild.
Parameters
guildId
The ID of the guild to get the voice regions for.
Returns
Promise
<object
[]>
A collection of DiscordVoiceRegion objects assorted by voice region ID.
See
https://discord.com/developers/docs/resources/guild#get-guild-voice-regions
getWebhook()
getWebhook: (
webhookId
) =>Promise
<Camelize
<DiscordWebhook
>>
Defined in: rest/src/types.ts:2370
Gets a webhook by its ID.
Parameters
webhookId
The ID of the webhook to get.
Returns
Promise
<Camelize
<DiscordWebhook
>>
An instance of DiscordWebhook.
Remarks
Requires the MANAGE_WEBHOOKS
permission unless the application making the request owns the webhook.
See
https://discord.com/developers/docs/resources/webhook#get-webhook
getWebhookMessage()
getWebhookMessage: (
webhookId
,token
,messageId
,options
?) =>Promise
<{activity
: {partyId
:string
;type
:MessageActivityTypes
; };application
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; };1
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };applicationId
:string
;attachments
:object
[];author
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };call
: {endedTimestamp
:string
;participants
:string
[]; };channelId
:string
;components
: ({components
: ({channelTypes
: ... | ...;customId
:string
;defaultValues
: ... | ...;disabled
: ... | ... | ...;maxValues
: ... | ...;minValues
: ... | ...;options
: ... | ...;placeholder
: ... | ...;type
: ... | ... | ... | ... | ...; } | {customId
: ... | ...;disabled
: ... | ... | ...;emoji
: ... | ...;label
: ... | ...;skuId
: ... | ...;style
:ButtonStyles
;type
:Button
;url
: ... | ...; } | {customId
:string
;label
:string
;maxLength
: ... | ...;minLength
: ... | ...;placeholder
: ... | ...;required
: ... | ... | ...;style
:TextStyles
;type
:InputText
;value
: ... | ...; })[];type
:ActionRow
; } | {channelTypes
:ChannelTypes
[];customId
:string
;defaultValues
:object
[];disabled
:boolean
;maxValues
:number
;minValues
:number
;options
:object
[];placeholder
:string
;type
:SelectMenu
|SelectMenuUsers
|SelectMenuRoles
|SelectMenuUsersAndRoles
|SelectMenuChannels
; } | {customId
:string
;disabled
:boolean
;emoji
: {animated
:boolean
;id
:string
;name
:string
; };label
:string
;skuId
:string
;style
:ButtonStyles
;type
:Button
;url
:string
; } | {customId
:string
;label
:string
;maxLength
:number
;minLength
:number
;placeholder
:string
;required
:boolean
;style
:TextStyles
;type
:InputText
;value
:string
; })[];content
:string
;editedTimestamp
:null
|string
;embeds
:object
[];flags
:MessageFlags
;guildId
:string
;id
:string
;interaction
: {id
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
: ...;skuId
: ...; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };name
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };interactionMetadata
: {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;targetMessageId
:string
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;interactedMessageId
:string
;originalResponseMessageId
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mentionChannels
:object
[];mentionEveryone
:boolean
;mentionRoles
:string
[];mentions
:object
[];messageReference
: {channelId
:string
;failIfNotExists
:boolean
;guildId
:string
;messageId
:string
;type
:DiscordMessageReferenceType
; };messageSnapshots
:object
[];nonce
:string
|number
;pinned
:boolean
;poll
: {allowMultiselect
:boolean
;answers
:object
[];expiry
:null
|string
;layoutType
:Default
;question
: {emoji
: {animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
: ... | ...;avatar
: ... | ...;avatarDecorationData
: ... | ...;banner
: ... | ...;bot
: ... | ... | ...;discriminator
:string
;flags
: ... | ...;globalName
: ... | ...;id
:string
;locale
: ... | ...;mfaEnabled
: ... | ... | ...;premiumType
: ... | ...;publicFlags
: ... | ...;system
: ... | ... | ...;username
:string
;verified
: ... | ... | ...; }; };text
:string
; };results
: {answerCounts
:object
[];isFinalized
:boolean
; }; };position
:number
;reactions
:object
[];referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...;stickerItems
:object
[];stickers
:object
[];thread
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };timestamp
:string
;tts
:boolean
;type
:MessageTypes
;webhookId
:string
; }>
Defined in: rest/src/types.ts:2382
Gets a webhook message by its ID.
Parameters
webhookId
The ID of the webhook to get a message of.
token
string
The webhook token, used to get webhook messages.
messageId
the ID of the webhook message to get.
options?
The parameters for the fetching of the message.
Returns
Promise
<{ activity
: { partyId
: string
; type
: MessageActivityTypes
; }; application
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; 1
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; applicationId
: string
; attachments
: object
[]; author
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; call
: { endedTimestamp
: string
; participants
: string
[]; }; channelId
: string
; components
: ({ components
: ({ channelTypes
: ... | ...; customId
: string
; defaultValues
: ... | ...; disabled
: ... | ... | ...; maxValues
: ... | ...; minValues
: ... | ...; options
: ... | ...; placeholder
: ... | ...; type
: ... | ... | ... | ... | ...; } | { customId
: ... | ...; disabled
: ... | ... | ...; emoji
: ... | ...; label
: ... | ...; skuId
: ... | ...; style
: ButtonStyles
; type
: Button
; url
: ... | ...; } | { customId
: string
; label
: string
; maxLength
: ... | ...; minLength
: ... | ...; placeholder
: ... | ...; required
: ... | ... | ...; style
: TextStyles
; type
: InputText
; value
: ... | ...; })[]; type
: ActionRow
; } | { channelTypes
: ChannelTypes
[]; customId
: string
; defaultValues
: object
[]; disabled
: boolean
; maxValues
: number
; minValues
: number
; options
: object
[]; placeholder
: string
; type
: SelectMenu
| SelectMenuUsers
| SelectMenuRoles
| SelectMenuUsersAndRoles
| SelectMenuChannels
; } | { customId
: string
; disabled
: boolean
; emoji
: { animated
: boolean
; id
: string
; name
: string
; }; label
: string
; skuId
: string
; style
: ButtonStyles
; type
: Button
; url
: string
; } | { customId
: string
; label
: string
; maxLength
: number
; minLength
: number
; placeholder
: string
; required
: boolean
; style
: TextStyles
; type
: InputText
; value
: string
; })[]; content
: string
; editedTimestamp
: null
| string
; embeds
: object
[]; flags
: MessageFlags
; guildId
: string
; id
: string
; interaction
: { id
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: ...; skuId
: ...; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; name
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; interactionMetadata
: { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; targetMessageId
: string
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; interactedMessageId
: string
; originalResponseMessageId
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mentionChannels
: object
[]; mentionEveryone
: boolean
; mentionRoles
: string
[]; mentions
: object
[]; messageReference
: { channelId
: string
; failIfNotExists
: boolean
; guildId
: string
; messageId
: string
; type
: DiscordMessageReferenceType
; }; messageSnapshots
: object
[]; nonce
: string
| number
; pinned
: boolean
; poll
: { allowMultiselect
: boolean
; answers
: object
[]; expiry
: null
| string
; layoutType
: Default
; question
: { emoji
: { animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: ... | ...; avatar
: ... | ...; avatarDecorationData
: ... | ...; banner
: ... | ...; bot
: ... | ... | ...; discriminator
: string
; email
: ... | ... | ...; flags
: ... | ...; globalName
: ... | ...; id
: string
; locale
: ... | ...; mfaEnabled
: ... | ... | ...; premiumType
: ... | ...; publicFlags
: ... | ...; system
: ... | ... | ...; username
: string
; verified
: ... | ... | ...; }; }; text
: string
; }; results
: { answerCounts
: object
[]; isFinalized
: boolean
; }; }; position
: number
; reactions
: object
[]; referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...; stickerItems
: object
[]; stickers
: object
[]; thread
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; timestamp
: string
; tts
: boolean
; type
: MessageTypes
; webhookId
: string
; }>
An instance of DiscordMessage.
See
https://discord.com/developers/docs/resources/webhook#get-webhook-message
getWebhookWithToken()
getWebhookWithToken: (
webhookId
,token
) =>Promise
<Camelize
<DiscordWebhook
>>
Defined in: rest/src/types.ts:2397
Gets a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
Parameters
webhookId
The ID of the webhook to get.
token
string
The webhook token, used to get the webhook.
Returns
Promise
<Camelize
<DiscordWebhook
>>
An instance of DiscordWebhook.
See
https://discord.com/developers/docs/resources/webhook#get-webhook-with-token
getWelcomeScreen()
getWelcomeScreen: (
guildId
) =>Promise
<{description
:null
|string
;welcomeChannels
:object
[]; }>
Defined in: rest/src/types.ts:2410
Gets the welcome screen for a guild.
Parameters
guildId
The ID of the guild to get the welcome screen for.
Returns
Promise
<{ description
: null
| string
; welcomeChannels
: object
[]; }>
An instance of DiscordWelcomeScreen.
Remarks
If the welcome screen is not enabled:
- Requires the
MANAGE_GUILD
permission.
See
https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
getWidget()
getWidget: (
guildId
) =>Promise
<{channels
:object
[];id
:string
;instantInvite
:string
;members
:object
[];name
:string
;presenceCount
:number
; }>
Defined in: rest/src/types.ts:2422
Gets the guild widget by guild ID.
Parameters
guildId
The ID of the guild to get the widget of.
Returns
Promise
<{ channels
: object
[]; id
: string
; instantInvite
: string
; members
: object
[]; name
: string
; presenceCount
: number
; }>
An instance of DiscordGuildWidget.
Remarks
Fires an INVITE_CREATED
Gateway event when an invite channel is defined and a new Invite
is generated.
See
https://discord.com/developers/docs/resources/guild#get-guild-widget
getWidgetSettings()
getWidgetSettings: (
guildId
) =>Promise
<{channelId
:null
|string
;enabled
:boolean
; }>
Defined in: rest/src/types.ts:2434
Gets the settings of a guild's widget.
Parameters
guildId
The ID of the guild to get the widget of.
Returns
Promise
<{ channelId
: null
| string
; enabled
: boolean
; }>
An instance of DiscordGuildWidgetSettings.
Remarks
Requires the MANAGE_GUILD
permission.
See
https://discord.com/developers/docs/resources/guild#get-guild-widget-settings
globallyRateLimited
globallyRateLimited:
boolean
Defined in: rest/src/types.ts:218
Whether or not the manager is rate limited globally across all requests. Defaults to false.
invalidBucket
invalidBucket:
InvalidRequestBucket
Defined in: rest/src/types.ts:228
The bucket for handling any invalid requests.
isProxied
isProxied:
boolean
Defined in: rest/src/types.ts:208
true
if the baseUrl
does not start with https://discord.com/api
.
Mostly used only for intern functions.
joinThread()
joinThread: (
channelId
) =>Promise
<void
>
Defined in: rest/src/types.ts:2447
Adds the bot user to a thread.
Parameters
channelId
The ID of the thread to add the bot user to.
Returns
Promise
<void
>
Remarks
Requires the thread not be archived.
Fires a Thread Members Update gateway event.
See
https://discord.com/developers/docs/resources/channel#join-thread
kickMember()
kickMember: (
guildId
,userId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:2883
Kicks a member from a guild.
Parameters
guildId
The ID of the guild to kick the member from.
userId
The user ID of the member to kick from the guild.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
Requires the KICK_MEMBERS
permission.
Fires a Guild Member Remove gateway event.
See
https://discord.com/developers/docs/resources/guild#remove-guild-member
leaveGuild()
leaveGuild: (
guildId
) =>Promise
<void
>
Defined in: rest/src/types.ts:2458
Leaves a guild.
Parameters
guildId
The ID of the guild to leave.
Returns
Promise
<void
>
Remarks
Fires a Guild Delete event.
See
https://discord.com/developers/docs/resources/user#leave-guild
leaveThread()
leaveThread: (
channelId
) =>Promise
<void
>
Defined in: rest/src/types.ts:2471
Removes the bot user from a thread.
Parameters
channelId
The ID of the thread to remove the bot user from.
Returns
Promise
<void
>
Remarks
Requires the thread not be archived.
Fires a Thread Members Update gateway event.
See
https://discord.com/developers/docs/resources/channel#leave-thread
listDefaultSoundboardSounds()
listDefaultSoundboardSounds: () =>
Promise
<object
[]>
Defined in: rest/src/types.ts:3061
Returns an array of soundboard sound objects that can be used by all users.
Returns
Promise
<object
[]>
listEntitlements()
listEntitlements: (
applicationId
,options
?) =>Promise
<object
[]>
Defined in: rest/src/types.ts:2997
Returns all entitlements for a given app, active and expired.
Parameters
applicationId
The id of the application to get the entitlements
options?
The optional query params for the endpoint
Returns
Promise
<object
[]>
listGuildSoundboardSounds()
listGuildSoundboardSounds: (
guildId
) =>Promise
<{items
:object
[]; }>
Defined in: rest/src/types.ts:3070
Returns a list of the guild's soundboard sounds.
Parameters
guildId
The guild to get the sounds from
Returns
Promise
<{ items
: object
[]; }>
Remarks
Includes user
fields if the bot has the CREATE_GUILD_EXPRESSIONS
or MANAGE_GUILD_EXPRESSIONS
permission.
listSkus()
listSkus: (
applicationId
) =>Promise
<object
[]>
Defined in: rest/src/types.ts:3035
Returns all SKUs for a given application
Parameters
applicationId
The id of the application to get the SKUs
Returns
Promise
<object
[]>
listSubscriptions()
listSubscriptions: (
skuId
,options
?) =>Promise
<object
[]>
Defined in: rest/src/types.ts:3041
Returns all subscriptions containing the SKU, filtered by user.
Parameters
skuId
The id of the sku of get the subscriptions for
options?
Returns
Promise
<object
[]>
logger
logger:
Pick
<{debug
: (...args
) =>void
;error
: (...args
) =>void
;fatal
: (...args
) =>void
;info
: (...args
) =>void
;log
: (level
, ...args
) =>void
;setDepth
: (level
) =>void
;setLevel
: (level
) =>void
;warn
: (...args
) =>void
; },"debug"
|"info"
|"warn"
|"error"
|"fatal"
>
Defined in: rest/src/types.ts:232
The logger to use for the rest manager
makeRequest()
makeRequest: <
T
>(method
,url
,options
?) =>Promise
<T
>
Defined in: rest/src/types.ts:254
Make a request to be sent to the api.
Type Parameters
• T = unknown
Parameters
method
url
string
options?
Returns
Promise
<T
>
maxRetryCount
maxRetryCount:
number
Defined in: rest/src/types.ts:216
The maximum amount of times a request should be retried. Defaults to Infinity
modifyGuildSoundboardSound()
modifyGuildSoundboardSound: (
guildId
,soundId
,options
,reason
?) =>Promise
<{available
:boolean
;emojiId
:null
|string
;emojiName
:null
|string
;guildId
:string
;name
:string
;soundId
:string
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };volume
:number
; }>
Defined in: rest/src/types.ts:3108
Modify the given soundboard sound.
Parameters
guildId
The guild to create the sounds in
soundId
The sound id to update
options
The options to update the sound
reason?
string
The audit log reason
Returns
Promise
<{ available
: boolean
; emojiId
: null
| string
; emojiName
: null
| string
; guildId
: string
; name
: string
; soundId
: string
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; volume
: number
; }>
Remarks
Fires a Guild Soundboard Sound Update Gateway event.
For sounds created by the current user, requires either the CREATE_GUILD_EXPRESSIONS
or MANAGE_GUILD_EXPRESSIONS
permission.
For other sounds, requires the MANAGE_GUILD_EXPRESSIONS
permission.
patch()
patch: <
T
>(url
,options
?) =>Promise
<Camelize
<T
>>
Defined in: rest/src/types.ts:266
Make a patch request to the api.
Type Parameters
• T = void
Parameters
url
string
options?
Returns
Promise
<Camelize
<T
>>
pinMessage()
pinMessage: (
channelId
,messageId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:2902
Pins a message in a channel.
Parameters
channelId
The ID of the channel where the message is to be pinned.
messageId
The ID of the message to pin.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
Requires that the bot user be able to see the contents of the channel in which the messages were posted.
Requires the MANAGE_MESSAGES
permission.
⚠️ There can only be at max 50 messages pinned in a channel.
Fires a Channel Pins Update event.
See
https://discord.com/developers/docs/resources/channel#pin-message
post()
post: <
T
>(url
,options
?) =>Promise
<Camelize
<T
>>
Defined in: rest/src/types.ts:260
Make a post request to the api.
Type Parameters
• T = void
Parameters
url
string
options?
Returns
Promise
<Camelize
<T
>>
preferSnakeCase()
preferSnakeCase: (
enabled
) =>RestManager
Defined in: rest/src/types.ts:236
Whether or not the rest manager should keep objects in raw snake case from discord.
Parameters
enabled
boolean
Returns
processHeaders()
processHeaders: (
url
,headers
,identifier
) =>undefined
|string
Defined in: rest/src/types.ts:248
Processes the rate limit headers and determines if it needs to be rate limited and returns the bucket id if available
Parameters
url
string
headers
Headers
identifier
string
Returns
undefined
| string
processingRateLimitedPaths
processingRateLimitedPaths:
boolean
Defined in: rest/src/types.ts:220
Whether or not the rate limited paths are being processed to allow requests to be made once time is up. Defaults to false.
processRateLimitedPaths()
processRateLimitedPaths: () =>
void
Defined in: rest/src/types.ts:246
This will create a infinite loop running in 1 seconds using tail recursion to keep rate limits clean. When a rate limit resets, this will remove it so the queue can proceed.
Returns
void
processRequest()
processRequest: (
request
) =>Promise
<void
>
Defined in: rest/src/types.ts:256
Takes a request and processes it into a queue.
Parameters
request
Returns
Promise
<void
>
pruneMembers()
pruneMembers: (
guildId
,options
,reason
?) =>Promise
<{pruned
:null
|number
; }>
Defined in: rest/src/types.ts:2923
Initiates the process of pruning inactive members.
Parameters
guildId
The ID of the guild to prune the members of.
options
The parameters for the pruning of members.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ pruned
: null
| number
; }>
A number indicating how many members were pruned.
Remarks
Requires the MANAGE_GUILD
and KICK_MEMBERS
permissions.
❗ Requests to this endpoint will time out for large guilds. To prevent this from happening, set the BeginGuildPrune.computePruneCount property of the options object parameter to false
. This will begin the process of pruning, and immediately return undefined
, rather than wait for the process to complete before returning the actual count of members that have been kicked.
⚠️ By default, this process will not remove members with a role. To include the members who have a particular subset of roles, specify the role(s) in the includeRoles property of the options object parameter.
Fires a Guild Member Remove gateway event for every member kicked.
See
https://discord.com/developers/docs/resources/guild#begin-guild-prune
publishMessage()
publishMessage: (
channelId
,messageId
) =>Promise
<{activity
: {partyId
:string
;type
:MessageActivityTypes
; };application
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; };1
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };applicationId
:string
;attachments
:object
[];author
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };call
: {endedTimestamp
:string
;participants
:string
[]; };channelId
:string
;components
: ({components
: ({channelTypes
: ... | ...;customId
:string
;defaultValues
: ... | ...;disabled
: ... | ... | ...;maxValues
: ... | ...;minValues
: ... | ...;options
: ... | ...;placeholder
: ... | ...;type
: ... | ... | ... | ... | ...; } | {customId
: ... | ...;disabled
: ... | ... | ...;emoji
: ... | ...;label
: ... | ...;skuId
: ... | ...;style
:ButtonStyles
;type
:Button
;url
: ... | ...; } | {customId
:string
;label
:string
;maxLength
: ... | ...;minLength
: ... | ...;placeholder
: ... | ...;required
: ... | ... | ...;style
:TextStyles
;type
:InputText
;value
: ... | ...; })[];type
:ActionRow
; } | {channelTypes
:ChannelTypes
[];customId
:string
;defaultValues
:object
[];disabled
:boolean
;maxValues
:number
;minValues
:number
;options
:object
[];placeholder
:string
;type
:SelectMenu
|SelectMenuUsers
|SelectMenuRoles
|SelectMenuUsersAndRoles
|SelectMenuChannels
; } | {customId
:string
;disabled
:boolean
;emoji
: {animated
:boolean
;id
:string
;name
:string
; };label
:string
;skuId
:string
;style
:ButtonStyles
;type
:Button
;url
:string
; } | {customId
:string
;label
:string
;maxLength
:number
;minLength
:number
;placeholder
:string
;required
:boolean
;style
:TextStyles
;type
:InputText
;value
:string
; })[];content
:string
;editedTimestamp
:null
|string
;embeds
:object
[];flags
:MessageFlags
;guildId
:string
;id
:string
;interaction
: {id
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
: ...;skuId
: ...; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };name
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };interactionMetadata
: {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;targetMessageId
:string
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;interactedMessageId
:string
;originalResponseMessageId
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mentionChannels
:object
[];mentionEveryone
:boolean
;mentionRoles
:string
[];mentions
:object
[];messageReference
: {channelId
:string
;failIfNotExists
:boolean
;guildId
:string
;messageId
:string
;type
:DiscordMessageReferenceType
; };messageSnapshots
:object
[];nonce
:string
|number
;pinned
:boolean
;poll
: {allowMultiselect
:boolean
;answers
:object
[];expiry
:null
|string
;layoutType
:Default
;question
: {emoji
: {animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
: ... | ...;avatar
: ... | ...;avatarDecorationData
: ... | ...;banner
: ... | ...;bot
: ... | ... | ...;discriminator
:string
;flags
: ... | ...;globalName
: ... | ...;id
:string
;locale
: ... | ...;mfaEnabled
: ... | ... | ...;premiumType
: ... | ...;publicFlags
: ... | ...;system
: ... | ... | ...;username
:string
;verified
: ... | ... | ...; }; };text
:string
; };results
: {answerCounts
:object
[];isFinalized
:boolean
; }; };position
:number
;reactions
:object
[];referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...;stickerItems
:object
[];stickers
:object
[];thread
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };timestamp
:string
;tts
:boolean
;type
:MessageTypes
;webhookId
:string
; }>
Defined in: rest/src/types.ts:2489
Cross-posts a message posted in an announcement channel to subscribed channels.
Parameters
channelId
The ID of the announcement channel.
messageId
The ID of the message to cross-post.
Returns
Promise
<{ activity
: { partyId
: string
; type
: MessageActivityTypes
; }; application
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; 1
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; applicationId
: string
; attachments
: object
[]; author
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; call
: { endedTimestamp
: string
; participants
: string
[]; }; channelId
: string
; components
: ({ components
: ({ channelTypes
: ... | ...; customId
: string
; defaultValues
: ... | ...; disabled
: ... | ... | ...; maxValues
: ... | ...; minValues
: ... | ...; options
: ... | ...; placeholder
: ... | ...; type
: ... | ... | ... | ... | ...; } | { customId
: ... | ...; disabled
: ... | ... | ...; emoji
: ... | ...; label
: ... | ...; skuId
: ... | ...; style
: ButtonStyles
; type
: Button
; url
: ... | ...; } | { customId
: string
; label
: string
; maxLength
: ... | ...; minLength
: ... | ...; placeholder
: ... | ...; required
: ... | ... | ...; style
: TextStyles
; type
: InputText
; value
: ... | ...; })[]; type
: ActionRow
; } | { channelTypes
: ChannelTypes
[]; customId
: string
; defaultValues
: object
[]; disabled
: boolean
; maxValues
: number
; minValues
: number
; options
: object
[]; placeholder
: string
; type
: SelectMenu
| SelectMenuUsers
| SelectMenuRoles
| SelectMenuUsersAndRoles
| SelectMenuChannels
; } | { customId
: string
; disabled
: boolean
; emoji
: { animated
: boolean
; id
: string
; name
: string
; }; label
: string
; skuId
: string
; style
: ButtonStyles
; type
: Button
; url
: string
; } | { customId
: string
; label
: string
; maxLength
: number
; minLength
: number
; placeholder
: string
; required
: boolean
; style
: TextStyles
; type
: InputText
; value
: string
; })[]; content
: string
; editedTimestamp
: null
| string
; embeds
: object
[]; flags
: MessageFlags
; guildId
: string
; id
: string
; interaction
: { id
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: ...; skuId
: ...; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; name
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; interactionMetadata
: { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; targetMessageId
: string
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; interactedMessageId
: string
; originalResponseMessageId
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mentionChannels
: object
[]; mentionEveryone
: boolean
; mentionRoles
: string
[]; mentions
: object
[]; messageReference
: { channelId
: string
; failIfNotExists
: boolean
; guildId
: string
; messageId
: string
; type
: DiscordMessageReferenceType
; }; messageSnapshots
: object
[]; nonce
: string
| number
; pinned
: boolean
; poll
: { allowMultiselect
: boolean
; answers
: object
[]; expiry
: null
| string
; layoutType
: Default
; question
: { emoji
: { animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: ... | ...; avatar
: ... | ...; avatarDecorationData
: ... | ...; banner
: ... | ...; bot
: ... | ... | ...; discriminator
: string
; email
: ... | ... | ...; flags
: ... | ...; globalName
: ... | ...; id
: string
; locale
: ... | ...; mfaEnabled
: ... | ... | ...; premiumType
: ... | ...; publicFlags
: ... | ...; system
: ... | ... | ...; username
: string
; verified
: ... | ... | ...; }; }; text
: string
; }; results
: { answerCounts
: object
[]; isFinalized
: boolean
; }; }; position
: number
; reactions
: object
[]; referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...; stickerItems
: object
[]; stickers
: object
[]; thread
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; timestamp
: string
; tts
: boolean
; type
: MessageTypes
; webhookId
: string
; }>
An instance of the cross-posted DiscordMessage.
Remarks
Requires the SEND_MESSAGES
permission.
If not cross-posting own message:
- Requires the
MANAGE_MESSAGES
permission.
Fires a Message Create event in the guilds the subscribed channels are in.
See
https://discord.com/developers/docs/resources/channel#crosspost-message
put()
put: <
T
>(url
,options
?) =>Promise
<Camelize
<T
>>
Defined in: rest/src/types.ts:262
Make a put request to the api.
Type Parameters
• T = void
Parameters
url
string
options?
Returns
Promise
<Camelize
<T
>>
queues
queues:
Map
<string
,Queue
>
Defined in: rest/src/types.ts:224
The queues that hold all the requests to be processed.
rateLimitedPaths
rateLimitedPaths:
Map
<string
,RestRateLimitedPath
>
Defined in: rest/src/types.ts:226
The paths that are currently rate limited.
removeDmRecipient()
removeDmRecipient: (
channelId
,userId
) =>Promise
<void
>
Defined in: rest/src/types.ts:2531
Removes a member from a Group DM.
Parameters
channelId
The ID of the channel to remove the recipient user of.
userId
The user ID of the user to remove.
Returns
Promise
<void
>
See
https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient
removeRole()
removeRole: (
guildId
,userId
,roleId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:2505
Removes a role from a member.
Parameters
guildId
The ID of the guild the member to remove the role from is in.
userId
The user ID of the member to remove the role from.
roleId
The ID of the role to remove from the member.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
Requires the MANAGE_ROLES
permission.
Fires a Guild Member Update gateway event.
See
https://discord.com/developers/docs/resources/guild#remove-guild-member-role
removeThreadMember()
removeThreadMember: (
channelId
,userId
) =>Promise
<void
>
Defined in: rest/src/types.ts:2522
Removes a member from a thread.
Parameters
channelId
The ID of the thread to remove the thread member of.
userId
The user ID of the thread member to remove.
Returns
Promise
<void
>
Remarks
If the thread is of type ChannelTypes.GuildPrivateThread, requires to be the creator of the thread.
Otherwise, requires the MANAGE_THREADS
permission.
Requires the thread not be archived.
Fires a Thread Members Update gateway event.
See
https://discord.com/developers/docs/resources/channel#remove-thread-member
revokeToken()
revokeToken: (
clientId
,clientSecret
,options
) =>Promise
<void
>
Defined in: rest/src/types.ts:1599
Revoke an access_token
Parameters
clientId
Application's client id
clientSecret
string
application's client secret
options
The options to revoke the access_token
token
string
tokenTypeHint
"access_token"
| "refresh_token"
Returns
Promise
<void
>
routes
routes:
RestRoutes
Defined in: rest/src/types.ts:230
The routes that are available for this manager.
searchMembers()
searchMembers: (
guildId
,query
,options
?) =>Promise
<object
[]>
Defined in: rest/src/types.ts:2935
Gets the list of members whose usernames or nicknames start with a provided string.
Parameters
guildId
The ID of the guild to search in.
query
string
The string to match usernames or nicknames against.
options?
Omit
<SearchMembers
, "query"
>
The parameters for searching through the members.
Returns
Promise
<object
[]>
A collection of DiscordMember objects assorted by user ID.
See
https://discord.com/developers/docs/resources/guild#search-guild-members
sendFollowupMessage()
sendFollowupMessage: (
token
,options
) =>Promise
<{activity
: {partyId
:string
;type
:MessageActivityTypes
; };application
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; };1
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };applicationId
:string
;attachments
:object
[];author
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };call
: {endedTimestamp
:string
;participants
:string
[]; };channelId
:string
;components
: ({components
: ({channelTypes
: ... | ...;customId
:string
;defaultValues
: ... | ...;disabled
: ... | ... | ...;maxValues
: ... | ...;minValues
: ... | ...;options
: ... | ...;placeholder
: ... | ...;type
: ... | ... | ... | ... | ...; } | {customId
: ... | ...;disabled
: ... | ... | ...;emoji
: ... | ...;label
: ... | ...;skuId
: ... | ...;style
:ButtonStyles
;type
:Button
;url
: ... | ...; } | {customId
:string
;label
:string
;maxLength
: ... | ...;minLength
: ... | ...;placeholder
: ... | ...;required
: ... | ... | ...;style
:TextStyles
;type
:InputText
;value
: ... | ...; })[];type
:ActionRow
; } | {channelTypes
:ChannelTypes
[];customId
:string
;defaultValues
:object
[];disabled
:boolean
;maxValues
:number
;minValues
:number
;options
:object
[];placeholder
:string
;type
:SelectMenu
|SelectMenuUsers
|SelectMenuRoles
|SelectMenuUsersAndRoles
|SelectMenuChannels
; } | {customId
:string
;disabled
:boolean
;emoji
: {animated
:boolean
;id
:string
;name
:string
; };label
:string
;skuId
:string
;style
:ButtonStyles
;type
:Button
;url
:string
; } | {customId
:string
;label
:string
;maxLength
:number
;minLength
:number
;placeholder
:string
;required
:boolean
;style
:TextStyles
;type
:InputText
;value
:string
; })[];content
:string
;editedTimestamp
:null
|string
;embeds
:object
[];flags
:MessageFlags
;guildId
:string
;id
:string
;interaction
: {id
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
: ...;skuId
: ...; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };name
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };interactionMetadata
: {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;targetMessageId
:string
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;interactedMessageId
:string
;originalResponseMessageId
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mentionChannels
:object
[];mentionEveryone
:boolean
;mentionRoles
:string
[];mentions
:object
[];messageReference
: {channelId
:string
;failIfNotExists
:boolean
;guildId
:string
;messageId
:string
;type
:DiscordMessageReferenceType
; };messageSnapshots
:object
[];nonce
:string
|number
;pinned
:boolean
;poll
: {allowMultiselect
:boolean
;answers
:object
[];expiry
:null
|string
;layoutType
:Default
;question
: {emoji
: {animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
: ... | ...;avatar
: ... | ...;avatarDecorationData
: ... | ...;banner
: ... | ...;bot
: ... | ... | ...;discriminator
:string
;flags
: ... | ...;globalName
: ... | ...;id
:string
;locale
: ... | ...;mfaEnabled
: ... | ... | ...;premiumType
: ... | ...;publicFlags
: ... | ...;system
: ... | ... | ...;username
:string
;verified
: ... | ... | ...; }; };text
:string
; };results
: {answerCounts
:object
[];isFinalized
:boolean
; }; };position
:number
;reactions
:object
[];referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...;stickerItems
:object
[];stickers
:object
[];thread
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };timestamp
:string
;tts
:boolean
;type
:MessageTypes
;webhookId
:string
; }>
Defined in: rest/src/types.ts:2582
Sends a follow-up message to an interaction.
Parameters
token
string
The interaction token to use, provided in the original interaction.
options
The parameters for the creation of the message.
Returns
Promise
<{ activity
: { partyId
: string
; type
: MessageActivityTypes
; }; application
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; 1
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; applicationId
: string
; attachments
: object
[]; author
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; call
: { endedTimestamp
: string
; participants
: string
[]; }; channelId
: string
; components
: ({ components
: ({ channelTypes
: ... | ...; customId
: string
; defaultValues
: ... | ...; disabled
: ... | ... | ...; maxValues
: ... | ...; minValues
: ... | ...; options
: ... | ...; placeholder
: ... | ...; type
: ... | ... | ... | ... | ...; } | { customId
: ... | ...; disabled
: ... | ... | ...; emoji
: ... | ...; label
: ... | ...; skuId
: ... | ...; style
: ButtonStyles
; type
: Button
; url
: ... | ...; } | { customId
: string
; label
: string
; maxLength
: ... | ...; minLength
: ... | ...; placeholder
: ... | ...; required
: ... | ... | ...; style
: TextStyles
; type
: InputText
; value
: ... | ...; })[]; type
: ActionRow
; } | { channelTypes
: ChannelTypes
[]; customId
: string
; defaultValues
: object
[]; disabled
: boolean
; maxValues
: number
; minValues
: number
; options
: object
[]; placeholder
: string
; type
: SelectMenu
| SelectMenuUsers
| SelectMenuRoles
| SelectMenuUsersAndRoles
| SelectMenuChannels
; } | { customId
: string
; disabled
: boolean
; emoji
: { animated
: boolean
; id
: string
; name
: string
; }; label
: string
; skuId
: string
; style
: ButtonStyles
; type
: Button
; url
: string
; } | { customId
: string
; label
: string
; maxLength
: number
; minLength
: number
; placeholder
: string
; required
: boolean
; style
: TextStyles
; type
: InputText
; value
: string
; })[]; content
: string
; editedTimestamp
: null
| string
; embeds
: object
[]; flags
: MessageFlags
; guildId
: string
; id
: string
; interaction
: { id
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: ...; skuId
: ...; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; name
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; interactionMetadata
: { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; targetMessageId
: string
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; interactedMessageId
: string
; originalResponseMessageId
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mentionChannels
: object
[]; mentionEveryone
: boolean
; mentionRoles
: string
[]; mentions
: object
[]; messageReference
: { channelId
: string
; failIfNotExists
: boolean
; guildId
: string
; messageId
: string
; type
: DiscordMessageReferenceType
; }; messageSnapshots
: object
[]; nonce
: string
| number
; pinned
: boolean
; poll
: { allowMultiselect
: boolean
; answers
: object
[]; expiry
: null
| string
; layoutType
: Default
; question
: { emoji
: { animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: ... | ...; avatar
: ... | ...; avatarDecorationData
: ... | ...; banner
: ... | ...; bot
: ... | ... | ...; discriminator
: string
; email
: ... | ... | ...; flags
: ... | ...; globalName
: ... | ...; id
: string
; locale
: ... | ...; mfaEnabled
: ... | ... | ...; premiumType
: ... | ...; publicFlags
: ... | ...; system
: ... | ... | ...; username
: string
; verified
: ... | ... | ...; }; }; text
: string
; }; results
: { answerCounts
: object
[]; isFinalized
: boolean
; }; }; position
: number
; reactions
: object
[]; referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...; stickerItems
: object
[]; stickers
: object
[]; thread
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; timestamp
: string
; tts
: boolean
; type
: MessageTypes
; webhookId
: string
; }>
An instance of the created DiscordMessage.
Remarks
⚠️ Interaction tokens are only valid for 15 minutes.
By default, mentions are suppressed. To enable mentions, pass a mention object with the callback data.
Unlike sendMessage()
, this endpoint allows the bot user to act without:
- Needing to be able to see the contents of the channel that the message is in. (
READ_MESSAGES
permission.) - Requiring the
MESSAGE_CONTENT
intent.
Apps are limited to 5 followup messages per interaction if it was initiated from a user-installed app and isn't installed in the server You can check if it was initiated from a user-installed app that isn't installed in the server by checking if DiscordInteraction.authorizing_integration_owners | authorizingIntegrationOwners only contains DiscordApplicationIntegrationType.UserInstall | UserInstall.
Fires a Message Create event.
See
https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message
sendInteractionResponse()
sendInteractionResponse: (
interactionId
,token
,options
,params
?) =>Promise
<void
| {interaction
: {activityInstanceId
:string
;id
:string
;responseMessageEphemeral
:boolean
;responseMessageId
:string
;responseMessageLoading
:boolean
;type
:InteractionTypes
; };resource
: {activityInstance
: {id
:string
; };message
: {activity
: {partyId
: ... | ...;type
:MessageActivityTypes
; };application
: {approximateGuildCount
: ... | ...;approximateUserInstallCount
: ... | ...;bot
: ... | ...;botPublic
: ... | ... | ...;botRequireCodeGrant
: ... | ... | ...;coverImage
: ... | ...;customInstallUrl
: ... | ...;description
: ... | ...;eventWebhooksStatus
: ... | ...;eventWebhooksTypes
: ... | ...;eventWebhooksUrl
: ... | ... | ...;flags
: ... | ...;guild
: ... | ...;guildId
: ... | ...;icon
: ... | ... | ...;id
: ... | ...;installParams
: ... | ...;integrationTypesConfig
: ... | ...;interactionsEndpointUrl
: ... | ... | ...;name
: ... | ...;owner
: ... | ...;primarySkuId
: ... | ...;privacyPolicyUrl
: ... | ...;redirectUris
: ... | ...;roleConnectionsVerificationUrl
: ... | ... | ...;rpcOrigins
: ... | ...;slug
: ... | ...;tags
: ... | ...;team
: ... | ... | ...;termsOfServiceUrl
: ... | ...;verifyKey
: ... | ...; };applicationId
:string
;attachments
:object
[];author
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
: ...;skuId
: ...; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };call
: {endedTimestamp
:string
;participants
: ...[]; };channelId
:string
;components
: (... | ... | ... | ...)[];content
:string
;editedTimestamp
:null
|string
;embeds
:object
[];flags
:MessageFlags
;guildId
:string
;id
:string
;interaction
: {id
:string
;member
: ... | ...;name
:string
;type
:InteractionTypes
;user
: {accentColor
: ...;avatar
: ...;avatarDecorationData
: ...;banner
: ...;bot
: ...;discriminator
: ...;flags
: ...;globalName
: ...;id
: ...;locale
: ...;mfaEnabled
: ...;premiumType
: ...;publicFlags
: ...;system
: ...;username
: ...;verified
: ...; }; };interactionMetadata
: {authorizingIntegrationOwners
: {0
: ...;1
: ...; };id
:string
;originalResponseMessageId
: ... | ...;targetMessageId
: ... | ...;targetUser
: ... | ...;type
:InteractionTypes
;user
: {accentColor
: ...;avatar
: ...;avatarDecorationData
: ...;banner
: ...;bot
: ...;discriminator
: ...;flags
: ...;globalName
: ...;id
: ...;locale
: ...;mfaEnabled
: ...;premiumType
: ...;publicFlags
: ...;system
: ...;username
: ...;verified
: ...; }; } | {authorizingIntegrationOwners
: {0
: ...;1
: ...; };id
:string
;interactedMessageId
: ... | ...;originalResponseMessageId
: ... | ...;type
:InteractionTypes
;user
: {accentColor
: ...;avatar
: ...;avatarDecorationData
: ...;banner
: ...;bot
: ...;discriminator
: ...;flags
: ...;globalName
: ...;id
: ...;locale
: ...;mfaEnabled
: ...;premiumType
: ...;publicFlags
: ...;system
: ...;username
: ...;verified
: ...; }; } | {authorizingIntegrationOwners
: {0
: ...;1
: ...; };id
:string
;originalResponseMessageId
: ... | ...;triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...;type
:InteractionTypes
;user
: {accentColor
: ...;avatar
: ...;avatarDecorationData
: ...;banner
: ...;bot
: ...;discriminator
: ...;flags
: ...;globalName
: ...;id
: ...;locale
: ...;mfaEnabled
: ...;premiumType
: ...;publicFlags
: ...;system
: ...;username
: ...;verified
: ...; }; };member
: {avatar
: ... | ...;avatarDecorationData
: ... | ... | ...;banner
: ... | ...;communicationDisabledUntil
: ... | ... | ...;deaf
: ... | ... | ...;flags
:number
;joinedAt
:string
;mute
: ... | ... | ...;nick
: ... | ... | ...;pending
: ... | ... | ...;permissions
: ... | ...;premiumSince
: ... | ... | ...;roles
: ...[];user
: ... | ...; };mentionChannels
:object
[];mentionEveryone
:boolean
;mentionRoles
:string
[];mentions
:object
[];messageReference
: {channelId
: ... | ...;failIfNotExists
:boolean
;guildId
: ... | ...;messageId
: ... | ...;type
: ... | ...; };messageSnapshots
:object
[];nonce
:string
|number
;pinned
:boolean
;poll
: {allowMultiselect
:boolean
;answers
: ...[];expiry
: ... | ...;layoutType
:Default
;question
: {emoji
: ...;text
: ...; };results
: ... | ...; };position
:number
;reactions
:object
[];referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...;stickerItems
:object
[];stickers
:object
[];thread
: {applicationId
: ... | ...;appliedTags
: ... | ...;availableTags
: ... | ...;bitrate
: ... | ...;defaultAutoArchiveDuration
: ... | ...;defaultForumLayout
: ... | ...;defaultReactionEmoji
: ... | ... | ...;defaultSortOrder
: ... | ... | ...;defaultThreadRateLimitPerUser
: ... | ...;flags
: ... | ...;guildId
: ... | ...;icon
: ... | ...;id
:string
;lastMessageId
: ... | ... | ...;lastPinTimestamp
: ... | ... | ...;managed
: ... | ... | ...;member
: {flags
: ...;id
: ...;joinTimestamp
: ...;userId
: ...; };memberCount
: ... | ...;messageCount
: ... | ...;name
: ... | ...;newlyCreated
: ... | ... | ...;nsfw
: ... | ... | ...;ownerId
: ... | ...;parentId
: ... | ... | ...;permissionOverwrites
: ... | ...;permissions
: ... | ...;position
: ... | ...;rateLimitPerUser
: ... | ...;recipients
: ... | ...;rtcRegion
: ... | ... | ...;threadMetadata
: ... | ...;topic
: ... | ... | ...;totalMessageSent
: ... | ...;type
:ChannelTypes
;userLimit
: ... | ...;videoQualityMode
: ... | ...; };timestamp
:string
;tts
:boolean
;type
:MessageTypes
;webhookId
:string
; };type
:InteractionResponseTypes
; }; }>
Defined in: rest/src/types.ts:2605
Sends a response to an interaction.
Parameters
interactionId
The ID of the interaction to respond to.
token
string
The interaction token to use, provided in the original interaction.
options
The parameters for the creation of the message.
params?
The query parameters for the response of the callback
Returns
Promise
<void
| { interaction
: { activityInstanceId
: string
; id
: string
; responseMessageEphemeral
: boolean
; responseMessageId
: string
; responseMessageLoading
: boolean
; type
: InteractionTypes
; }; resource
: { activityInstance
: { id
: string
; }; message
: { activity
: { partyId
: ... | ...; type
: MessageActivityTypes
; }; application
: { approximateGuildCount
: ... | ...; approximateUserInstallCount
: ... | ...; bot
: ... | ...; botPublic
: ... | ... | ...; botRequireCodeGrant
: ... | ... | ...; coverImage
: ... | ...; customInstallUrl
: ... | ...; description
: ... | ...; eventWebhooksStatus
: ... | ...; eventWebhooksTypes
: ... | ...; eventWebhooksUrl
: ... | ... | ...; flags
: ... | ...; guild
: ... | ...; guildId
: ... | ...; icon
: ... | ... | ...; id
: ... | ...; installParams
: ... | ...; integrationTypesConfig
: ... | ...; interactionsEndpointUrl
: ... | ... | ...; name
: ... | ...; owner
: ... | ...; primarySkuId
: ... | ...; privacyPolicyUrl
: ... | ...; redirectUris
: ... | ...; roleConnectionsVerificationUrl
: ... | ... | ...; rpcOrigins
: ... | ...; slug
: ... | ...; tags
: ... | ...; team
: ... | ... | ...; termsOfServiceUrl
: ... | ...; verifyKey
: ... | ...; }; applicationId
: string
; attachments
: object
[]; author
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: ...; skuId
: ...; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; call
: { endedTimestamp
: string
; participants
: ...[]; }; channelId
: string
; components
: (... | ... | ... | ...)[]; content
: string
; editedTimestamp
: null
| string
; embeds
: object
[]; flags
: MessageFlags
; guildId
: string
; id
: string
; interaction
: { id
: string
; member
: ... | ...; name
: string
; type
: InteractionTypes
; user
: { accentColor
: ...; avatar
: ...; avatarDecorationData
: ...; banner
: ...; bot
: ...; discriminator
: ...; email
: ...; flags
: ...; globalName
: ...; id
: ...; locale
: ...; mfaEnabled
: ...; premiumType
: ...; publicFlags
: ...; system
: ...; username
: ...; verified
: ...; }; }; interactionMetadata
: { authorizingIntegrationOwners
: { 0
: ...; 1
: ...; }; id
: string
; originalResponseMessageId
: ... | ...; targetMessageId
: ... | ...; targetUser
: ... | ...; type
: InteractionTypes
; user
: { accentColor
: ...; avatar
: ...; avatarDecorationData
: ...; banner
: ...; bot
: ...; discriminator
: ...; email
: ...; flags
: ...; globalName
: ...; id
: ...; locale
: ...; mfaEnabled
: ...; premiumType
: ...; publicFlags
: ...; system
: ...; username
: ...; verified
: ...; }; } | { authorizingIntegrationOwners
: { 0
: ...; 1
: ...; }; id
: string
; interactedMessageId
: ... | ...; originalResponseMessageId
: ... | ...; type
: InteractionTypes
; user
: { accentColor
: ...; avatar
: ...; avatarDecorationData
: ...; banner
: ...; bot
: ...; discriminator
: ...; email
: ...; flags
: ...; globalName
: ...; id
: ...; locale
: ...; mfaEnabled
: ...; premiumType
: ...; publicFlags
: ...; system
: ...; username
: ...; verified
: ...; }; } | { authorizingIntegrationOwners
: { 0
: ...; 1
: ...; }; id
: string
; originalResponseMessageId
: ... | ...; triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...; type
: InteractionTypes
; user
: { accentColor
: ...; avatar
: ...; avatarDecorationData
: ...; banner
: ...; bot
: ...; discriminator
: ...; email
: ...; flags
: ...; globalName
: ...; id
: ...; locale
: ...; mfaEnabled
: ...; premiumType
: ...; publicFlags
: ...; system
: ...; username
: ...; verified
: ...; }; }; member
: { avatar
: ... | ...; avatarDecorationData
: ... | ... | ...; banner
: ... | ...; communicationDisabledUntil
: ... | ... | ...; deaf
: ... | ... | ...; flags
: number
; joinedAt
: string
; mute
: ... | ... | ...; nick
: ... | ... | ...; pending
: ... | ... | ...; permissions
: ... | ...; premiumSince
: ... | ... | ...; roles
: ...[]; user
: ... | ...; }; mentionChannels
: object
[]; mentionEveryone
: boolean
; mentionRoles
: string
[]; mentions
: object
[]; messageReference
: { channelId
: ... | ...; failIfNotExists
: boolean
; guildId
: ... | ...; messageId
: ... | ...; type
: ... | ...; }; messageSnapshots
: object
[]; nonce
: string
| number
; pinned
: boolean
; poll
: { allowMultiselect
: boolean
; answers
: ...[]; expiry
: ... | ...; layoutType
: Default
; question
: { emoji
: ...; text
: ...; }; results
: ... | ...; }; position
: number
; reactions
: object
[]; referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...; stickerItems
: object
[]; stickers
: object
[]; thread
: { applicationId
: ... | ...; appliedTags
: ... | ...; availableTags
: ... | ...; bitrate
: ... | ...; defaultAutoArchiveDuration
: ... | ...; defaultForumLayout
: ... | ...; defaultReactionEmoji
: ... | ... | ...; defaultSortOrder
: ... | ... | ...; defaultThreadRateLimitPerUser
: ... | ...; flags
: ... | ...; guildId
: ... | ...; icon
: ... | ...; id
: string
; lastMessageId
: ... | ... | ...; lastPinTimestamp
: ... | ... | ...; managed
: ... | ... | ...; member
: { flags
: ...; id
: ...; joinTimestamp
: ...; userId
: ...; }; memberCount
: ... | ...; messageCount
: ... | ...; name
: ... | ...; newlyCreated
: ... | ... | ...; nsfw
: ... | ... | ...; ownerId
: ... | ...; parentId
: ... | ... | ...; permissionOverwrites
: ... | ...; permissions
: ... | ...; position
: ... | ...; rateLimitPerUser
: ... | ...; recipients
: ... | ...; rtcRegion
: ... | ... | ...; threadMetadata
: ... | ...; topic
: ... | ... | ...; totalMessageSent
: ... | ...; type
: ChannelTypes
; userLimit
: ... | ...; videoQualityMode
: ... | ...; }; timestamp
: string
; tts
: boolean
; type
: MessageTypes
; webhookId
: string
; }; type
: InteractionResponseTypes
; }; }>
Nothing or the DiscordInteractionCallbackResponse if withResponse param is true
Remarks
⚠️ Interaction tokens are only valid for 15 minutes.
By default, mentions are suppressed. To enable mentions, pass a mention object with the callback data.
Unlike sendMessage()
, this endpoint allows the bot user to act without:
- Needing to be able to see the contents of the channel that the message is in. (
READ_MESSAGES
permission.) - Requiring the
MESSAGE_CONTENT
intent.
Fires a Message Create event.
See
sendMessage()
sendMessage: (
channelId
,options
) =>Promise
<{activity
: {partyId
:string
;type
:MessageActivityTypes
; };application
: {approximateGuildCount
:number
;approximateUserInstallCount
:number
;bot
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };botPublic
:boolean
;botRequireCodeGrant
:boolean
;coverImage
:string
;customInstallUrl
:string
;description
:string
;eventWebhooksStatus
:DiscordApplicationEventWebhookStatus
;eventWebhooksTypes
:DiscordWebhookEventType
[];eventWebhooksUrl
:null
|string
;flags
:ApplicationFlags
;guild
: {afkChannelId
:null
|string
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|string
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };guildId
:string
;icon
:null
|string
;id
:string
;installParams
: {permissions
:string
;scopes
:OAuth2Scope
[]; };integrationTypesConfig
: {0
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; };1
: {oauth2InstallParams
: {permissions
: ...;scopes
: ...; }; }; };interactionsEndpointUrl
:null
|string
;name
:string
;owner
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };primarySkuId
:string
;privacyPolicyUrl
:string
;redirectUris
:string
[];roleConnectionsVerificationUrl
:null
|string
;rpcOrigins
:string
[];slug
:string
;tags
:string
[];team
:null
| {icon
:null
|string
;id
:string
;members
:object
[];name
:string
;ownerUserId
:string
; };termsOfServiceUrl
:string
;verifyKey
:string
; };applicationId
:string
;attachments
:object
[];author
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };call
: {endedTimestamp
:string
;participants
:string
[]; };channelId
:string
;components
: ({components
: ({channelTypes
: ... | ...;customId
:string
;defaultValues
: ... | ...;disabled
: ... | ... | ...;maxValues
: ... | ...;minValues
: ... | ...;options
: ... | ...;placeholder
: ... | ...;type
: ... | ... | ... | ... | ...; } | {customId
: ... | ...;disabled
: ... | ... | ...;emoji
: ... | ...;label
: ... | ...;skuId
: ... | ...;style
:ButtonStyles
;type
:Button
;url
: ... | ...; } | {customId
:string
;label
:string
;maxLength
: ... | ...;minLength
: ... | ...;placeholder
: ... | ...;required
: ... | ... | ...;style
:TextStyles
;type
:InputText
;value
: ... | ...; })[];type
:ActionRow
; } | {channelTypes
:ChannelTypes
[];customId
:string
;defaultValues
:object
[];disabled
:boolean
;maxValues
:number
;minValues
:number
;options
:object
[];placeholder
:string
;type
:SelectMenu
|SelectMenuUsers
|SelectMenuRoles
|SelectMenuUsersAndRoles
|SelectMenuChannels
; } | {customId
:string
;disabled
:boolean
;emoji
: {animated
:boolean
;id
:string
;name
:string
; };label
:string
;skuId
:string
;style
:ButtonStyles
;type
:Button
;url
:string
; } | {customId
:string
;label
:string
;maxLength
:number
;minLength
:number
;placeholder
:string
;required
:boolean
;style
:TextStyles
;type
:InputText
;value
:string
; })[];content
:string
;editedTimestamp
:null
|string
;embeds
:object
[];flags
:MessageFlags
;guildId
:string
;id
:string
;interaction
: {id
:string
;member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
: ...;skuId
: ...; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };name
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };interactionMetadata
: {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;targetMessageId
:string
;targetUser
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;interactedMessageId
:string
;originalResponseMessageId
:string
;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; } | {authorizingIntegrationOwners
: {0
:string
;1
:string
; };id
:string
;originalResponseMessageId
:string
;triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...;type
:InteractionTypes
;user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };member
: {avatar
:string
;avatarDecorationData
:null
| {asset
:string
;skuId
:string
; };banner
:string
;communicationDisabledUntil
:null
|string
;deaf
:boolean
;flags
:number
;joinedAt
:string
;mute
:boolean
;nick
:null
|string
;pending
:boolean
;permissions
:string
;premiumSince
:null
|string
;roles
:string
[];user
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; }; };mentionChannels
:object
[];mentionEveryone
:boolean
;mentionRoles
:string
[];mentions
:object
[];messageReference
: {channelId
:string
;failIfNotExists
:boolean
;guildId
:string
;messageId
:string
;type
:DiscordMessageReferenceType
; };messageSnapshots
:object
[];nonce
:string
|number
;pinned
:boolean
;poll
: {allowMultiselect
:boolean
;answers
:object
[];expiry
:null
|string
;layoutType
:Default
;question
: {emoji
: {animated
:boolean
;available
:boolean
;id
:string
;managed
:boolean
;name
:string
;requireColons
:boolean
;roles
:string
[];user
: {accentColor
: ... | ...;avatar
: ... | ...;avatarDecorationData
: ... | ...;banner
: ... | ...;bot
: ... | ... | ...;discriminator
:string
;flags
: ... | ...;globalName
: ... | ...;id
:string
;locale
: ... | ...;mfaEnabled
: ... | ... | ...;premiumType
: ... | ...;publicFlags
: ... | ...;system
: ... | ... | ...;username
:string
;verified
: ... | ... | ...; }; };text
:string
; };results
: {answerCounts
:object
[];isFinalized
:boolean
; }; };position
:number
;reactions
:object
[];referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...;stickerItems
:object
[];stickers
:object
[];thread
: {applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; };timestamp
:string
;tts
:boolean
;type
:MessageTypes
;webhookId
:string
; }>
Defined in: rest/src/types.ts:2558
Sends a message to a channel.
Parameters
channelId
The ID of the channel to send the message in.
options
The parameters for the creation of the message.
Returns
Promise
<{ activity
: { partyId
: string
; type
: MessageActivityTypes
; }; application
: { approximateGuildCount
: number
; approximateUserInstallCount
: number
; bot
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; botPublic
: boolean
; botRequireCodeGrant
: boolean
; coverImage
: string
; customInstallUrl
: string
; description
: string
; eventWebhooksStatus
: DiscordApplicationEventWebhookStatus
; eventWebhooksTypes
: DiscordWebhookEventType
[]; eventWebhooksUrl
: null
| string
; flags
: ApplicationFlags
; guild
: { afkChannelId
: null
| string
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| string
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; guildId
: string
; icon
: null
| string
; id
: string
; installParams
: { permissions
: string
; scopes
: OAuth2Scope
[]; }; integrationTypesConfig
: { 0
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; 1
: { oauth2InstallParams
: { permissions
: ...; scopes
: ...; }; }; }; interactionsEndpointUrl
: null
| string
; name
: string
; owner
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; primarySkuId
: string
; privacyPolicyUrl
: string
; redirectUris
: string
[]; roleConnectionsVerificationUrl
: null
| string
; rpcOrigins
: string
[]; slug
: string
; tags
: string
[]; team
: null
| { icon
: null
| string
; id
: string
; members
: object
[]; name
: string
; ownerUserId
: string
; }; termsOfServiceUrl
: string
; verifyKey
: string
; }; applicationId
: string
; attachments
: object
[]; author
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; call
: { endedTimestamp
: string
; participants
: string
[]; }; channelId
: string
; components
: ({ components
: ({ channelTypes
: ... | ...; customId
: string
; defaultValues
: ... | ...; disabled
: ... | ... | ...; maxValues
: ... | ...; minValues
: ... | ...; options
: ... | ...; placeholder
: ... | ...; type
: ... | ... | ... | ... | ...; } | { customId
: ... | ...; disabled
: ... | ... | ...; emoji
: ... | ...; label
: ... | ...; skuId
: ... | ...; style
: ButtonStyles
; type
: Button
; url
: ... | ...; } | { customId
: string
; label
: string
; maxLength
: ... | ...; minLength
: ... | ...; placeholder
: ... | ...; required
: ... | ... | ...; style
: TextStyles
; type
: InputText
; value
: ... | ...; })[]; type
: ActionRow
; } | { channelTypes
: ChannelTypes
[]; customId
: string
; defaultValues
: object
[]; disabled
: boolean
; maxValues
: number
; minValues
: number
; options
: object
[]; placeholder
: string
; type
: SelectMenu
| SelectMenuUsers
| SelectMenuRoles
| SelectMenuUsersAndRoles
| SelectMenuChannels
; } | { customId
: string
; disabled
: boolean
; emoji
: { animated
: boolean
; id
: string
; name
: string
; }; label
: string
; skuId
: string
; style
: ButtonStyles
; type
: Button
; url
: string
; } | { customId
: string
; label
: string
; maxLength
: number
; minLength
: number
; placeholder
: string
; required
: boolean
; style
: TextStyles
; type
: InputText
; value
: string
; })[]; content
: string
; editedTimestamp
: null
| string
; embeds
: object
[]; flags
: MessageFlags
; guildId
: string
; id
: string
; interaction
: { id
: string
; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: ...; skuId
: ...; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; name
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; interactionMetadata
: { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; targetMessageId
: string
; targetUser
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; interactedMessageId
: string
; originalResponseMessageId
: string
; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; } | { authorizingIntegrationOwners
: { 0
: string
; 1
: string
; }; id
: string
; originalResponseMessageId
: string
; triggeringInteractionMetadata
: { id: string; type: InteractionTypes; user: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; authorizingIntegrationOwners: { ...; }; originalResponseMessageI...; type
: InteractionTypes
; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; member
: { avatar
: string
; avatarDecorationData
: null
| { asset
: string
; skuId
: string
; }; banner
: string
; communicationDisabledUntil
: null
| string
; deaf
: boolean
; flags
: number
; joinedAt
: string
; mute
: boolean
; nick
: null
| string
; pending
: boolean
; permissions
: string
; premiumSince
: null
| string
; roles
: string
[]; user
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; }; mentionChannels
: object
[]; mentionEveryone
: boolean
; mentionRoles
: string
[]; mentions
: object
[]; messageReference
: { channelId
: string
; failIfNotExists
: boolean
; guildId
: string
; messageId
: string
; type
: DiscordMessageReferenceType
; }; messageSnapshots
: object
[]; nonce
: string
| number
; pinned
: boolean
; poll
: { allowMultiselect
: boolean
; answers
: object
[]; expiry
: null
| string
; layoutType
: Default
; question
: { emoji
: { animated
: boolean
; available
: boolean
; id
: string
; managed
: boolean
; name
: string
; requireColons
: boolean
; roles
: string
[]; user
: { accentColor
: ... | ...; avatar
: ... | ...; avatarDecorationData
: ... | ...; banner
: ... | ...; bot
: ... | ... | ...; discriminator
: string
; email
: ... | ... | ...; flags
: ... | ...; globalName
: ... | ...; id
: string
; locale
: ... | ...; mfaEnabled
: ... | ... | ...; premiumType
: ... | ...; publicFlags
: ... | ...; system
: ... | ... | ...; username
: string
; verified
: ... | ... | ...; }; }; text
: string
; }; results
: { answerCounts
: object
[]; isFinalized
: boolean
; }; }; position
: number
; reactions
: object
[]; referencedMessage
: { id: string; channelId: string; guildId?: string | undefined; author: { username: string; globalName: string | null; locale?: string | undefined; flags?: number | undefined; premiumType?: PremiumTypes | undefined; ... 11 more ...; avatarDecorationData?: { ...; } | undefined; }; ... 31 more ...; call?: { ...; } | un...; stickerItems
: object
[]; stickers
: object
[]; thread
: { applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }; timestamp
: string
; tts
: boolean
; type
: MessageTypes
; webhookId
: string
; }>
An instance of the created DiscordMessage.
Remarks
Requires that the bot user be able to see the contents of the channel the message is to be sent in.
If sending a message to a guild channel:
- Requires the
SEND_MESSAGES
permission.
If sending a TTS message:
- Requires the
SEND_TTS_MESSAGES
permission.
If sending a message as a reply to another message:
- Requires the
READ_MESSAGE_HISTORY
permission. - The message being replied to cannot be a system message.
⚠️ The maximum size of a request (accounting for any attachments and message content) for bot users is 8 MiB.
Fires a Message Create gateway event.
See
https://discord.com/developers/docs/resources/channel#create-message
sendRequest()
sendRequest: (
options
) =>Promise
<void
>
Defined in: rest/src/types.ts:250
Sends a request to the api.
Parameters
options
Returns
Promise
<void
>
sendSoundboardSound()
sendSoundboardSound: (
channelId
,options
) =>Promise
<void
>
Defined in: rest/src/types.ts:3059
Send a soundboard sound to a voice channel the user is connected to.
Parameters
channelId
The id of the voice channel
options
Returns
Promise
<void
>
Remarks
Fires a Voice Channel Effect Send Gateway event.
Requires the SPEAK
and USE_SOUNDBOARD
permissions, and also the USE_EXTERNAL_SOUNDS
permission if the sound is from a different server.
Additionally, requires the user to be connected to the voice channel, having a voice state without deaf
, self_deaf
, mute
, or suppress
enabled.
simplifyUrl()
simplifyUrl: (
url
,method
) =>string
Defined in: rest/src/types.ts:252
Split a url to separate rate limit buckets based on major/minor parameters.
Parameters
url
string
method
Returns
string
startThreadWithMessage()
startThreadWithMessage: (
channelId
,messageId
,options
,reason
?) =>Promise
<{applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; }>
Defined in: rest/src/types.ts:2631
Creates a thread, using an existing message as its point of origin.
Parameters
channelId
The ID of the channel in which to create the thread.
messageId
The ID of the message to use as the thread's point of origin.
options
The parameters to use for the creation of the thread.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }>
An instance of the created DiscordChannel.
Remarks
If called on a channel of type ChannelTypes.GuildText, creates a ChannelTypes.GuildPublicThread. If called on a channel of type ChannelTypes.GuildNews, creates a ChannelTypes.GuildNewsThread. Does not work on channels of type ChannelTypes.GuildForum.
The ID of the created thread will be the same as the ID of the source message.
Fires a Thread Create gateway event.
See
https://discord.com/developers/docs/resources/channel#start-thread-from-message
startThreadWithoutMessage()
startThreadWithoutMessage: (
channelId
,options
,reason
?) =>Promise
<{applicationId
:string
;appliedTags
:string
[];availableTags
:object
[];bitrate
:number
;defaultAutoArchiveDuration
:number
;defaultForumLayout
:ForumLayout
;defaultReactionEmoji
:null
| {emojiId
:string
;emojiName
:null
|string
; };defaultSortOrder
:null
|SortOrderTypes
;defaultThreadRateLimitPerUser
:number
;flags
:ChannelFlags
;guildId
:string
;icon
:string
;id
:string
;lastMessageId
:null
|string
;lastPinTimestamp
:null
|string
;managed
:boolean
;member
: {flags
:number
;id
:string
;joinTimestamp
:string
;userId
:string
; };memberCount
:number
;messageCount
:number
;name
:string
;newlyCreated
:boolean
;nsfw
:boolean
;ownerId
:string
;parentId
:null
|string
;permissionOverwrites
:object
[];permissions
:string
;position
:number
;rateLimitPerUser
:number
;recipients
:object
[];rtcRegion
:null
|string
;threadMetadata
: {archived
:boolean
;archiveTimestamp
:string
;autoArchiveDuration
:60
|1440
|4320
|10080
;createTimestamp
:null
|string
;invitable
:boolean
;locked
:boolean
; };topic
:null
|string
;totalMessageSent
:number
;type
:ChannelTypes
;userLimit
:number
;videoQualityMode
:VideoQualityModes
; }>
Defined in: rest/src/types.ts:2652
Creates a thread without using a message as the thread's point of origin.
Parameters
channelId
The ID of the channel in which to create the thread.
options
The parameters to use for the creation of the thread.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<{ applicationId
: string
; appliedTags
: string
[]; availableTags
: object
[]; bitrate
: number
; defaultAutoArchiveDuration
: number
; defaultForumLayout
: ForumLayout
; defaultReactionEmoji
: null
| { emojiId
: string
; emojiName
: null
| string
; }; defaultSortOrder
: null
| SortOrderTypes
; defaultThreadRateLimitPerUser
: number
; flags
: ChannelFlags
; guildId
: string
; icon
: string
; id
: string
; lastMessageId
: null
| string
; lastPinTimestamp
: null
| string
; managed
: boolean
; member
: { flags
: number
; id
: string
; joinTimestamp
: string
; userId
: string
; }; memberCount
: number
; messageCount
: number
; name
: string
; newlyCreated
: boolean
; nsfw
: boolean
; ownerId
: string
; parentId
: null
| string
; permissionOverwrites
: object
[]; permissions
: string
; position
: number
; rateLimitPerUser
: number
; recipients
: object
[]; rtcRegion
: null
| string
; threadMetadata
: { archived
: boolean
; archiveTimestamp
: string
; autoArchiveDuration
: 60
| 1440
| 4320
| 10080
; createTimestamp
: null
| string
; invitable
: boolean
; locked
: boolean
; }; topic
: null
| string
; totalMessageSent
: number
; type
: ChannelTypes
; userLimit
: number
; videoQualityMode
: VideoQualityModes
; }>
An instance of the created Thread.
Remarks
Creating a private thread requires the server to be boosted.
Fires a Thread Create gateway event.
See
https://discord.com/developers/docs/resources/channel#start-thread-without-message
syncGuildTemplate()
syncGuildTemplate: (
guildId
) =>Promise
<{code
:string
;createdAt
:string
;creator
: {accentColor
:number
;avatar
:null
|string
;avatarDecorationData
: {asset
:string
;skuId
:string
; };banner
:string
;bot
:boolean
;discriminator
:string
;null
|string
;flags
:number
;globalName
:null
|string
;id
:string
;locale
:string
;mfaEnabled
:boolean
;premiumType
:PremiumTypes
;publicFlags
:number
;system
:boolean
;username
:string
;verified
:boolean
; };creatorId
:string
;description
:null
|string
;isDirty
:null
|boolean
;name
:string
;serializedSourceGuild
: {afkChannelId
:null
|number
;afkTimeout
:number
;applicationId
:null
|string
;approximateMemberCount
:number
;approximatePresenceCount
:number
;banner
:null
|string
;channels
:object
[];defaultMessageNotifications
:DefaultMessageNotificationLevels
;description
:null
|string
;discoverySplash
:null
|string
;emojis
:object
[];explicitContentFilter
:ExplicitContentFilterLevels
;features
:GuildFeatures
[];icon
:null
|string
;iconHash
:null
|string
;id
:string
;joinedAt
:string
;large
:boolean
;maxMembers
:number
;maxPresences
:null
|number
;maxStageVideoChannelUsers
:number
;maxVideoChannelUsers
:number
;memberCount
:number
;members
:object
[];mfaLevel
:MfaLevels
;name
:string
;nsfwLevel
:GuildNsfwLevel
;owner
:boolean
;ownerId
:string
;permissions
:string
;preferredLocale
:string
;premiumProgressBarEnabled
:boolean
;premiumSubscriptionCount
:number
;premiumTier
:PremiumTiers
;presences
:object
[];publicUpdatesChannelId
:null
|string
;roles
:object
[];rulesChannelId
:null
|string
;safetyAlertsChannelId
:null
|string
;soundboardSounds
:object
[];splash
:null
|string
;stageInstances
:object
[];stickers
:object
[];systemChannelFlags
:SystemChannelFlags
;systemChannelId
:null
|number
;threads
:object
[];unavailable
:boolean
;vanityUrlCode
:null
|string
;verificationLevel
:VerificationLevels
;voiceStates
:object
[];welcomeScreen
: {description
:null
|string
;welcomeChannels
:object
[]; };widgetChannelId
:null
|string
;widgetEnabled
:boolean
; };sourceGuildId
:string
;updatedAt
:string
;usageCount
:number
; }>
Defined in: rest/src/types.ts:2694
Synchronises a template with the current state of a guild.
Parameters
guildId
The ID of the guild to synchronise a template of.
Returns
Promise
<{ code
: string
; createdAt
: string
; creator
: { accentColor
: number
; avatar
: null
| string
; avatarDecorationData
: { asset
: string
; skuId
: string
; }; banner
: string
; bot
: boolean
; discriminator
: string
; email
: null
| string
; flags
: number
; globalName
: null
| string
; id
: string
; locale
: string
; mfaEnabled
: boolean
; premiumType
: PremiumTypes
; publicFlags
: number
; system
: boolean
; username
: string
; verified
: boolean
; }; creatorId
: string
; description
: null
| string
; isDirty
: null
| boolean
; name
: string
; serializedSourceGuild
: { afkChannelId
: null
| number
; afkTimeout
: number
; applicationId
: null
| string
; approximateMemberCount
: number
; approximatePresenceCount
: number
; banner
: null
| string
; channels
: object
[]; defaultMessageNotifications
: DefaultMessageNotificationLevels
; description
: null
| string
; discoverySplash
: null
| string
; emojis
: object
[]; explicitContentFilter
: ExplicitContentFilterLevels
; features
: GuildFeatures
[]; icon
: null
| string
; iconHash
: null
| string
; id
: string
; joinedAt
: string
; large
: boolean
; maxMembers
: number
; maxPresences
: null
| number
; maxStageVideoChannelUsers
: number
; maxVideoChannelUsers
: number
; memberCount
: number
; members
: object
[]; mfaLevel
: MfaLevels
; name
: string
; nsfwLevel
: GuildNsfwLevel
; owner
: boolean
; ownerId
: string
; permissions
: string
; preferredLocale
: string
; premiumProgressBarEnabled
: boolean
; premiumSubscriptionCount
: number
; premiumTier
: PremiumTiers
; presences
: object
[]; publicUpdatesChannelId
: null
| string
; roles
: object
[]; rulesChannelId
: null
| string
; safetyAlertsChannelId
: null
| string
; soundboardSounds
: object
[]; splash
: null
| string
; stageInstances
: object
[]; stickers
: object
[]; systemChannelFlags
: SystemChannelFlags
; systemChannelId
: null
| number
; threads
: object
[]; unavailable
: boolean
; vanityUrlCode
: null
| string
; verificationLevel
: VerificationLevels
; voiceStates
: object
[]; welcomeScreen
: { description
: null
| string
; welcomeChannels
: object
[]; }; widgetChannelId
: null
| string
; widgetEnabled
: boolean
; }; sourceGuildId
: string
; updatedAt
: string
; usageCount
: number
; }>
An instance of the edited DiscordTemplate.
Remarks
Requires the MANAGE_GUILD
permission.
Fires a Guild Update gateway event.
See
https://discord.com/developers/docs/resources/guild-template#get-guild-templates
token
token:
string
Defined in: rest/src/types.ts:192
The bot token which will be used to make requests.
triggerTypingIndicator()
triggerTypingIndicator: (
channelId
) =>Promise
<void
>
Defined in: rest/src/types.ts:2709
Triggers a typing indicator for the specified channel, which expires after 10 seconds.
Parameters
channelId
The ID of the channel in which to trigger the typing indicator.
Returns
Promise
<void
>
Remarks
Generally bots should not use this route. However, if a bot is responding to a command and expects the computation to take a few seconds, this endpoint may be called to let the user know that the bot is processing their message.
Fires a Typing Start gateway event.
See
https://discord.com/developers/docs/resources/channel#trigger-typing-indicator
unbanMember()
unbanMember: (
guildId
,userId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:2951
Unbans a user from a guild.
Parameters
guildId
The ID of the guild to unban the user in.
userId
The ID of the user to unban.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
Requires the BAN_MEMBERS
permission.
Fires a Guild Ban Remove gateway event.
See
https://discord.com/developers/docs/resources/guild#remove-guild-ban
unpinMessage()
unpinMessage: (
channelId
,messageId
,reason
?) =>Promise
<void
>
Defined in: rest/src/types.ts:2968
Unpins a pinned message in a channel.
Parameters
channelId
The ID of the channel where the message is pinned.
messageId
The ID of the message to unpin.
reason?
string
An optional reason for the action, to be included in the audit log.
Returns
Promise
<void
>
Remarks
Requires that the bot user be able to see the contents of the channel in which the messages were posted.
Requires the MANAGE_MESSAGES
permission.
Fires a Channel Pins Update event.
See
https://discord.com/developers/docs/resources/channel#unpin-message
updateBearerTokenEndpoint?
optional
updateBearerTokenEndpoint:string
Defined in: rest/src/types.ts:214
The endpoint to use for updateTokenQueues
when working with a rest proxy
updateTokenQueues()
updateTokenQueues: (
oldToken
,newToken
) =>Promise
<void
>
Defined in: rest/src/types.ts:240
Parameters
oldToken
string
newToken
string
Returns
Promise
<void
>
upsertGlobalApplicationCommands()
upsertGlobalApplicationCommands: (
commands
,options
?) =>Promise
<object
[]>
Defined in: rest/src/types.ts:2727
Re-registers the list of global application commands, overwriting the previous commands completely.
Parameters
commands
The list of commands to use to overwrite the previous list.
options?
UpsertGlobalApplicationCommandOptions
Additional options for the endpoint.
Returns
Promise
<object
[]>
A collection of DiscordApplicationCommand objects assorted by command ID.
Remarks
❗ Commands that are not present in the commands
array will be deleted.
⚠️ Commands that do not already exist will count towards the daily limit of 200 new commands.
When using the bearer token the token needs the applications.commands.update
scope and must be a Client grant
token.
You will be able to update only your own application commands
See
upsertGuildApplicationCommands()
upsertGuildApplicationCommands: (
guildId
,commands
,options
?) =>Promise
<object
[]>
Defined in: rest/src/types.ts:2749
Re-registers the list of application commands registered in a guild, overwriting the previous commands completely.
Parameters
guildId
The ID of the guild whose list of commands to overwrite.
commands
The list of commands to use to overwrite the previous list.
options?
UpsertGuildApplicationCommandOptions
Additional options for the endpoint.
Returns
Promise
<object
[]>
A collection of DiscordApplicationCommand objects assorted by command ID.
Remarks
❗ Commands that are not present in the commands
array will be deleted.
⚠️ Commands that do not already exist will count towards the daily limit of 200 new commands.
When using the bearer token the token needs the applications.commands.update
scope and must be a Client grant
token.
You will be able to update only your own application commands
See
version
version:
ApiVersions
Defined in: rest/src/types.ts:196
The api version to use when making requests. Only the latest supported version will be tested.