Enum twilight_http::routing::Route

source ·
#[non_exhaustive]
pub enum Route<'a> {
Show 169 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 { 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, }, UpdateGuildOnboarding { 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, }, UpdateCurrentUserApplication,
}

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

Route information to add a user to a guild.

Fields

§guild_id: u64
§user_id: u64
§

AddMemberRole

Route information to add a role to guild member.

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.

§

AddThreadMember

Route information to add a member to a thread.

Fields

§channel_id: u64

ID of the thread.

§user_id: u64

ID of the member.

§

CreateAutoModerationRule

Route information to create an auto moderation rule.

Fields

§guild_id: u64

ID of the guild.

§

CreateBan

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

Fields

§guild_id: u64

The ID of the guild.

§user_id: u64

The ID of the user.

§

CreateChannel

Route information to create a channel in a guild.

Fields

§guild_id: u64

The ID of the guild.

§

CreateEmoji

Route information to create an emoji in a guild.

Fields

§guild_id: u64

The ID of the guild.

§

CreateForumThread

Route information to create a thread in a forum channel.

Fields

§channel_id: u64

The ID of the channel.

§

CreateGlobalCommand

Route information to create a global command.

Fields

§application_id: u64

The ID of the owner application.

§

CreateGuild

Route information to create a guild.

§

CreateGuildCommand

Route information to create a guild command.

Fields

§application_id: u64

The ID of the owner application.

§guild_id: u64

The ID of the guild.

§

CreateGuildFromTemplate

Route information to create a guild from a template.

Fields

§template_code: &'a str

Code of the template.

§

CreateGuildIntegration

Route information to create a guild’s integration.

Fields

§guild_id: u64

The ID of the guild.

§

CreateGuildPrune

Route information to create a prune in a guild.

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.

§

CreateGuildScheduledEvent

Route information to create a scheduled event in a guild.

Fields

§guild_id: u64

ID of the guild.

§

CreateGuildSticker

Route information to create a sticker in a guild.

Fields

§guild_id: u64

ID of the guild.

§

CreateInvite

Route information to create an invite to a channel.

Fields

§channel_id: u64

The ID of the channel.

§

CreateMessage

Route information to create a message in a channel.

Fields

§channel_id: u64

The ID of the channel.

§

CreatePrivateChannel

Route information to create a private channel.

§

CreateReaction

Route information to create a reaction on a message.

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.

§

CreateRole

Route information to create a role in a guild.

Fields

§guild_id: u64

The ID of the guild.

§

CreateStageInstance

Route information to create a stage instance.

§

CreateTemplate

Route information to create a guild template.

Fields

§guild_id: u64

The ID of the guild.

§

CreateThread

Route information to create a thread in a channel.

Fields

§channel_id: u64

ID of the channel.

§

CreateThreadFromMessage

Route information to create a thread from a message.

Fields

§channel_id: u64

ID of the channel.

§message_id: u64

ID of the message.

§

CreateTypingTrigger

Route information to create a typing trigger in a channel.

Fields

§channel_id: u64

The ID of the channel.

§

CreateWebhook

Route information to create a webhook in a channel.

Fields

§channel_id: u64

The ID of the channel.

§

CrosspostMessage

Route information to crosspost a message to following guilds.

Fields

§channel_id: u64

The ID of the channel.

§message_id: u64

The ID of the message.

§

DeleteAutoModerationRule

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

Fields

§guild_id: u64

ID of the guild.

§auto_moderation_rule_id: u64

ID of the auto moderation rule.

§

DeleteBan

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

Fields

§guild_id: u64

The ID of the guild.

§user_id: u64

The ID of the user.

§

DeleteChannel

Route information to delete a channel.

Fields

§channel_id: u64

The ID of the channel.

§

DeleteEmoji

Route information to delete a guild’s custom emoji.

Fields

§emoji_id: u64

The ID of the emoji.

§guild_id: u64

The ID of the guild.

§

DeleteGlobalCommand

Route information to delete a global command.

Fields

§application_id: u64

The ID of the owner application.

§command_id: u64

The ID of the command.

§

DeleteGuild

Route information to delete a guild.

Fields

§guild_id: u64

The ID of the guild.

§

DeleteGuildCommand

Route information to delete a guild command.

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.

§

DeleteGuildIntegration

Route information to delete a guild integration.

Fields

§guild_id: u64

The ID of the guild.

§integration_id: u64

The ID of the integration.

§

DeleteGuildScheduledEvent

Route information to delete a scheduled event in a guild.

Fields

§guild_id: u64

ID of the guild.

§scheduled_event_id: u64

ID of the scheduled event.

§

DeleteGuildSticker

Route information to delete a guild sticker.

Fields

§guild_id: u64

ID of the guild.

§sticker_id: u64

ID of the sticker.

§

DeleteInteractionOriginal

Route information to delete the original interaction response.

Fields

§application_id: u64

The ID of the owner application

§interaction_token: &'a str

The token of the interaction.

§

DeleteInvite

Route information to delete an invite.

Fields

§code: &'a str

The unique invite code.

§

DeleteMessage

Route information to delete a channel’s message.

Fields

§channel_id: u64

The ID of the channel.

§message_id: u64

The ID of the message.

§

DeleteMessageReactions

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

Fields

§channel_id: u64

The ID of the channel.

§message_id: u64

The ID of the message.

§

DeleteMessageSpecificReaction

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

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.

§

DeleteMessages

Route information to bulk delete messages in a channel.

Fields

§channel_id: u64

The ID of the channel.

§

DeletePermissionOverwrite

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

Fields

§channel_id: u64

The ID of the channel.

§target_id: u64

The ID of the target role or user.

§

DeleteReaction

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

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.

§

DeleteReactionCurrentUser

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

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.

§

DeleteRole

Route information to delete a guild’s role.

Fields

§guild_id: u64

The ID of the guild.

§role_id: u64

The ID of the role.

§

DeleteStageInstance

Route information to delete a stage instance.

Fields

§channel_id: u64

ID of the stage channel.

§

DeleteTemplate

Route information to delete a guild template.

Fields

§guild_id: u64

The ID of the guild.

§template_code: &'a str

The target template code.

§

DeleteWebhook

Route information to delete a webhook.

Fields

§token: Option<&'a str>

The token of the webhook.

§webhook_id: u64

The ID of the webhook.

§

DeleteWebhookMessage

Route information to delete a message created by a webhook.

Fields

§message_id: u64
§thread_id: Option<u64>

ID of the thread channel, if there is one.

§token: &'a str
§webhook_id: u64
§

ExecuteWebhook

Route information to execute a webhook by ID and token.

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.

§

FollowNewsChannel

Route information to follow a news channel.

Fields

§channel_id: u64

The ID of the channel to follow.

§

GetActiveThreads

Route information to get active threads in a channel.

Fields

§guild_id: u64

ID of the guild.

§

GetAuditLogs

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

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.

§

GetAutoModerationRule

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

Fields

§guild_id: u64

ID of the guild.

§auto_moderation_rule_id: u64

ID of the auto moderation rule.

§

GetBan

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

Fields

§guild_id: u64

The ID of the guild.

§user_id: u64

The ID of the user.

§

GetBans

Route information to get a guild’s bans.

Fields

§guild_id: u64

The ID of the guild.

§

GetBansWithParameters

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

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.

§

GetChannel

Route information to get a channel.

Fields

§channel_id: u64

The ID of the channel.

§

GetChannelInvites

Route information to get a channel’s invites.

Fields

§channel_id: u64

The ID of the channel.

§

GetChannelWebhooks

Route information to get a channel’s webhooks.

Fields

§channel_id: u64

The ID of the channel.

§

GetChannels

Route information to get a guild’s channels.

Fields

§guild_id: u64

The ID of the guild.

§

GetCommandPermissions

Route information to get permissions of a specific guild command.

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.

§

GetCurrentAuthorizationInformation

Route information to get the current OAuth2 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

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

Fields

§guild_id: u64

ID of the guild.

§

GetEmoji

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

Fields

§emoji_id: u64

The ID of the emoji.

§guild_id: u64

The ID of the guild.

§

GetEmojis

Route information to get a guild’s emojis.

Fields

§guild_id: u64

The ID of the guild.

§

GetFollowupMessage

Route to get a followup message for an interaction.

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.

§

GetGateway

Route information to get basic gateway information.

§

GetGatewayBot

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

§

GetGlobalCommand

Route information to get a global command for an application.

Fields

§application_id: u64

ID of the owner application.

§command_id: u64

ID of the command.

§

GetGlobalCommands

Fields

§application_id: u64

The ID of the owner application.

§with_localizations: Option<bool>

Whether to include full localization dictionaries.

§

GetGuild

Route information to get a guild.

Fields

§guild_id: u64

The ID of the guild.

§with_counts: bool

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

§

GetGuildAutoModerationRules

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

Fields

§guild_id: u64

ID of the guild.

§

GetGuildCommand

Route information to get a guild command.

Fields

§application_id: u64

ID of the owner application.

§command_id: u64

ID of the command.

§guild_id: u64

ID of the guild.

§

GetGuildCommandPermissions

Route information to get permissions of all guild commands.

Fields

§application_id: u64

The ID of the application.

§guild_id: u64

The ID of the guild.

§

GetGuildCommands

Route information to get guild commands.

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.

§

GetGuildIntegrations

Route information to get a guild’s integrations.

Fields

§guild_id: u64

The ID of the guild.

§

GetGuildInvites

Route information to get a guild’s invites.

Fields

§guild_id: u64

The ID of the guild.

§

GetGuildMembers

Route information to get a guild’s members.

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.

§

GetGuildOnboarding

Route information to get a guild’s onboarding information.

Fields

§guild_id: u64

The ID of the guild to get onboarding information for.

§

GetGuildPreview

Route information to get a guild’s preview.

Fields

§guild_id: u64

The ID of the guild.

§

GetGuildPruneCount

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

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.

§

GetGuildRoles

Route information to get a guild’s roles.

Fields

§guild_id: u64

The ID of the guild.

§

GetGuildScheduledEvent

Route information to get a guild scheduled event.

Fields

§guild_id: u64

ID of the guild.

§scheduled_event_id: u64
§with_user_count: bool

Whether to include user counts.

§

GetGuildScheduledEventUsers

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

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.

§

GetGuildScheduledEvents

Route information to get a guild’s scheduled events.

Fields

§guild_id: u64

ID of the guild.

§with_user_count: bool

Whether to include user counts.

§

GetGuildSticker

Route information to get a guild’s sticker.

Fields

§guild_id: u64

ID of the guild.

§sticker_id: u64

ID of the stickers.

§

GetGuildStickers

Route information to get a guild’s stickers.

Fields

§guild_id: u64

ID of the guild.

§

GetGuildVanityUrl

Route information to get a guild’s vanity URL.

Fields

§guild_id: u64

The ID of the guild.

§

GetGuildVoiceRegions

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

Fields

§guild_id: u64

The ID of the guild.

§

GetGuildWebhooks

Route information to get a guild’s webhooks.

Fields

§guild_id: u64

The ID of the guild.

§

GetGuildWelcomeScreen

Route information to get a guild’s welcome screen.

Fields

§guild_id: u64

ID of the guild.

§

GetGuildWidget

Route information to get a guild’s widget.

Fields

§guild_id: u64

ID of the guild.

§

GetGuildWidgetSettings

Route information to get a guild’s widget settings.

Fields

§guild_id: u64

ID of the guild.

§

GetGuilds

Route information to get a paginated list of guilds.

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.

§

GetInteractionOriginal

Route information to get an original interaction response message.

Fields

§application_id: u64

ID of the owner application.

§interaction_token: &'a str

Token of the interaction.

§

GetInvite

Route information to get an invite.

Fields

§code: &'a str

The unique invite code.

§with_counts: bool

Whether to retrieve statistics about the invite.

§

GetInviteWithExpiration

Route information to get an invite with an expiration.

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.

§

GetJoinedPrivateArchivedThreads

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

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.

§

GetMember

Route information to get a member.

Fields

§guild_id: u64

The ID of the guild.

§user_id: u64

The ID of the user.

§

GetMessage

Route information to get a single message in a channel.

Fields

§channel_id: u64

The ID of the channel.

§message_id: u64

The ID of the message.

§

GetMessages

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

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.

§

GetNitroStickerPacks

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

§

GetPins

Route information to get a channel’s pins.

Fields

§channel_id: u64

The ID of the channel.

§

GetPrivateArchivedThreads

Route information to get private archived threads in a channel.

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.

§

GetPublicArchivedThreads

Route information to get public archived threads in a channel.

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.

§

GetReactionUsers

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

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.

§

GetStageInstance

Route information to get a stage instance.

Fields

§channel_id: u64

ID of the stage channel.

§

GetSticker

Route information to get a sticker.

Fields

§sticker_id: u64

ID of the sticker.

§

GetTemplate

Route information to get a template.

Fields

§template_code: &'a str

The template code.

§

GetTemplates

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

Fields

§guild_id: u64

The ID of the guild.

§

GetThreadMember

Route information to get a member of a thread.

Fields

§channel_id: u64

ID of the thread.

§user_id: u64

ID of the member.

§

GetThreadMembers

Route information to get members of a thread.

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.

§

GetUser

Route information to get a user.

Fields

§user_id: u64

ID of the target 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

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

Fields

§token: Option<&'a str>

The token of the webhook.

§webhook_id: u64

The ID of the webhook.

§

GetWebhookMessage

Route information to get a previously-sent webhook message.

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.

§

InteractionCallback

Route information to respond to an interaction.

Fields

§interaction_id: u64

The ID of the interaction.

§interaction_token: &'a str

The token for the interaction.

§

JoinThread

Route information to join a thread as the current user.

Fields

§channel_id: u64

ID of the thread.

§

LeaveGuild

Route information to leave the guild.

Fields

§guild_id: u64

The ID of the guild.

§

LeaveThread

Route information to leave a thread as the current user.

Fields

§channel_id: u64

ID of the thread.

§

PinMessage

Route information to pin a message to a channel.

Fields

§channel_id: u64

The ID of the channel.

§message_id: u64

The ID of the message.

§

RemoveMember

Route information to remove a member from a guild.

Fields

§guild_id: u64

The ID of the guild.

§user_id: u64

The ID of the user.

§

RemoveMemberRole

Route information to remove a role from a member.

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.

§

RemoveThreadMember

Route information to remove a member from a thread.

Fields

§channel_id: u64

ID of the thread.

§user_id: u64

ID of the member.

§

SearchGuildMembers

Route information to search for members in a guild.

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.

§

SetGlobalCommands

Route information to set global commands.

Fields

§application_id: u64

The ID of the owner application.

§

SetGuildCommands

Route information to set guild commands.

Fields

§application_id: u64

The ID of the owner application.

§guild_id: u64

The ID of the guild.

§

SyncGuildIntegration

Route information to sync a guild’s integration.

Fields

§guild_id: u64

The ID of the guild.

§integration_id: u64

The ID of the integration.

§

SyncTemplate

Route information to sync a template.

Fields

§guild_id: u64

The ID of the guild.

§template_code: &'a str

The template code.

§

UnpinMessage

Route information to unpin a message from a channel.

Fields

§channel_id: u64

The ID of the channel.

§message_id: u64

The ID of the message.

§

UpdateAutoModerationRule

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

Fields

§auto_moderation_rule_id: u64

ID of the auto moderation rule.

§guild_id: u64

ID of the guild.

§

UpdateChannel

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

Fields

§channel_id: u64

The ID of the channel.

§

UpdateCommandPermissions

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

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.

§

UpdateCurrentMember

Route information to update the current member.

Fields

§guild_id: u64

ID of the guild.

§

UpdateCurrentUser

Route information to update the current user.

§

UpdateCurrentUserVoiceState

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

Fields

§guild_id: u64

ID of the guild.

§

UpdateEmoji

Route information to update an emoji.

Fields

§emoji_id: u64

The ID of the emoji.

§guild_id: u64

The ID of the guild.

§

UpdateGlobalCommand

Route information to update a global command.

Fields

§application_id: u64

The ID of the owner application.

§command_id: u64

The ID of the command.

§

UpdateGuild

Route information to update a guild.

Fields

§guild_id: u64

The ID of the guild.

§

UpdateGuildChannels

Route information to update a guild channel.

Fields

§guild_id: u64

The ID of the guild.

§

UpdateGuildCommand

Route information to update a guild command.

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.

§

UpdateGuildIntegration

Route information to update a guild’s integration.

Fields

§guild_id: u64

The ID of the guild.

§integration_id: u64

The ID of the integration.

§

UpdateGuildMfa

Route information to update a guild’s MFA level.

Fields

§guild_id: u64

ID of the guild.

§

UpdateGuildOnboarding

Fields

§guild_id: u64

The ID of the guild to update onboarding information for.

§

UpdateGuildScheduledEvent

Route information to update a scheduled event in a guild.

Fields

§guild_id: u64

ID of the guild.

§scheduled_event_id: u64

ID of the scheduled event.

§

UpdateGuildSticker

Route information to update a guild sticker.

Fields

§guild_id: u64

ID of the guild.

§sticker_id: u64

ID of the sticker.

§

UpdateGuildWelcomeScreen

Route information to update a guild’s welcome screen.

Fields

§guild_id: u64

ID of the guild.

§

UpdateGuildWidgetSettings

Route information to update a guild’s widget settings.

Fields

§guild_id: u64

ID of the guild.

§

UpdateInteractionOriginal

Update the original interaction response.

Fields

§application_id: u64

The ID of the owner application.

§interaction_token: &'a str

The token for the interaction.

§

UpdateMember

Route information to update a member.

Fields

§guild_id: u64

The ID of the guild.

§user_id: u64

The ID of the user.

§

UpdateMessage

Route information to update a message.

Fields

§channel_id: u64

The ID of the channel.

§message_id: u64

The ID of the message.

§

UpdateNickname

Route information to update the current member’s nickname.

Fields

§guild_id: u64

The ID of the guild.

§

UpdatePermissionOverwrite

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

Fields

§channel_id: u64

The ID of the channel.

§target_id: u64

The ID of the role or user.

§

UpdateRole

Route information to update a role.

Fields

§guild_id: u64

The ID of the guild.

§role_id: u64

The ID of the role.

§

UpdateRolePositions

Route information to update the positions of roles.

Fields

§guild_id: u64

The ID of the guild.

§

UpdateStageInstance

Route information to update an existing stage instance.

Fields

§channel_id: u64

ID of the stage channel.

§

UpdateTemplate

Route information to update a template.

Fields

§guild_id: u64

The ID of the guild.

§template_code: &'a str

The template code.

§

UpdateUserVoiceState

Route information to update a user’s voice state.

Fields

§guild_id: u64

ID of the guild.

§user_id: u64

ID of the user.

§

UpdateWebhook

Route information to update a webhook.

Fields

§token: Option<&'a str>

The token of the webhook.

§webhook_id: u64

The ID of the webhook.

§

UpdateWebhookMessage

Route information to update a message created by a webhook.

Fields

§message_id: u64
§thread_id: Option<u64>

ID of the thread channel, if there is one.

§token: &'a str
§webhook_id: u64
§

UpdateCurrentUserApplication

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 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> StructuralPartialEq for Route<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Route<'a>

§

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 T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

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

§

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

Checks if this value is equivalent to the given key. Read more
§

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

§

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.

§

impl<T> Instrument for T

§

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

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

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 T
where 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 T
where 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 T
where 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 T
where 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 T
where 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 T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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