#[non_exhaustive]
pub enum Route<'a> {
Show 167 variants AddGuildMember { guild_id: u64, user_id: u64, }, AddMemberRole { guild_id: u64, role_id: u64, user_id: u64, }, AddThreadMember { channel_id: u64, user_id: u64, }, CreateAutoModerationRule { guild_id: u64, }, CreateBan { delete_message_seconds: Option<u32>, guild_id: u64, user_id: u64, }, CreateChannel { guild_id: u64, }, CreateEmoji { guild_id: u64, }, CreateForumThread { channel_id: u64, }, CreateGlobalCommand { application_id: u64, }, CreateGuild, CreateGuildCommand { application_id: u64, guild_id: u64, }, CreateGuildFromTemplate { template_code: &'a str, }, CreateGuildIntegration { guild_id: u64, }, CreateGuildPrune { compute_prune_count: Option<bool>, days: Option<u16>, guild_id: u64, include_roles: &'a [Id<RoleMarker>], }, CreateGuildScheduledEvent { guild_id: u64, }, CreateGuildSticker { guild_id: u64, }, CreateInvite { channel_id: u64, }, CreateMessage { channel_id: u64, }, CreatePrivateChannel, CreateReaction { channel_id: u64, emoji: &'a RequestReactionType<'a>, message_id: u64, }, CreateRole { guild_id: u64, }, CreateStageInstance, CreateTemplate { guild_id: u64, }, CreateThread { channel_id: u64, }, CreateThreadFromMessage { channel_id: u64, message_id: u64, }, CreateTypingTrigger { channel_id: u64, }, CreateWebhook { channel_id: u64, }, CrosspostMessage { channel_id: u64, message_id: u64, }, DeleteAutoModerationRule { guild_id: u64, auto_moderation_rule_id: u64, }, DeleteBan { guild_id: u64, user_id: u64, }, DeleteChannel { channel_id: u64, }, DeleteEmoji { emoji_id: u64, guild_id: u64, }, DeleteGlobalCommand { application_id: u64, command_id: u64, }, DeleteGuild { guild_id: u64, }, DeleteGuildCommand { application_id: u64, command_id: u64, guild_id: u64, }, DeleteGuildIntegration { guild_id: u64, integration_id: u64, }, DeleteGuildScheduledEvent { guild_id: u64, scheduled_event_id: u64, }, DeleteGuildSticker { guild_id: u64, sticker_id: u64, }, DeleteInteractionOriginal { application_id: u64, interaction_token: &'a str, }, DeleteInvite { code: &'a str, }, DeleteMessage { channel_id: u64, message_id: u64, }, DeleteMessageReactions { channel_id: u64, message_id: u64, }, DeleteMessageSpecificReaction { channel_id: u64, emoji: &'a RequestReactionType<'a>, message_id: u64, }, DeleteMessages { channel_id: u64, }, DeletePermissionOverwrite { channel_id: u64, target_id: u64, }, DeleteReaction { channel_id: u64, emoji: &'a RequestReactionType<'a>, message_id: u64, user_id: u64, }, DeleteReactionCurrentUser { channel_id: u64, emoji: &'a RequestReactionType<'a>, message_id: u64, }, DeleteRole { guild_id: u64, role_id: u64, }, DeleteStageInstance { channel_id: u64, }, DeleteTemplate { guild_id: u64, template_code: &'a str, }, DeleteWebhook { token: Option<&'a str>, webhook_id: u64, }, DeleteWebhookMessage { message_id: u64, thread_id: Option<u64>, token: &'a str, webhook_id: u64, }, ExecuteWebhook { thread_id: Option<u64>, token: &'a str, wait: Option<bool>, webhook_id: u64, }, FollowNewsChannel { channel_id: u64, }, GetActiveThreads { guild_id: u64, }, GetAuditLogs { action_type: Option<u64>, after: Option<u64>, before: Option<u64>, guild_id: u64, limit: Option<u16>, user_id: Option<u64>, }, GetAutoModerationRule { guild_id: u64, auto_moderation_rule_id: u64, }, GetBan { guild_id: u64, user_id: u64, }, GetBans { guild_id: u64, }, GetBansWithParameters { after: Option<u64>, before: Option<u64>, limit: Option<u16>, guild_id: u64, }, GetChannel { channel_id: u64, }, GetChannelInvites { channel_id: u64, }, GetChannelWebhooks { channel_id: u64, }, GetChannels { guild_id: u64, }, GetCommandPermissions { application_id: u64, command_id: u64, guild_id: u64, }, GetCurrentAuthorizationInformation, GetCurrentUser, GetCurrentUserApplicationInfo, GetCurrentUserGuildMember { guild_id: u64, }, GetEmoji { emoji_id: u64, guild_id: u64, }, GetEmojis { guild_id: u64, }, GetFollowupMessage { application_id: u64, interaction_token: &'a str, thread_id: Option<u64>, message_id: u64, }, GetGateway, GetGatewayBot, GetGlobalCommand { application_id: u64, command_id: u64, }, GetGlobalCommands { application_id: u64, with_localizations: Option<bool>, }, GetGuild { guild_id: u64, with_counts: bool, }, GetGuildAutoModerationRules { guild_id: u64, }, GetGuildCommand { application_id: u64, command_id: u64, guild_id: u64, }, GetGuildCommandPermissions { application_id: u64, guild_id: u64, }, GetGuildCommands { application_id: u64, guild_id: u64, with_localizations: Option<bool>, }, GetGuildIntegrations { guild_id: u64, }, GetGuildInvites { guild_id: u64, }, GetGuildMembers { after: Option<u64>, guild_id: u64, limit: Option<u16>, }, GetGuildOnboarding { guild_id: u64, }, GetGuildPreview { guild_id: u64, }, GetGuildPruneCount { days: Option<u16>, guild_id: u64, include_roles: &'a [Id<RoleMarker>], }, GetGuildRoles { guild_id: u64, }, GetGuildScheduledEvent { guild_id: u64, scheduled_event_id: u64, with_user_count: bool, }, GetGuildScheduledEventUsers { after: Option<u64>, before: Option<u64>, guild_id: u64, limit: Option<u16>, scheduled_event_id: u64, with_member: bool, }, GetGuildScheduledEvents { guild_id: u64, with_user_count: bool, }, GetGuildSticker { guild_id: u64, sticker_id: u64, }, GetGuildStickers { guild_id: u64, }, GetGuildVanityUrl { guild_id: u64, }, GetGuildVoiceRegions { guild_id: u64, }, GetGuildWebhooks { guild_id: u64, }, GetGuildWelcomeScreen { guild_id: u64, }, GetGuildWidget { guild_id: u64, }, GetGuildWidgetSettings { guild_id: u64, }, GetGuilds { after: Option<u64>, before: Option<u64>, limit: Option<u16>, }, GetInteractionOriginal { application_id: u64, interaction_token: &'a str, }, GetInvite { code: &'a str, with_counts: bool, }, GetInviteWithExpiration { code: &'a str, with_counts: bool, with_expiration: bool, }, GetJoinedPrivateArchivedThreads { before: Option<u64>, channel_id: u64, limit: Option<u64>, }, GetMember { guild_id: u64, user_id: u64, }, GetMessage { channel_id: u64, message_id: u64, }, GetMessages { after: Option<u64>, around: Option<u64>, before: Option<u64>, channel_id: u64, limit: Option<u16>, }, GetNitroStickerPacks, GetPins { channel_id: u64, }, GetPrivateArchivedThreads { before: Option<&'a str>, channel_id: u64, limit: Option<u64>, }, GetPublicArchivedThreads { before: Option<&'a str>, channel_id: u64, limit: Option<u64>, }, GetReactionUsers { after: Option<u64>, channel_id: u64, emoji: &'a RequestReactionType<'a>, limit: Option<u16>, message_id: u64, }, GetStageInstance { channel_id: u64, }, GetSticker { sticker_id: u64, }, GetTemplate { template_code: &'a str, }, GetTemplates { guild_id: u64, }, GetThreadMember { channel_id: u64, user_id: u64, }, GetThreadMembers { after: Option<u64>, channel_id: u64, limit: Option<u32>, with_member: Option<bool>, }, GetUser { user_id: u64, }, GetUserConnections, GetUserPrivateChannels, GetVoiceRegions, GetWebhook { token: Option<&'a str>, webhook_id: u64, }, GetWebhookMessage { message_id: u64, thread_id: Option<u64>, token: &'a str, webhook_id: u64, }, InteractionCallback { interaction_id: u64, interaction_token: &'a str, }, JoinThread { channel_id: u64, }, LeaveGuild { guild_id: u64, }, LeaveThread { channel_id: u64, }, PinMessage { channel_id: u64, message_id: u64, }, RemoveMember { guild_id: u64, user_id: u64, }, RemoveMemberRole { guild_id: u64, role_id: u64, user_id: u64, }, RemoveThreadMember { channel_id: u64, user_id: u64, }, SearchGuildMembers { guild_id: u64, limit: Option<u16>, query: &'a str, }, SetGlobalCommands { application_id: u64, }, SetGuildCommands { application_id: u64, guild_id: u64, }, SyncGuildIntegration { guild_id: u64, integration_id: u64, }, SyncTemplate { guild_id: u64, template_code: &'a str, }, UnpinMessage { channel_id: u64, message_id: u64, }, UpdateAutoModerationRule { auto_moderation_rule_id: u64, guild_id: u64, }, UpdateChannel { channel_id: u64, }, UpdateCommandPermissions { application_id: u64, command_id: u64, guild_id: u64, }, UpdateCurrentMember { guild_id: u64, }, UpdateCurrentUser, UpdateCurrentUserVoiceState { guild_id: u64, }, UpdateEmoji { emoji_id: u64, guild_id: u64, }, UpdateGlobalCommand { application_id: u64, command_id: u64, }, UpdateGuild { guild_id: u64, }, UpdateGuildChannels { guild_id: u64, }, UpdateGuildCommand { application_id: u64, command_id: u64, guild_id: u64, }, UpdateGuildIntegration { guild_id: u64, integration_id: u64, }, UpdateGuildMfa { guild_id: u64, }, UpdateGuildScheduledEvent { guild_id: u64, scheduled_event_id: u64, }, UpdateGuildSticker { guild_id: u64, sticker_id: u64, }, UpdateGuildWelcomeScreen { guild_id: u64, }, UpdateGuildWidgetSettings { guild_id: u64, }, UpdateInteractionOriginal { application_id: u64, interaction_token: &'a str, }, UpdateMember { guild_id: u64, user_id: u64, }, UpdateMessage { channel_id: u64, message_id: u64, }, UpdateNickname { guild_id: u64, }, UpdatePermissionOverwrite { channel_id: u64, target_id: u64, }, UpdateRole { guild_id: u64, role_id: u64, }, UpdateRolePositions { guild_id: u64, }, UpdateStageInstance { channel_id: u64, }, UpdateTemplate { guild_id: u64, template_code: &'a str, }, UpdateUserVoiceState { guild_id: u64, user_id: u64, }, UpdateWebhook { token: Option<&'a str>, webhook_id: u64, }, UpdateWebhookMessage { message_id: u64, thread_id: Option<u64>, token: &'a str, webhook_id: u64, },
}

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

AddGuildMember

Fields

§guild_id: u64
§user_id: u64

Route information to add a user to a guild.

§

AddMemberRole

Fields

§guild_id: u64

The ID of the guild.

§role_id: u64

The ID of the role.

§user_id: u64

The ID of the user.

Route information to add a role to guild member.

§

AddThreadMember

Fields

§channel_id: u64

ID of the thread.

§user_id: u64

ID of the member.

Route information to add a member to a thread.

§

CreateAutoModerationRule

Fields

§guild_id: u64

ID of the guild.

Route information to create an auto moderation rule.

§

CreateBan

Fields

§delete_message_seconds: Option<u32>

The number of seconds’ worth of the user’s messages to delete in the guild’s channels.

§guild_id: u64

The ID of the guild.

§user_id: u64

The ID of the user.

Route information to create a ban on a user in a guild.

§

CreateChannel

Fields

§guild_id: u64

The ID of the guild.

Route information to create a channel in a guild.

§

CreateEmoji

Fields

§guild_id: u64

The ID of the guild.

Route information to create an emoji in a guild.

§

CreateForumThread

Fields

§channel_id: u64

The ID of the channel.

Route information to create a thread in a forum channel.

§

CreateGlobalCommand

Fields

§application_id: u64

The ID of the owner application.

Route information to create a global command.

§

CreateGuild

Route information to create a guild.

§

CreateGuildCommand

Fields

§application_id: u64

The ID of the owner application.

§guild_id: u64

The ID of the guild.

Route information to create a guild command.

§

CreateGuildFromTemplate

Fields

§template_code: &'a str

Code of the template.

Route information to create a guild from a template.

§

CreateGuildIntegration

Fields

§guild_id: u64

The ID of the guild.

Route information to create a guild’s integration.

§

CreateGuildPrune

Fields

§compute_prune_count: Option<bool>

Whether to compute the number of pruned users.

§days: Option<u16>

The number of days that a user must be offline before being able to be pruned.

§guild_id: u64

The ID of the guild.

§include_roles: &'a [Id<RoleMarker>]

The roles to filter the prune by.

A user must have at least one of these roles to be able to be pruned.

Route information to create a prune in a guild.

§

CreateGuildScheduledEvent

Fields

§guild_id: u64

ID of the guild.

Route information to create a scheduled event in a guild.

§

CreateGuildSticker

Fields

§guild_id: u64

ID of the guild.

Route information to create a sticker in a guild.

§

CreateInvite

Fields

§channel_id: u64

The ID of the channel.

Route information to create an invite to a channel.

§

CreateMessage

Fields

§channel_id: u64

The ID of the channel.

Route information to create a message in a channel.

§

CreatePrivateChannel

Route information to create a private channel.

§

CreateReaction

Fields

§channel_id: u64

The ID of the channel.

§emoji: &'a RequestReactionType<'a>

The URI encoded custom or unicode emoji.

§message_id: u64

The ID of the message.

Route information to create a reaction on a message.

§

CreateRole

Fields

§guild_id: u64

The ID of the guild.

Route information to create a role in a guild.

§

CreateStageInstance

Route information to create a stage instance.

§

CreateTemplate

Fields

§guild_id: u64

The ID of the guild.

Route information to create a guild template.

§

CreateThread

Fields

§channel_id: u64

ID of the channel.

Route information to create a thread in a channel.

§

CreateThreadFromMessage

Fields

§channel_id: u64

ID of the channel.

§message_id: u64

ID of the message.

Route information to create a thread from a message.

§

CreateTypingTrigger

Fields

§channel_id: u64

The ID of the channel.

Route information to create a typing trigger in a channel.

§

CreateWebhook

Fields

§channel_id: u64

The ID of the channel.

Route information to create a webhook in a channel.

§

CrosspostMessage

Fields

§channel_id: u64

The ID of the channel.

§message_id: u64

The ID of the message.

Route information to crosspost a message to following guilds.

§

DeleteAutoModerationRule

Fields

§guild_id: u64

ID of the guild.

§auto_moderation_rule_id: u64

ID of the auto moderation rule.

Route information to delete an auto moderation rule for a guild.

§

DeleteBan

Fields

§guild_id: u64

The ID of the guild.

§user_id: u64

The ID of the user.

Route information to delete a ban on a user in a guild.

§

DeleteChannel

Fields

§channel_id: u64

The ID of the channel.

Route information to delete a channel.

§

DeleteEmoji

Fields

§emoji_id: u64

The ID of the emoji.

§guild_id: u64

The ID of the guild.

Route information to delete a guild’s custom emoji.

§

DeleteGlobalCommand

Fields

§application_id: u64

The ID of the owner application.

§command_id: u64

The ID of the command.

Route information to delete a global command.

§

DeleteGuild

Fields

§guild_id: u64

The ID of the guild.

Route information to delete a guild.

§

DeleteGuildCommand

Fields

§application_id: u64

The ID of the owner application.

§command_id: u64

The ID of the command.

§guild_id: u64

The ID of the guild.

Route information to delete a guild command.

§

DeleteGuildIntegration

Fields

§guild_id: u64

The ID of the guild.

§integration_id: u64

The ID of the integration.

Route information to delete a guild integration.

§

DeleteGuildScheduledEvent

Fields

§guild_id: u64

ID of the guild.

§scheduled_event_id: u64

ID of the scheduled event.

Route information to delete a scheduled event in a guild.

§

DeleteGuildSticker

Fields

§guild_id: u64

ID of the guild.

§sticker_id: u64

ID of the sticker.

Route information to delete a guild sticker.

§

DeleteInteractionOriginal

Fields

§application_id: u64

The ID of the owner application

§interaction_token: &'a str

The token of the interaction.

Route information to delete the original interaction response.

§

DeleteInvite

Fields

§code: &'a str

The unique invite code.

Route information to delete an invite.

§

DeleteMessage

Fields

§channel_id: u64

The ID of the channel.

§message_id: u64

The ID of the message.

Route information to delete a channel’s message.

§

DeleteMessageReactions

Fields

§channel_id: u64

The ID of the channel.

§message_id: u64

The ID of the message.

Route information to delete all of the reactions on a message.

§

DeleteMessageSpecificReaction

Fields

§channel_id: u64

The ID of the channel.

§emoji: &'a RequestReactionType<'a>

The URI encoded custom or unicode emoji.

§message_id: u64

The ID of the message.

Route information to delete all of the reactions on a message with a specific emoji.

§

DeleteMessages

Fields

§channel_id: u64

The ID of the channel.

Route information to bulk delete messages in a channel.

§

DeletePermissionOverwrite

Fields

§channel_id: u64

The ID of the channel.

§target_id: u64

The ID of the target role or user.

Route information to delete a permission overwrite for a role or user in a channel.

§

DeleteReaction

Fields

§channel_id: u64

The ID of the channel.

§emoji: &'a RequestReactionType<'a>

The URI encoded custom or unicode emoji.

§message_id: u64

The ID of the message.

§user_id: u64

The ID of the user.

Route information to delete a user’s reaction on a message.

§

DeleteReactionCurrentUser

Fields

§channel_id: u64

ID of the channel.

§emoji: &'a RequestReactionType<'a>

URI encoded custom or unicode emoji.

§message_id: u64

ID of the message.

Route information to delete the current user’s reaction on a message.

§

DeleteRole

Fields

§guild_id: u64

The ID of the guild.

§role_id: u64

The ID of the role.

Route information to delete a guild’s role.

§

DeleteStageInstance

Fields

§channel_id: u64

ID of the stage channel.

Route information to delete a stage instance.

§

DeleteTemplate

Fields

§guild_id: u64

The ID of the guild.

§template_code: &'a str

The target template code.

Route information to delete a guild template.

§

DeleteWebhook

Fields

§token: Option<&'a str>

The token of the webhook.

§webhook_id: u64

The ID of the webhook.

Route information to delete a webhook.

§

DeleteWebhookMessage

Fields

§message_id: u64
§thread_id: Option<u64>

ID of the thread channel, if there is one.

§token: &'a str
§webhook_id: u64

Route information to delete a message created by a webhook.

§

ExecuteWebhook

Fields

§thread_id: Option<u64>

ID of the thread channel, if there is one.

§token: &'a str

The token of the webhook.

§wait: Option<bool>

Whether to wait for a message response.

§webhook_id: u64

The ID of the webhook.

Route information to execute a webhook by ID and token.

§

FollowNewsChannel

Fields

§channel_id: u64

The ID of the channel to follow.

Route information to follow a news channel.

§

GetActiveThreads

Fields

§guild_id: u64

ID of the guild.

Route information to get active threads in a channel.

§

GetAuditLogs

Fields

§action_type: Option<u64>

The type of action to get audit logs for.

§after: Option<u64>

The minimum ID of audit logs to get.

§before: Option<u64>

The maximum ID of audit logs to get.

§guild_id: u64

The ID of the guild.

§limit: Option<u16>

The maximum number of audit logs to get.

§user_id: Option<u64>

The ID of the user, if specified.

Route information to get a paginated list of audit logs in a guild.

§

GetAutoModerationRule

Fields

§guild_id: u64

ID of the guild.

§auto_moderation_rule_id: u64

ID of the auto moderation rule.

Route information to get an auto moderation rule for a guild.

§

GetBan

Fields

§guild_id: u64

The ID of the guild.

§user_id: u64

The ID of the user.

Route information to get information about a single ban in a guild.

§

GetBans

Fields

§guild_id: u64

The ID of the guild.

Route information to get a guild’s bans.

§

GetBansWithParameters

Fields

§after: Option<u64>

User ID after which to retrieve bans.

§before: Option<u64>

User ID before which to retrieve bans.

§limit: Option<u16>

Maximum number of bans to retrieve.

§guild_id: u64

ID of the guild.

Route information to get a guild’s bans with parameters.

§

GetChannel

Fields

§channel_id: u64

The ID of the channel.

Route information to get a channel.

§

GetChannelInvites

Fields

§channel_id: u64

The ID of the channel.

Route information to get a channel’s invites.

§

GetChannelWebhooks

Fields

§channel_id: u64

The ID of the channel.

Route information to get a channel’s webhooks.

§

GetChannels

Fields

§guild_id: u64

The ID of the guild.

Route information to get a guild’s channels.

§

GetCommandPermissions

Fields

§application_id: u64

The ID of the application.

§command_id: u64

The ID of the command.

§guild_id: u64

The ID of the guild.

Route information to get permissions of a specific guild command.

§

GetCurrentAuthorizationInformation

Route information to get the current OAuth authorization information.

§

GetCurrentUser

Route information to get the current user.

§

GetCurrentUserApplicationInfo

Route information to get info about application the current bot user belongs to

§

GetCurrentUserGuildMember

Fields

§guild_id: u64

ID of the guild.

Route information to get the current user as a member object within a guild.

§

GetEmoji

Fields

§emoji_id: u64

The ID of the emoji.

§guild_id: u64

The ID of the guild.

Route information to get an emoji by ID within a guild.

§

GetEmojis

Fields

§guild_id: u64

The ID of the guild.

Route information to get a guild’s emojis.

§

GetFollowupMessage

Fields

§application_id: u64

ID of the application.

§interaction_token: &'a str

Token of the interaction.

§thread_id: Option<u64>

ID of the thread channel, if there is one.

§message_id: u64

ID of the followup message.

Route to get a followup message for an interaction.

§

GetGateway

Route information to get basic gateway information.

§

GetGatewayBot

Route information to get gateway information tailored to the current user.

§

GetGlobalCommand

Fields

§application_id: u64

ID of the owner application.

§command_id: u64

ID of the command.

Route information to get a global command for an application.

§

GetGlobalCommands

Fields

§application_id: u64

The ID of the owner application.

§with_localizations: Option<bool>

Whether to include full localization dictionaries.

§

GetGuild

Fields

§guild_id: u64

The ID of the guild.

§with_counts: bool

Whether to include approximate member and presence counts for the guild.

Route information to get a guild.

§

GetGuildAutoModerationRules

Fields

§guild_id: u64

ID of the guild.

Route information to get a list of automation rules for a guild.

§

GetGuildCommand

Fields

§application_id: u64

ID of the owner application.

§command_id: u64

ID of the command.

§guild_id: u64

ID of the guild.

Route information to get a guild command.

§

GetGuildCommandPermissions

Fields

§application_id: u64

The ID of the application.

§guild_id: u64

The ID of the guild.

Route information to get permissions of all guild commands.

§

GetGuildCommands

Fields

§application_id: u64

The ID of the owner application.

§guild_id: u64

The ID of the guild.

§with_localizations: Option<bool>

Whether to include full localization dictionaries.

Route information to get guild commands.

§

GetGuildIntegrations

Fields

§guild_id: u64

The ID of the guild.

Route information to get a guild’s integrations.

§

GetGuildInvites

Fields

§guild_id: u64

The ID of the guild.

Route information to get a guild’s invites.

§

GetGuildMembers

Fields

§after: Option<u64>

The minimum ID of members to get.

§guild_id: u64

The ID of the guild.

§limit: Option<u16>

The maximum number of members to get.

Route information to get a guild’s members.

§

GetGuildOnboarding

Fields

§guild_id: u64

The ID of the guild to get onboarding information for.

Route information to get a guild’s onboarding information.

§

GetGuildPreview

Fields

§guild_id: u64

The ID of the guild.

Route information to get a guild’s preview.

§

GetGuildPruneCount

Fields

§days: Option<u16>

The number of days that a user must be offline before being able to be pruned.

§guild_id: u64

The ID of the guild.

§include_roles: &'a [Id<RoleMarker>]

The roles to filter the prune by.

A user must have at least one of these roles to be able to be pruned.

Route information to get the number of members that would be pruned, filtering by inactivity and users with one of the provided roles.

§

GetGuildRoles

Fields

§guild_id: u64

The ID of the guild.

Route information to get a guild’s roles.

§

GetGuildScheduledEvent

Fields

§guild_id: u64

ID of the guild.

§scheduled_event_id: u64
§with_user_count: bool

Whether to include user counts.

Route information to get a guild scheduled event.

§

GetGuildScheduledEventUsers

Fields

§after: Option<u64>

Get members after this ID.

§before: Option<u64>

Get members before this ID.

§guild_id: u64

ID of the guild.

§limit: Option<u16>

Maximum amount of members to get.

§scheduled_event_id: u64

ID of the scheduled event.

§with_member: bool

Whether to return a member object.

Route information to get a guild scheduled event’s members.

§

GetGuildScheduledEvents

Fields

§guild_id: u64

ID of the guild.

§with_user_count: bool

Whether to include user counts.

Route information to get a guild’s scheduled events.

§

GetGuildSticker

Fields

§guild_id: u64

ID of the guild.

§sticker_id: u64

ID of the stickers.

Route information to get a guild’s sticker.

§

GetGuildStickers

Fields

§guild_id: u64

ID of the guild.

Route information to get a guild’s stickers.

§

GetGuildVanityUrl

Fields

§guild_id: u64

The ID of the guild.

Route information to get a guild’s vanity URL.

§

GetGuildVoiceRegions

Fields

§guild_id: u64

The ID of the guild.

Route information to get a guild’s available voice regions.

§

GetGuildWebhooks

Fields

§guild_id: u64

The ID of the guild.

Route information to get a guild’s webhooks.

§

GetGuildWelcomeScreen

Fields

§guild_id: u64

ID of the guild.

Route information to get a guild’s welcome screen.

§

GetGuildWidget

Fields

§guild_id: u64

ID of the guild.

Route information to get a guild’s widget.

§

GetGuildWidgetSettings

Fields

§guild_id: u64

ID of the guild.

Route information to get a guild’s widget settings.

§

GetGuilds

Fields

§after: Option<u64>

The minimum ID of guilds to get.

§before: Option<u64>

The maximum ID of guilds to get.

§limit: Option<u16>

The maximum number of guilds to get.

Route information to get a paginated list of guilds.

§

GetInteractionOriginal

Fields

§application_id: u64

ID of the owner application.

§interaction_token: &'a str

Token of the interaction.

Route information to get an original interaction response message.

§

GetInvite

Fields

§code: &'a str

The unique invite code.

§with_counts: bool

Whether to retrieve statistics about the invite.

Route information to get an invite.

§

GetInviteWithExpiration

Fields

§code: &'a str

The unique invite code.

§with_counts: bool

Whether to retrieve statistics about the invite.

§with_expiration: bool

Whether to retrieve the expiration date of the invite.

Route information to get an invite with an expiration.

§

GetJoinedPrivateArchivedThreads

Fields

§before: Option<u64>

Optional timestamp to return threads before.

§channel_id: u64

ID of the channel.

§limit: Option<u64>

Optional maximum number of threads to return.

Route information to get joined private archived threads in a channel.

§

GetMember

Fields

§guild_id: u64

The ID of the guild.

§user_id: u64

The ID of the user.

Route information to get a member.

§

GetMessage

Fields

§channel_id: u64

The ID of the channel.

§message_id: u64

The ID of the message.

Route information to get a single message in a channel.

§

GetMessages

Fields

§after: Option<u64>

The minimum ID of messages to get.

§around: Option<u64>

The message ID to get the messages around.

§before: Option<u64>

The maximum ID of messages to get.

§channel_id: u64

The ID of the channel.

§limit: Option<u16>

The maximum number of messages to get.

Route information to get a paginated list of messages in a channel.

§

GetNitroStickerPacks

Route information to get a list of sticker packs available to Nitro subscribers.

§

GetPins

Fields

§channel_id: u64

The ID of the channel.

Route information to get a channel’s pins.

§

GetPrivateArchivedThreads

Fields

§before: Option<&'a str>

Optional timestamp to return threads before.

§channel_id: u64

ID of the channel.

§limit: Option<u64>

Optional maximum number of threads to return.

Route information to get private archived threads in a channel.

§

GetPublicArchivedThreads

Fields

§before: Option<&'a str>

Optional timestamp to return threads before.

§channel_id: u64

ID of the channel.

§limit: Option<u64>

Optional maximum number of threads to return.

Route information to get public archived threads in a channel.

§

GetReactionUsers

Fields

§after: Option<u64>

The minimum ID of users to get.

§channel_id: u64

The ID of the channel.

§emoji: &'a RequestReactionType<'a>

The URI encoded custom or unicode emoji.

§limit: Option<u16>

The maximum number of users to retrieve.

§message_id: u64

The ID of the message.

Route information to get the users who reacted to a message with a specified emoji.

§

GetStageInstance

Fields

§channel_id: u64

ID of the stage channel.

Route information to get a stage instance.

§

GetSticker

Fields

§sticker_id: u64

ID of the sticker.

Route information to get a sticker.

§

GetTemplate

Fields

§template_code: &'a str

The template code.

Route information to get a template.

§

GetTemplates

Fields

§guild_id: u64

The ID of the guild.

Route information to get a list of templates from a guild.

§

GetThreadMember

Fields

§channel_id: u64

ID of the thread.

§user_id: u64

ID of the member.

Route information to get a member of a thread.

§

GetThreadMembers

Fields

§after: Option<u64>

Fetch thread members after this user ID.

§channel_id: u64

ID of the thread.

§limit: Option<u32>

Maximum number of thread members to return.

Must be between 1 and 100. Defaults to 100.

§with_member: Option<bool>

Whether to include associated member objects.

Route information to get members of a thread.

§

GetUser

Fields

§user_id: u64

ID of the target user.

Route information to get a user.

§

GetUserConnections

Route information to get the current user’s connections.

§

GetUserPrivateChannels

Route information to get the current user’s private channels and groups.

§

GetVoiceRegions

Route information to get a list of the voice regions.

§

GetWebhook

Fields

§token: Option<&'a str>

The token of the webhook.

§webhook_id: u64

The ID of the webhook.

Route information to get a webhook by ID, optionally with a token if the current user doesn’t have access to it.

§

GetWebhookMessage

Fields

§message_id: u64

ID of the message.

§thread_id: Option<u64>

ID of the thread channel, if there is one.

§token: &'a str

Token of the webhook.

§webhook_id: u64

ID of the webhook.

Route information to get a previously-sent webhook message.

§

InteractionCallback

Fields

§interaction_id: u64

The ID of the interaction.

§interaction_token: &'a str

The token for the interaction.

Route information to respond to an interaction.

§

JoinThread

Fields

§channel_id: u64

ID of the thread.

Route information to join a thread as the current user.

§

LeaveGuild

Fields

§guild_id: u64

The ID of the guild.

Route information to leave the guild.

§

LeaveThread

Fields

§channel_id: u64

ID of the thread.

Route information to leave a thread as the current user.

§

PinMessage

Fields

§channel_id: u64

The ID of the channel.

§message_id: u64

The ID of the message.

Route information to pin a message to a channel.

§

RemoveMember

Fields

§guild_id: u64

The ID of the guild.

§user_id: u64

The ID of the user.

Route information to remove a member from a guild.

§

RemoveMemberRole

Fields

§guild_id: u64

The ID of the guild.

§role_id: u64

The ID of the role.

§user_id: u64

The ID of the user.

Route information to remove a role from a member.

§

RemoveThreadMember

Fields

§channel_id: u64

ID of the thread.

§user_id: u64

ID of the member.

Route information to remove a member from a thread.

§

SearchGuildMembers

Fields

§guild_id: u64

ID of the guild to search in.

§limit: Option<u16>

Upper limit of members to query for.

§query: &'a str

Query to search by.

Route information to search for members in a guild.

§

SetGlobalCommands

Fields

§application_id: u64

The ID of the owner application.

Route information to set global commands.

§

SetGuildCommands

Fields

§application_id: u64

The ID of the owner application.

§guild_id: u64

The ID of the guild.

Route information to set guild commands.

§

SyncGuildIntegration

Fields

§guild_id: u64

The ID of the guild.

§integration_id: u64

The ID of the integration.

Route information to sync a guild’s integration.

§

SyncTemplate

Fields

§guild_id: u64

The ID of the guild.

§template_code: &'a str

The template code.

Route information to sync a template.

§

UnpinMessage

Fields

§channel_id: u64

The ID of the channel.

§message_id: u64

The ID of the message.

Route information to unpin a message from a channel.

§

UpdateAutoModerationRule

Fields

§auto_moderation_rule_id: u64

ID of the auto moderation rule.

§guild_id: u64

ID of the guild.

Route information to update an auto moderation rule for a guild.

§

UpdateChannel

Fields

§channel_id: u64

The ID of the channel.

Route information to update a channel, such as a guild channel or group.

§

UpdateCommandPermissions

Fields

§application_id: u64

The ID of the application.

§command_id: u64

The ID of the command.

§guild_id: u64

The ID of the guild.

Route information to edit permissions of a command in a guild.

§

UpdateCurrentMember

Fields

§guild_id: u64

ID of the guild.

Route information to update the current member.

§

UpdateCurrentUser

Route information to update the current user.

§

UpdateCurrentUserVoiceState

Fields

§guild_id: u64

ID of the guild.

Route information to update the current user’s voice state.

§

UpdateEmoji

Fields

§emoji_id: u64

The ID of the emoji.

§guild_id: u64

The ID of the guild.

Route information to update an emoji.

§

UpdateGlobalCommand

Fields

§application_id: u64

The ID of the owner application.

§command_id: u64

The ID of the command.

Route information to update a global command.

§

UpdateGuild

Fields

§guild_id: u64

The ID of the guild.

Route information to update a guild.

§

UpdateGuildChannels

Fields

§guild_id: u64

The ID of the guild.

Route information to update a guild channel.

§

UpdateGuildCommand

Fields

§application_id: u64

The ID of the owner application.

§command_id: u64

The ID of the command.

§guild_id: u64

The ID of the guild.

Route information to update a guild command.

§

UpdateGuildIntegration

Fields

§guild_id: u64

The ID of the guild.

§integration_id: u64

The ID of the integration.

Route information to update a guild’s integration.

§

UpdateGuildMfa

Fields

§guild_id: u64

ID of the guild.

Route information to update a guild’s MFA level.

§

UpdateGuildScheduledEvent

Fields

§guild_id: u64

ID of the guild.

§scheduled_event_id: u64

ID of the scheduled event.

Route information to update a scheduled event in a guild.

§

UpdateGuildSticker

Fields

§guild_id: u64

ID of the guild.

§sticker_id: u64

ID of the sticker.

Route information to update a guild sticker.

§

UpdateGuildWelcomeScreen

Fields

§guild_id: u64

ID of the guild.

Route information to update a guild’s welcome screen.

§

UpdateGuildWidgetSettings

Fields

§guild_id: u64

ID of the guild.

Route information to update a guild’s widget settings.

§

UpdateInteractionOriginal

Fields

§application_id: u64

The ID of the owner application.

§interaction_token: &'a str

The token for the interaction.

Update the original interaction response.

§

UpdateMember

Fields

§guild_id: u64

The ID of the guild.

§user_id: u64

The ID of the user.

Route information to update a member.

§

UpdateMessage

Fields

§channel_id: u64

The ID of the channel.

§message_id: u64

The ID of the message.

Route information to update a message.

§

UpdateNickname

Fields

§guild_id: u64

The ID of the guild.

Route information to update the current member’s nickname.

§

UpdatePermissionOverwrite

Fields

§channel_id: u64

The ID of the channel.

§target_id: u64

The ID of the role or user.

Route information to update the permission overwrite of a role or user in a channel.

§

UpdateRole

Fields

§guild_id: u64

The ID of the guild.

§role_id: u64

The ID of the role.

Route information to update a role.

§

UpdateRolePositions

Fields

§guild_id: u64

The ID of the guild.

Route information to update the positions of roles.

§

UpdateStageInstance

Fields

§channel_id: u64

ID of the stage channel.

Route information to update an existing stage instance.

§

UpdateTemplate

Fields

§guild_id: u64

The ID of the guild.

§template_code: &'a str

The template code.

Route information to update a template.

§

UpdateUserVoiceState

Fields

§guild_id: u64

ID of the guild.

§user_id: u64

ID of the user.

Route information to update a user’s voice state.

§

UpdateWebhook

Fields

§token: Option<&'a str>

The token of the webhook.

§webhook_id: u64

The ID of the webhook.

Route information to update a webhook.

§

UpdateWebhookMessage

Fields

§message_id: u64
§thread_id: Option<u64>

ID of the thread channel, if there is one.

§token: &'a str
§webhook_id: u64

Route information to update a message created by a webhook.

Implementations§

source§

impl<'a> Route<'a>

source

pub const fn method(&self) -> Method

HTTP method of the route.

Examples

Assert that the GetGuild route returns Method::Get:

use twilight_http::{request::Method, routing::Route};

let route = Route::GetGuild {
    guild_id: 123,
    with_counts: false,
};

assert_eq!(Method::Get, route.method());
source

pub fn to_path(&self) -> Path

Typed path of the route.

Paths are used with a Ratelimiter.

Examples

Use a route’s path to retrieve a ratelimiter ticket:

use twilight_http::routing::Route;
use twilight_http_ratelimiting::{InMemoryRatelimiter, Ratelimiter};

let ratelimiter = InMemoryRatelimiter::new();
let route = Route::CreateMessage { channel_id: 123 };

// Take a ticket from the ratelimiter.
let rx = ratelimiter.ticket(route.to_path()).await?;

// Wait to be told that a request can be made...
let _tx = rx.await;

// The request can now be made.

Trait Implementations§

source§

impl<'a> Clone for Route<'a>

source§

fn clone(&self) -> Route<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for Route<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Route<'_>

Display formatter of the route portion of a URL.

Examples

Create a formatted representation of the GetPins route:

use twilight_http::routing::Route;

let route = Route::GetPins { channel_id: 123 };
assert_eq!("channels/123/pins", route.to_string());

Create a formatted representation of the GetInvite route, which includes a query parameter:

use twilight_http::routing::Route;

let route = Route::GetInvite {
    code: "twilight-rs",
    with_counts: true,
};

assert_eq!("invites/twilight-rs?with_counts=true", route.to_string());
source§

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult

Formats the value using the given formatter. Read more
source§

impl<'a> Hash for Route<'a>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a> PartialEq<Route<'a>> for Route<'a>

source§

fn eq(&self, other: &Route<'a>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> Eq for Route<'a>

source§

impl<'a> StructuralEq for Route<'a>

source§

impl<'a> StructuralPartialEq for Route<'a>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Route<'a>

§

impl<'a> Send for Route<'a>

§

impl<'a> Sync for Route<'a>

§

impl<'a> Unpin for Route<'a>

§

impl<'a> UnwindSafe for Route<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more