Skip to main content

Module rest

Module rest 

Source
Expand description

Request bodies and response types of the REST API.

These are plain data types; sending requests is the job of the djs-rest crate.

discord.js counterpart: the RESTPost…JSONBody / RESTGet…Result types of discord-api-types.

Structs§

ActiveThreads
The response of List Active Guild Threads.
AddGuildMember
The body of Add Guild Member.
AddLobbyMember
The body of Add a Member to a Lobby (D-134). The user is in the path; for a member already in the lobby, the fields that are set are updated.
ArchivedThreads
The response of the archived thread lists.
BeginGuildPrune
The body of Begin Guild Prune.
BulkBanResponse
The response of Bulk Guild Ban.
BulkDeleteMessages
The body of Bulk Delete Messages (POST /channels/{channel.id}/messages/bulk-delete).
BulkGuildBan
The body of Bulk Guild Ban.
BulkLobbyMember
One entry of Bulk Update Lobby Members: a member to add or update, or one to remove (D-134).
BulkTargetUsers
The body of Bulk-Add Target Users and Bulk-Delete Target Users.
ChannelPins
The response of Get Channel Pins.
CreateApplicationCommand
The body of Create Global Application Command and Create Guild Application Command, and one entry of the bulk overwrite endpoints.
CreateApplicationEmoji
The body of Create Application Emoji.
CreateAutoModerationRule
The body of Create Auto Moderation Rule.
CreateChannelInvite
The body of Create Channel Invite.
CreateDm
The body of Create DM.
CreateFollowupMessage
The body of Create Followup Message: the Execute Webhook body without the fields follow-ups do not support (D-107).
CreateGroupDm
The body of Create Group DM.
CreateGuildBan
The body of Create Guild Ban.
CreateGuildChannel
The body of Create Guild Channel.
CreateGuildEmoji
The body of Create Guild Emoji.
CreateGuildRole
The body of Create Guild Role.
CreateGuildScheduledEvent
The body of Create Guild Scheduled Event.
CreateGuildSoundboardSound
The body of Create Guild Soundboard Sound.
CreateGuildSticker
The body of Create Guild Sticker.
CreateGuildTemplate
The body of Create Guild Template.
CreateLobby
The body of Create Lobby.
CreateMessage
The body of Create Message (POST /channels/{channel.id}/messages).
CreateOrJoinLobby
The body of Create or Join Lobby.
CreateStageInstance
The body of Create Stage Instance.
CreateTestEntitlement
The body of Create Test Entitlement.
CreateWebhook
The body of Create Webhook.
CurrentUserGuild
A guild of the current user, as returned by Get Current User Guilds.
DeleteApplicationIdentity
The optional body of Delete Application Identity.
EditApplicationCommand
The body of Edit Global Application Command and Edit Guild Application Command.
EditApplicationCommandPermissions
The body of Edit Application Command Permissions.
EditChannelPermissions
The body of Edit Channel Permissions: the permission overwrite of one role or member.
EditCurrentApplication
The body of Edit Current Application.
EditMessage
The body of Edit Message (PATCH /channels/{channel.id}/messages/{message.id}).
EditWebhookMessage
The body of Edit Webhook Message, also used to edit the original response to an interaction and its follow-up messages.
ExecuteWebhook
The body of Execute Webhook: a message sent through a webhook.
FileUpload
A file uploaded with a request, e.g. a message attachment.
FollowAnnouncementChannel
The body of Follow Announcement Channel.
ForumTagData
A forum tag in a request (D-114): tags without an id are created.
ForumThread
The response of Start Thread in Forum or Media Channel: the created post and its first message (D-115).
ForumThreadMessage
The first message of a forum or media post (D-112).
Gateway
The response of Get Gateway (GET /gateway, D-136): where to connect to the gateway. Bots use GatewayBot, which also tells the shard count and session start limit.
GatewayBot
The response of Get Gateway Bot (GET /gateway/bot): where and how to connect to the gateway.
GetAnswerVoters
The query of Get Answer Voters.
GetApplicationCommands
The query of Get Global Application Commands and Get Guild Application Commands.
GetApplicationIdentitiesByExternalId
The query of Get Application Identities by External ID.
GetChannelMessages
The query of Get Channel Messages (GET /channels/{channel.id}/messages). Messages are returned newest first.
GetChannelPermissions
The query of Get Channel Member Permissions and Get Channel Role Permissions.
GetChannelPins
The query of Get Channel Pins (GET /channels/{channel.id}/messages/pins). Pins are returned newest first; to get the next page, pass the pinned_at of the last pin as before.
GetCurrentUserGuilds
The query of Get Current User Guilds.
GetGuild
The query of Get Guild.
GetGuildAuditLog
The query of Get Guild Audit Log.
GetGuildBans
The query of Get Guild Bans.
GetGuildPruneCount
The query of Get Guild Prune Count.
GetGuildScheduledEvent
The query of Get Guild Scheduled Event.
GetGuildScheduledEventUsers
The query of Get Guild Scheduled Event Users.
GetInvite
The query of Get Invite.
GetLobbyMessages
The query of Get Lobby Messages.
GetReactions
The query of Get Reactions (GET /channels/{channel.id}/messages/{message.id}/reactions/{emoji}).
GetThreadMember
The query of Get Thread Member.
GroupDmAddRecipient
The body of Group DM Add Recipient.
ListArchivedThreads
The query of List Public Archived Threads and List Private Archived Threads.
ListEntitlements
The query of List Entitlements.
ListGuildMembers
The query of List Guild Members.
ListJoinedPrivateArchivedThreads
The query of List Joined Private Archived Threads.
ListScheduledEventsForGuild
The query of List Scheduled Events for Guild.
ListSkuSubscriptions
The query of List SKU Subscriptions.
ListThreadMembers
The query of List Thread Members.
LobbyMemberData
A member in the body of Create Lobby or Modify Lobby, or one to upsert with Bulk Update Lobby Members (D-134).
MessageSearchResults
The response of Search Guild Messages.
ModifyApplicationEmoji
The body of Modify Application Emoji.
ModifyAutoModerationRule
The body of Modify Auto Moderation Rule.
ModifyCurrentMember
The body of Modify Current Member: the bot’s own guild profile.
ModifyCurrentUser
The body of Modify Current User.
ModifyCurrentUserVoiceState
The body of Modify Current User Voice State.
ModifyGroupDm
The body of Modify Channel for a group DM (D-109).
ModifyGuild
The body of Modify Guild.
ModifyGuildChannel
The body of Modify Channel for a guild channel (D-109).
ModifyGuildChannelPosition
One entry of Modify Guild Channel Positions.
ModifyGuildEmoji
The body of Modify Guild Emoji.
ModifyGuildIncidentActions
The body of Modify Guild Incident Actions.
ModifyGuildMember
The body of Modify Guild Member.
ModifyGuildOnboarding
The body of Modify Guild Onboarding.
ModifyGuildRole
The body of Modify Guild Role.
ModifyGuildRolePosition
One entry of Modify Guild Role Positions.
ModifyGuildScheduledEvent
The body of Modify Guild Scheduled Event.
ModifyGuildSoundboardSound
The body of Modify Guild Soundboard Sound.
ModifyGuildSticker
The body of Modify Guild Sticker.
ModifyGuildTemplate
The body of Modify Guild Template.
ModifyGuildWelcomeScreen
The body of Modify Guild Welcome Screen.
ModifyGuildWidget
The body of Modify Guild Widget.
ModifyLobby
The body of Modify Lobby.
ModifyStageInstance
The body of Modify Stage Instance.
ModifyThread
The body of Modify Channel for a thread (D-109).
ModifyUserVoiceState
The body of Modify User Voice State.
ModifyWebhook
The body of Modify Webhook and Modify Webhook with Token (which does not accept channel_id).
OnboardingPromptData
An onboarding prompt in a request (D-118).
PromptOptionData
A prompt option in a request (D-118): the emoji is given by its parts, as Discord requires here.
RecurrenceRuleData
How a scheduled event repeats, as sent to Discord (D-124): the settable fields of a RecurrenceRule.
SearchGuildMembers
The query of Search Guild Members.
SearchGuildMessages
The query of Search Guild Messages (GET /guilds/{guild.id}/messages/search). Every filter is optional; list filters match any of their values.
SendLobbyMessage
The body of Send Lobby Message.
SendSoundboardSound
The body of Send Soundboard Sound.
SessionStartLimit
How many gateway sessions the bot may still start (session start limit object).
SetVoiceChannelStatus
The body of Set Voice Channel Status.
StartThreadFromMessage
The body of Start Thread from Message.
StartThreadInForumOrMediaChannel
The body of Start Thread in Forum or Media Channel: a post with its first message.
StartThreadWithoutMessage
The body of Start Thread without Message.
UpdateApplicationIdentityProfile
The body of Update Application Identity Profile.
VanityUrl
The response of Get Guild Vanity URL.

Enums§

ErrorCode
The JSON error code of an error response: what went wrong, in more detail than the HTTP status (D-097).
SearchAuthorType
An author type of a message search.
SearchEmbedType
An embed type of a message search (broader than the embed types of messages).
SearchFilter
A search filter value that includes or excludes matching messages (Discord writes an exclusion with a leading -).
SearchHasType
Something a message has, for a message search.
SearchSortMode
A sort mode of a message search.
SearchSortOrder
The direction of a message search’s sorting.

Type Aliases§

LobbyMetadata
String key/value pairs set by the app on a lobby, a member or a message.