Enum twilight_http::routing::Route[][src]

#[non_exhaustive]
pub enum Route {
Show variants AddGuildMember { guild_id: u64, user_id: u64, }, AddMemberRole { guild_id: u64, role_id: u64, user_id: u64, }, CreateBan { delete_message_days: Option<u64>, guild_id: u64, reason: Option<String>, user_id: u64, }, CreateChannel { guild_id: u64, }, CreateEmoji { guild_id: u64, }, CreateGlobalCommand { application_id: u64, }, CreateGuild, CreateGuildCommand { application_id: u64, guild_id: u64, }, CreateGuildFromTemplate { template_code: String, }, CreateGuildIntegration { guild_id: u64, }, CreateGuildPrune { compute_prune_count: Option<bool>, days: Option<u64>, guild_id: u64, include_roles: Vec<u64>, }, CreateInvite { channel_id: u64, }, CreateMessage { channel_id: u64, }, CreatePrivateChannel, CreateReaction { channel_id: u64, emoji: String, message_id: u64, }, CreateRole { guild_id: u64, }, CreateStageInstance, CreateTemplate { guild_id: u64, }, CreateTypingTrigger { channel_id: u64, }, CreateWebhook { channel_id: u64, }, CrosspostMessage { channel_id: u64, message_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, }, DeleteInvite { code: String, }, DeleteInteractionOriginal { application_id: u64, interaction_token: String, }, DeleteMessage { channel_id: u64, message_id: u64, }, DeleteMessages { channel_id: u64, }, DeleteMessageReactions { channel_id: u64, message_id: u64, }, DeleteMessageSpecificReaction { channel_id: u64, emoji: String, message_id: u64, }, DeletePermissionOverwrite { channel_id: u64, target_id: u64, }, DeleteReaction { channel_id: u64, emoji: String, message_id: u64, user: String, }, DeleteRole { guild_id: u64, role_id: u64, }, DeleteStageInstance { channel_id: u64, }, DeleteTemplate { guild_id: u64, template_code: String, }, DeleteWebhookMessage { message_id: u64, token: String, webhook_id: u64, }, DeleteWebhook { token: Option<String>, webhook_id: u64, }, ExecuteWebhook { token: String, wait: Option<bool>, webhook_id: u64, }, FollowNewsChannel { channel_id: u64, }, GetAuditLogs { action_type: Option<u64>, before: Option<u64>, guild_id: u64, limit: Option<u64>, user_id: Option<u64>, }, GetBan { guild_id: u64, user_id: u64, }, GetBans { 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, }, GetCurrentUserApplicationInfo, GetEmoji { emoji_id: u64, guild_id: u64, }, GetEmojis { guild_id: u64, }, GetGateway, GetGatewayBot, GetGlobalCommands { application_id: u64, }, GetGuild { guild_id: u64, with_counts: bool, }, GetGuildCommandPermissions { application_id: u64, guild_id: u64, }, GetGuildCommands { application_id: u64, guild_id: u64, }, GetGuildWidget { guild_id: u64, }, GetGuildIntegrations { guild_id: u64, }, GetGuildInvites { guild_id: u64, }, GetGuildMembers { after: Option<u64>, guild_id: u64, limit: Option<u64>, presences: Option<bool>, }, GetGuildPreview { guild_id: u64, }, GetGuildPruneCount { days: Option<u64>, guild_id: u64, include_roles: Vec<u64>, }, GetGuildRoles { guild_id: u64, }, GetGuildVanityUrl { guild_id: u64, }, GetGuildVoiceRegions { guild_id: u64, }, GetGuildWelcomeScreen { guild_id: u64, }, GetGuildWebhooks { guild_id: u64, }, GetGuilds { after: Option<u64>, before: Option<u64>, limit: Option<u64>, }, GetInteractionOriginal { application_id: u64, interaction_token: String, }, GetInvite { code: String, with_counts: bool, }, GetInviteWithExpiration { code: String, with_counts: bool, with_expiration: bool, }, 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<u64>, }, GetPins { channel_id: u64, }, GetReactionUsers { after: Option<u64>, channel_id: u64, emoji: String, limit: Option<u64>, message_id: u64, }, GetStageInstance { channel_id: u64, }, GetTemplate { template_code: String, }, GetTemplates { guild_id: u64, }, GetUser { target_user: String, }, GetUserConnections, GetUserPrivateChannels, GetVoiceRegions, GetWebhook { token: Option<String>, webhook_id: u64, }, GetWebhookMessage { message_id: u64, token: String, webhook_id: u64, }, InteractionCallback { interaction_id: u64, interaction_token: String, }, LeaveGuild { guild_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, }, SearchGuildMembers { guild_id: u64, limit: Option<u64>, query: String, }, SetCommandPermissions { application_id: u64, guild_id: u64, }, SetGlobalCommands { application_id: u64, }, SetGuildCommands { application_id: u64, guild_id: u64, }, SyncGuildIntegration { guild_id: u64, integration_id: u64, }, SyncTemplate { guild_id: u64, template_code: String, }, UnpinMessage { channel_id: u64, message_id: u64, }, UpdateChannel { channel_id: u64, }, UpdateCommandPermissions { application_id: u64, command_id: u64, 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, }, UpdateGuildWidget { guild_id: u64, }, UpdateGuildIntegration { guild_id: u64, integration_id: u64, }, UpdateGuildWelcomeScreen { guild_id: u64, }, UpdateInteractionOriginal { application_id: u64, interaction_token: String, }, 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: String, }, UpdateUserVoiceState { guild_id: u64, user_id: u64, }, UpdateWebhookMessage { message_id: u64, token: String, webhook_id: u64, }, UpdateWebhook { token: Option<String>, 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

Route information to add a user to a guild.

Show fields

Fields of AddGuildMember

guild_id: u64user_id: u64
AddMemberRole

Route information to add a role to guild member.

Show fields

Fields of AddMemberRole

guild_id: u64

The ID of the guild.

role_id: u64

The ID of the role.

user_id: u64

The ID of the user.

CreateBan

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

Show fields

Fields of CreateBan

delete_message_days: Option<u64>

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

guild_id: u64

The ID of the guild.

reason: Option<String>

The reason for the ban.

user_id: u64

The ID of the user.

CreateChannel

Route information to create a channel in a guild.

Show fields

Fields of CreateChannel

guild_id: u64

The ID of the guild.

CreateEmoji

Route information to create an emoji in a guild.

Show fields

Fields of CreateEmoji

guild_id: u64

The ID of the guild.

CreateGlobalCommand

Route information to create a global command.

Show fields

Fields of CreateGlobalCommand

application_id: u64

The ID of the owner application.

CreateGuild

Route information to create a guild.

CreateGuildCommand

Route information to create a guild command.

Show fields

Fields of CreateGuildCommand

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.

Show fields

Fields of CreateGuildFromTemplate

template_code: String

Code of the template.

CreateGuildIntegration

Route information to create a guild’s integration.

Show fields

Fields of CreateGuildIntegration

guild_id: u64

The ID of the guild.

CreateGuildPrune

Route information to create a prune in a guild.

Show fields

Fields of CreateGuildPrune

compute_prune_count: Option<bool>

Whether to compute the number of pruned users.

days: Option<u64>

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: Vec<u64>

The roles to filter the prune by.

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

CreateInvite

Route information to create an invite to a channel.

Show fields

Fields of CreateInvite

channel_id: u64

The ID of the channel.

CreateMessage

Route information to create a message in a channel.

Show fields

Fields of CreateMessage

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.

Show fields

Fields of CreateReaction

channel_id: u64

The ID of the channel.

emoji: String

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.

Show fields

Fields of CreateRole

guild_id: u64

The ID of the guild.

CreateStageInstance

Route information to create a stage instance.

CreateTemplate

Route information to create a guild template.

Show fields

Fields of CreateTemplate

guild_id: u64

The ID of the guild.

CreateTypingTrigger

Route information to create a typing trigger in a channel.

Show fields

Fields of CreateTypingTrigger

channel_id: u64

The ID of the channel.

CreateWebhook

Route information to create a webhook in a channel.

Show fields

Fields of CreateWebhook

channel_id: u64

The ID of the channel.

CrosspostMessage

Route information to crosspost a message to following guilds.

Show fields

Fields of CrosspostMessage

channel_id: u64

The ID of the channel.

message_id: u64

The ID of the message.

DeleteBan

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

Show fields

Fields of DeleteBan

guild_id: u64

The ID of the guild.

user_id: u64

The ID of the user.

DeleteChannel

Route information to delete a channel.

Show fields

Fields of DeleteChannel

channel_id: u64

The ID of the channel.

DeleteEmoji

Route information to delete a guild’s custom emoji.

Show fields

Fields of DeleteEmoji

emoji_id: u64

The ID of the emoji.

guild_id: u64

The ID of the guild.

DeleteGlobalCommand

Route information to delete a global command.

Show fields

Fields of DeleteGlobalCommand

application_id: u64

The ID of the owner application.

command_id: u64

The ID of the command.

DeleteGuild

Route information to delete a guild.

Show fields

Fields of DeleteGuild

guild_id: u64

The ID of the guild.

DeleteGuildCommand

Route information to delete a guild command.

Show fields

Fields of DeleteGuildCommand

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.

Show fields

Fields of DeleteGuildIntegration

guild_id: u64

The ID of the guild.

integration_id: u64

The ID of the integration.

DeleteInvite

Route information to delete an invite.

Show fields

Fields of DeleteInvite

code: String

The unique invite code.

DeleteInteractionOriginal

Route information to delete the original interaction response.

Show fields

Fields of DeleteInteractionOriginal

application_id: u64

The ID of the owner application

interaction_token: String

The token of the interaction.

DeleteMessage

Route information to delete a channel’s message.

Show fields

Fields of DeleteMessage

channel_id: u64

The ID of the channel.

message_id: u64

The ID of the message.

DeleteMessages

Route information to bulk delete messages in a channel.

Show fields

Fields of DeleteMessages

channel_id: u64

The ID of the channel.

DeleteMessageReactions

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

Show fields

Fields of DeleteMessageReactions

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.

Show fields

Fields of DeleteMessageSpecificReaction

channel_id: u64

The ID of the channel.

emoji: String

The URI encoded custom or unicode emoji.

message_id: u64

The ID of the message.

DeletePermissionOverwrite

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

Show fields

Fields of DeletePermissionOverwrite

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.

Show fields

Fields of DeleteReaction

channel_id: u64

The ID of the channel.

emoji: String

The URI encoded custom or unicode emoji.

message_id: u64

The ID of the message.

user: String

The ID of the user. This can be @me to specify the current user.

DeleteRole

Route information to delete a guild’s role.

Show fields

Fields of DeleteRole

guild_id: u64

The ID of the guild.

role_id: u64

The ID of the role.

DeleteStageInstance

Route information to delete a stage instance.

Show fields

Fields of DeleteStageInstance

channel_id: u64

ID of the stage channel.

DeleteTemplate

Route information to delete a guild template.

Show fields

Fields of DeleteTemplate

guild_id: u64

The ID of the guild.

template_code: String

The target template code.

DeleteWebhookMessage

Route information to delete a message created by a webhook.

Show fields

Fields of DeleteWebhookMessage

message_id: u64token: Stringwebhook_id: u64
DeleteWebhook

Route information to delete a webhook.

Show fields

Fields of DeleteWebhook

token: Option<String>

The token of the webhook.

webhook_id: u64

The ID of the webhook.

ExecuteWebhook

Route information to execute a webhook by ID and token.

Show fields

Fields of ExecuteWebhook

token: String

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.

Show fields

Fields of FollowNewsChannel

channel_id: u64

The ID of the channel to follow.

GetAuditLogs

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

Show fields

Fields of GetAuditLogs

action_type: Option<u64>

The type of action to get audit logs for.

before: Option<u64>

The maximum ID of audit logs to get.

guild_id: u64

The ID of the guild.

limit: Option<u64>

The maximum number of audit logs to get.

user_id: Option<u64>

The ID of the user, if specified.

GetBan

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

Show fields

Fields of GetBan

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.

Show fields

Fields of GetBans

guild_id: u64

The ID of the guild.

GetChannel

Route information to get a channel.

Show fields

Fields of GetChannel

channel_id: u64

The ID of the channel.

GetChannelInvites

Route information to get a channel’s invites.

Show fields

Fields of GetChannelInvites

channel_id: u64

The ID of the channel.

GetChannelWebhooks

Route information to get a channel’s webhooks.

Show fields

Fields of GetChannelWebhooks

channel_id: u64

The ID of the channel.

GetChannels

Route information to get a guild’s channels.

Show fields

Fields of GetChannels

guild_id: u64

The ID of the guild.

GetCommandPermissions

Route information to get permissions of a specific guild command.

Show fields

Fields of GetCommandPermissions

application_id: u64

The ID of the application.

command_id: u64

The ID of the command.

guild_id: u64

The ID of the guild.

GetCurrentUserApplicationInfo

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

GetEmoji

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

Show fields

Fields of GetEmoji

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.

Show fields

Fields of GetEmojis

guild_id: u64

The ID of the guild.

GetGateway

Route information to get basic gateway information.

GetGatewayBot

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

GetGlobalCommands
Show fields

Fields of GetGlobalCommands

application_id: u64

The ID of the owner application.

GetGuild

Route information to get a guild.

Show fields

Fields of GetGuild

guild_id: u64

The ID of the guild.

with_counts: bool

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

GetGuildCommandPermissions

Route information to get permissions of all guild commands.

Show fields

Fields of GetGuildCommandPermissions

application_id: u64

The ID of the application.

guild_id: u64

The ID of the guild.

GetGuildCommands

Route information to get guild commands.

Show fields

Fields of GetGuildCommands

application_id: u64

The ID of the owner application.

guild_id: u64

The ID of the guild.

GetGuildWidget

Route information to get a guild’s widget.

Show fields

Fields of GetGuildWidget

guild_id: u64

The ID of the guild.

GetGuildIntegrations

Route information to get a guild’s integrations.

Show fields

Fields of GetGuildIntegrations

guild_id: u64

The ID of the guild.

GetGuildInvites

Route information to get a guild’s invites.

Show fields

Fields of GetGuildInvites

guild_id: u64

The ID of the guild.

GetGuildMembers

Route information to get a guild’s members.

Show fields

Fields of GetGuildMembers

after: Option<u64>

The minimum ID of members to get.

guild_id: u64

The ID of the guild.

limit: Option<u64>

The maximum number of members to get.

presences: Option<bool>

Whether to get the members’ presences.

GetGuildPreview

Route information to get a guild’s preview.

Show fields

Fields of GetGuildPreview

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.

Show fields

Fields of GetGuildPruneCount

days: Option<u64>

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: Vec<u64>

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.

Show fields

Fields of GetGuildRoles

guild_id: u64

The ID of the guild.

GetGuildVanityUrl

Route information to get a guild’s vanity URL.

Show fields

Fields of GetGuildVanityUrl

guild_id: u64

The ID of the guild.

GetGuildVoiceRegions

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

Show fields

Fields of GetGuildVoiceRegions

guild_id: u64

The ID of the guild.

GetGuildWelcomeScreen

Route information to get a guild’s welcome screen.

Show fields

Fields of GetGuildWelcomeScreen

guild_id: u64

ID of the guild.

GetGuildWebhooks

Route information to get a guild’s webhooks.

Show fields

Fields of GetGuildWebhooks

guild_id: u64

The ID of the guild.

GetGuilds

Route information to get a paginated list of guilds.

Show fields

Fields of GetGuilds

after: Option<u64>

The minimum ID of guilds to get.

before: Option<u64>

The maximum ID of guilds to get.

limit: Option<u64>

The maximum number of guilds to get.

GetInteractionOriginal

Route information to get an original interaction response message.

Show fields

Fields of GetInteractionOriginal

application_id: u64

ID of the owner application.

interaction_token: String

Token of the interaction.

GetInvite

Route information to get an invite.

Show fields

Fields of GetInvite

code: String

The unique invite code.

with_counts: bool

Whether to retrieve statistics about the invite.

GetInviteWithExpiration

Route information to get an invite with an expiration.

Show fields

Fields of GetInviteWithExpiration

code: String

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.

GetMember

Route information to get a member.

Show fields

Fields of GetMember

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.

Show fields

Fields of GetMessage

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.

Show fields

Fields of GetMessages

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<u64>

The maximum number of messages to get.

GetPins

Route information to get a channel’s pins.

Show fields

Fields of GetPins

channel_id: u64

The ID of the channel.

GetReactionUsers

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

Show fields

Fields of GetReactionUsers

after: Option<u64>

The minimum ID of users to get.

channel_id: u64

The ID of the channel.

emoji: String

The URI encoded custom or unicode emoji.

limit: Option<u64>

The maximum number of users to retrieve.

message_id: u64

The ID of the message.

GetStageInstance

Route information to get a stage instance.

Show fields

Fields of GetStageInstance

channel_id: u64

ID of the stage channel.

GetTemplate

Route information to get a template.

Show fields

Fields of GetTemplate

template_code: String

The template code.

GetTemplates

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

Show fields

Fields of GetTemplates

guild_id: u64

The ID of the guild.

GetUser

Route information to get the current user.

Show fields

Fields of GetUser

target_user: String

The ID of the target user. This can be @me to specify the current 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.

Show fields

Fields of GetWebhook

token: Option<String>

The token of the webhook.

webhook_id: u64

The ID of the webhook.

GetWebhookMessage

Route information to get a previously-sent webhook message.

Show fields

Fields of GetWebhookMessage

message_id: u64

ID of the message.

token: String

Token of the webhook.

webhook_id: u64

ID of the webhook.

InteractionCallback

Route information to respond to an interaction.

Show fields

Fields of InteractionCallback

interaction_id: u64

The ID of the interaction.

interaction_token: String

The token for the interaction.

LeaveGuild

Route information to leave the guild.

Show fields

Fields of LeaveGuild

guild_id: u64

The ID of the guild.

PinMessage

Route information to pin a message to a channel.

Show fields

Fields of PinMessage

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.

Show fields

Fields of RemoveMember

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.

Show fields

Fields of RemoveMemberRole

guild_id: u64

The ID of the guild.

role_id: u64

The ID of the role.

user_id: u64

The ID of the user.

SearchGuildMembers

Route information to search for members in a guild.

Show fields

Fields of SearchGuildMembers

guild_id: u64

ID of the guild to search in.

limit: Option<u64>

Upper limit of members to query for.

query: String

Query to search by.

SetCommandPermissions

Route information to set permissions of commands in a guild.

Show fields

Fields of SetCommandPermissions

application_id: u64

The ID of the owner application.

guild_id: u64

The ID of the guild.

SetGlobalCommands

Route information to set global commands.

Show fields

Fields of SetGlobalCommands

application_id: u64

The ID of the owner application.

SetGuildCommands

Route information to set guild commands.

Show fields

Fields of SetGuildCommands

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.

Show fields

Fields of SyncGuildIntegration

guild_id: u64

The ID of the guild.

integration_id: u64

The ID of the integration.

SyncTemplate

Route information to sync a template.

Show fields

Fields of SyncTemplate

guild_id: u64

The ID of the guild.

template_code: String

The template code.

UnpinMessage

Route information to unpin a message from a channel.

Show fields

Fields of UnpinMessage

channel_id: u64

The ID of the channel.

message_id: u64

The ID of the message.

UpdateChannel

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

Show fields

Fields of UpdateChannel

channel_id: u64

The ID of the channel.

UpdateCommandPermissions

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

Show fields

Fields of UpdateCommandPermissions

application_id: u64

The ID of the application.

command_id: u64

The ID of the command.

guild_id: u64

The ID of the guild.

UpdateCurrentUser

Route information to update the current user.

UpdateCurrentUserVoiceState

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

Show fields

Fields of UpdateCurrentUserVoiceState

guild_id: u64

ID of the guild.

UpdateEmoji

Route information to update an emoji.

Show fields

Fields of UpdateEmoji

emoji_id: u64

The ID of the emoji.

guild_id: u64

The ID of the guild.

UpdateGlobalCommand

Route information to update a global command.

Show fields

Fields of UpdateGlobalCommand

application_id: u64

The ID of the owner application.

command_id: u64

The ID of the command.

UpdateGuild

Route information to update a guild.

Show fields

Fields of UpdateGuild

guild_id: u64

The ID of the guild.

UpdateGuildChannels

Route information to update a guild channel.

Show fields

Fields of UpdateGuildChannels

guild_id: u64

The ID of the guild.

UpdateGuildCommand

Route information to update a guild command.

Show fields

Fields of UpdateGuildCommand

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.

UpdateGuildWidget

Route information to update a guild’s widget.

Show fields

Fields of UpdateGuildWidget

guild_id: u64

The ID of the guild.

UpdateGuildIntegration

Route information to update a guild’s integration.

Show fields

Fields of UpdateGuildIntegration

guild_id: u64

The ID of the guild.

integration_id: u64

The ID of the integration.

UpdateGuildWelcomeScreen

Route information to update a guild’s welcome screen.

Show fields

Fields of UpdateGuildWelcomeScreen

guild_id: u64

ID of the guild.

UpdateInteractionOriginal

Update the original interaction response.

Show fields

Fields of UpdateInteractionOriginal

application_id: u64

The ID of the owner application.

interaction_token: String

The token for the interaction.

UpdateMember

Route information to update a member.

Show fields

Fields of UpdateMember

guild_id: u64

The ID of the guild.

user_id: u64

The ID of the user.

UpdateMessage

Route information to update a message.

Show fields

Fields of UpdateMessage

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.

Show fields

Fields of UpdateNickname

guild_id: u64

The ID of the guild.

UpdatePermissionOverwrite

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

Show fields

Fields of UpdatePermissionOverwrite

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.

Show fields

Fields of UpdateRole

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.

Show fields

Fields of UpdateRolePositions

guild_id: u64

The ID of the guild.

UpdateStageInstance

Route information to update an existing stage instance.

Show fields

Fields of UpdateStageInstance

channel_id: u64

ID of the stage channel.

UpdateTemplate

Route information to update a template.

Show fields

Fields of UpdateTemplate

guild_id: u64

The ID of the guild.

template_code: String

The template code.

UpdateUserVoiceState

Route information to update a user’s voice state.

Show fields

Fields of UpdateUserVoiceState

guild_id: u64

ID of the guild.

user_id: u64

ID of the user.

UpdateWebhookMessage

Route information to update a message created by a webhook.

Show fields

Fields of UpdateWebhookMessage

message_id: u64token: Stringwebhook_id: u64
UpdateWebhook

Route information to update a webhook.

Show fields

Fields of UpdateWebhook

token: Option<String>

The token of the webhook.

webhook_id: u64

The ID of the webhook.

Implementations

👎 Deprecated since 0.5.1:

use the individual display, method, and path methods

Separate a route into its parts: the HTTP method, the path enum to use for ratelimit buckets, and the URI path.

The method and URI path are useful for actually performing requests, while the returned path enum is useful for ratelimiting.

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.display().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".to_owned(),
    with_counts: true,
};

assert_eq!(
    "invites/twilight-rs?with-counts=true",
    route.display().to_string(),
);

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());

Typed path of the route.

Paths are used with the Ratelimiter.

Examples

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

use twilight_http::{ratelimiting::Ratelimiter, routing::Route};

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

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

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

// The request can now be made.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Feeds this value into the given Hasher. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

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

Performs the conversion.

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

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

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.