Expand description
discord.rs - Standalone Discord bot framework with Components V2, Gateway, and HTTP client
§Features
gateway- Gateway WebSocket client, BotClient, EventHandlerinteractions- HTTP Interactions Endpoint with Ed25519 verification
Re-exports§
pub use cache::CacheConfig;pub use cache::CacheHandle;pub use cache::ChannelManager;pub use cache::GuildManager;pub use cache::MemberManager;pub use cache::MessageManager;pub use cache::RoleManager;pub use cache::UserManager;pub use collection::Collection;pub use command::command_type;pub use command::option_type;pub use command::CommandDefinition;pub use command::CommandOptionBuilder;pub use command::MessageCommandBuilder;pub use command::PrimaryEntryPointCommandBuilder;pub use command::SlashCommandBuilder;pub use command::UserCommandBuilder;pub use error::DiscordError;pub use error::HttpError;pub use event::decode_event;pub use event::AuditLogEntryEvent;pub use event::AutoModerationEvent;pub use event::ChannelEvent;pub use event::ChannelInfoChannel;pub use event::ChannelInfoEvent;pub use event::EntitlementEvent;pub use event::Event;pub use event::GuildDeleteEvent;pub use event::GuildDeletePayload;pub use event::GuildEvent;pub use event::GuildMembersChunkEvent;pub use event::GuildMembersChunkPayload;pub use event::GuildScheduledEventUserEvent;pub use event::GuildStickersUpdateEvent;pub use event::InteractionEvent;pub use event::MemberEvent;pub use event::MemberRemoveEvent;pub use event::MemberRemovePayload;pub use event::MessageDeleteEvent;pub use event::MessageDeletePayload;pub use event::MessageEvent;pub use event::ReactionRemoveEmojiEvent;pub use event::ReadyEvent;pub use event::ReadyPayload;pub use event::ResumedEvent;pub use event::RoleDeleteEvent;pub use event::RoleDeletePayload;pub use event::RoleEvent;pub use event::ScheduledEvent;pub use event::SoundboardSoundDeleteEvent;pub use event::SoundboardSoundEvent;pub use event::SoundboardSoundsEvent;pub use event::StageInstanceEvent;pub use event::ThreadEvent;pub use event::ThreadListSyncEvent;pub use event::ThreadMemberUpdateEvent;pub use event::ThreadMembersUpdateEvent;pub use event::UserUpdateEvent;pub use event::VoiceChannelEffectEvent;pub use event::VoiceChannelStartTimeUpdateEvent;pub use event::VoiceChannelStatusUpdateEvent;pub use event::VoiceServerEvent;pub use event::VoiceStateEvent;pub use manager::CachedManager;pub use model::Activity;pub use model::ActivityAssets;pub use model::ActivityButton;pub use model::ActivityInstance;pub use model::ActivityLocation;pub use model::ActivityParty;pub use model::ActivitySecrets;pub use model::ActivityTimestamps;pub use model::ActivityType;pub use model::AddGroupDmRecipient;pub use model::AddGuildMember;pub use model::AddLobbyMember;pub use model::AllowedMentions;pub use model::Application;pub use model::ApplicationCommand;pub use model::ApplicationCommandHandlerType;pub use model::ApplicationCommandOption;pub use model::ApplicationCommandOptionChoice;pub use model::ApplicationCommandPermission;pub use model::ApplicationInstallParams;pub use model::ApplicationIntegrationType;pub use model::ApplicationIntegrationTypeConfig;pub use model::ApplicationRoleConnectionMetadata;pub use model::ArchivedThreadsQuery;pub use model::Attachment;pub use model::AuditLog;pub use model::AuditLogEntry;pub use model::AuditLogQuery;pub use model::AuthorizationInformation;pub use model::AutoModerationAction;pub use model::AutoModerationActionMetadata;pub use model::AutoModerationRule;pub use model::AutoModerationTriggerMetadata;pub use model::AutocompleteInteraction;pub use model::Ban;pub use model::BeginGuildPruneRequest;pub use model::BulkGuildBanRequest;pub use model::BulkGuildBanResponse;pub use model::Channel;pub use model::ChannelMention;pub use model::ChannelPins;pub use model::ChannelPinsQuery;pub use model::ChatInputCommandInteraction;pub use model::ClientStatus;pub use model::CommandInteractionData;pub use model::CommandInteractionOption;pub use model::ComponentInteraction;pub use model::CreateChannelInvite;pub use model::CreateDmChannel;pub use model::CreateGroupDmChannel;pub use model::CreateGuildBan;pub use model::CreateGuildChannel;pub use model::CreateGuildRole;pub use model::CreateGuildSticker;pub use model::CreateLobby;pub use model::CreateMessage;pub use model::CreatePoll;pub use model::CreateStageInstance;pub use model::CreateTestEntitlement;pub use model::CreateWebhook;pub use model::CurrentUserGuild;pub use model::CurrentUserGuildsQuery;pub use model::DefaultReaction;pub use model::DiscordModel;pub use model::EditApplicationCommandPermissions;pub use model::EditChannelPermission;pub use model::Embed;pub use model::Entitlement;pub use model::EntitlementQuery;pub use model::FollowedChannel;pub use model::ForumTag;pub use model::Gateway;pub use model::GatewayBot;pub use model::GetGuildQuery;pub use model::Guild;pub use model::GuildApplicationCommandPermissions;pub use model::GuildBansQuery;pub use model::GuildIncidentsData;pub use model::GuildMembersQuery;pub use model::GuildOnboarding;pub use model::GuildPreview;pub use model::GuildPruneCount;pub use model::GuildPruneResult;pub use model::GuildScheduledEvent;pub use model::GuildScheduledEventEntityMetadata;pub use model::GuildScheduledEventRecurrenceRule;pub use model::GuildScheduledEventRecurrenceRuleNWeekday;pub use model::GuildScheduledEventUser;pub use model::GuildTemplate;pub use model::GuildWidget;pub use model::GuildWidgetChannel;pub use model::GuildWidgetImageStyle;pub use model::GuildWidgetMember;pub use model::GuildWidgetSettings;pub use model::Integration;pub use model::IntegrationAccount;pub use model::IntegrationApplication;pub use model::Interaction;pub use model::InteractionCallbackResponse;pub use model::InteractionContextData;pub use model::InteractionContextType;pub use model::Invite;pub use model::InviteTargetUsersJobStatus;pub use model::JoinedArchivedThreadsQuery;pub use model::LinkLobbyChannel;pub use model::Lobby;pub use model::LobbyMember;pub use model::LobbyMemberUpdate;pub use model::Member;pub use model::Message;pub use model::MessageActivity;pub use model::MessageCall;pub use model::MessageContextMenuInteraction;pub use model::MessagePin;pub use model::MessageReference;pub use model::MessageSnapshot;pub use model::MessageSnapshotMessage;pub use model::ModalSubmitInteraction;pub use model::ModifyCurrentApplication;pub use model::ModifyCurrentMember;pub use model::ModifyCurrentUser;pub use model::ModifyCurrentUserVoiceState;pub use model::ModifyGuild;pub use model::ModifyGuildChannelPosition;pub use model::ModifyGuildIncidentActions;pub use model::ModifyGuildMember;pub use model::ModifyGuildOnboarding;pub use model::ModifyGuildRole;pub use model::ModifyGuildRolePosition;pub use model::ModifyGuildSticker;pub use model::ModifyGuildWelcomeScreen;pub use model::ModifyGuildWidgetSettings;pub use model::ModifyLobby;pub use model::ModifyStageInstance;pub use model::ModifyUserVoiceState;pub use model::ModifyWebhook;pub use model::ModifyWebhookWithToken;pub use model::PermissionOverwrite;pub use model::PermissionsBitField;pub use model::Poll;pub use model::PollAnswer;pub use model::PollAnswerCount;pub use model::PollAnswerVoters;pub use model::PollMedia;pub use model::PollResults;pub use model::ReactionCountDetails;pub use model::RequestChannelInfo;pub use model::RequestGuildMembers;pub use model::Role;pub use model::RoleColors;pub use model::RoleSubscriptionData;pub use model::RoleTags;pub use model::SearchGuildMembersQuery;pub use model::SearchGuildMessagesQuery;pub use model::SearchGuildMessagesResponse;pub use model::SetVoiceChannelStatus;pub use model::Sku;pub use model::Snowflake;pub use model::SoundboardSound;pub use model::SoundboardSoundList;pub use model::StageInstance;pub use model::Sticker;pub use model::StickerItem;pub use model::StickerPack;pub use model::StickerPackList;pub use model::Subscription;pub use model::SubscriptionQuery;pub use model::ThreadListResponse;pub use model::ThreadMember;pub use model::ThreadMemberQuery;pub use model::UpdatePresence;pub use model::UpdateUserApplicationRoleConnection;pub use model::User;pub use model::UserApplicationRoleConnection;pub use model::UserCollectibles;pub use model::UserConnection;pub use model::UserContextMenuInteraction;pub use model::UserNameplate;pub use model::UserPrimaryGuild;pub use model::VanityUrl;pub use model::VoiceRegion;pub use model::VoiceServerUpdate;pub use model::VoiceState;pub use model::Webhook;pub use model::WebhookExecuteQuery;pub use model::WebhookMessageQuery;pub use model::WelcomeScreen;pub use model::WelcomeScreenChannel;pub use oauth2::OAuth2AuthorizationRequest;pub use oauth2::OAuth2Client;pub use oauth2::OAuth2CodeExchange;pub use oauth2::OAuth2RefreshToken;pub use oauth2::OAuth2Scope;pub use oauth2::OAuth2TokenResponse;pub use response::InteractionResponseBuilder;pub use response::MessageBuilder;pub use types::ButtonConfig;pub use types::Emoji;pub use types::MediaGalleryItem;pub use types::MediaInfo;pub use types::SelectOption;pub use webhook_events::parse_webhook_event_payload;pub use webhook_events::ApplicationAuthorizedWebhookEvent;pub use webhook_events::WebhookDeletedMessage;pub use webhook_events::WebhookEvent;pub use webhook_events::WebhookEventBody;pub use webhook_events::WebhookEventPayload;pub use webhook_events::WebhookPayloadType;pub use webhook_events::WebhookSocialMessage;pub use bitfield::BitField;pub use bitfield::BitFieldFlags;pub use bitfield::IntentFlags;pub use bitfield::Intents;pub use bitfield::MessageFlagBits;pub use bitfield::MessageFlags;pub use bitfield::PermissionFlags;pub use bitfield::Permissions;pub use builders::create_container;pub use builders::ActionRowBuilder;pub use builders::ButtonBuilder;pub use builders::CheckboxBuilder;pub use builders::CheckboxGroupBuilder;pub use builders::ComponentsV2Message;pub use builders::ContainerBuilder;pub use builders::EmbedBuilder;pub use builders::FileBuilder;pub use builders::FileUploadBuilder;pub use builders::LabelBuilder;pub use builders::MediaGalleryBuilder;pub use builders::ModalBuilder;pub use builders::RadioGroupBuilder;pub use builders::SectionBuilder;pub use builders::SelectDefaultValue;pub use builders::SelectMenuBuilder;pub use builders::SeparatorBuilder;pub use builders::TextDisplayBuilder;pub use builders::TextInputBuilder;pub use builders::ThumbnailBuilder;pub use parsers::parse_interaction;pub use parsers::parse_interaction_context;pub use parsers::parse_modal_submission;pub use parsers::parse_raw_interaction;pub use parsers::InteractionContext;pub use parsers::RawInteraction;pub use parsers::V2ModalComponent;pub use parsers::V2ModalSubmission;pub use constants::component_type;pub use constants::gateway_intents;pub use constants::separator_spacing;pub use constants::text_input_style;pub use constants::MESSAGE_FLAG_IS_COMPONENTS_V2;pub use http::DiscordHttpClient;pub use http::FileAttachment;pub use http::FileUpload;pub use http::RestClient;pub use helpers::defer_and_followup_container;pub use helpers::defer_interaction;pub use helpers::defer_update_interaction;pub use helpers::delete_followup_response;pub use helpers::delete_original_response;pub use helpers::edit_followup_response;pub use helpers::edit_message_with_container;pub use helpers::edit_original_response;pub use helpers::followup_message;pub use helpers::followup_with_container;pub use helpers::get_original_response;pub use helpers::launch_activity;pub use helpers::respond_component_with_components_v2;pub use helpers::respond_component_with_container;pub use helpers::respond_modal_with_container;pub use helpers::respond_to_interaction;pub use helpers::respond_with_autocomplete_choices;pub use helpers::respond_with_components_v2;pub use helpers::respond_with_container;pub use helpers::respond_with_message;pub use helpers::respond_with_modal;pub use helpers::respond_with_modal_typed;pub use helpers::send_components_v2;pub use helpers::send_container_message;pub use helpers::send_message;pub use helpers::send_to_channel;pub use helpers::update_component_with_container;pub use helpers::update_interaction_message;
Modules§
- bitfield
- Bit flag helpers for Discord gateway intents, permissions, and message flags.
- builders
- Canonical builder imports live on
discordrs::builders::{...}and the crate root re-exports. The submodules below are implementation detail modules behind those stable re-exports. - cache
- Gateway cache storage, policies, and typed cache manager helpers.
- collection
- Collection helpers for Discord model maps and cached entity sets.
- command
- Application command builders and command option models.
- constants
- Discord API constants used by gateway, REST, and interaction helpers.
- error
- Error types returned by Discord REST, Gateway, voice, and parser operations.
- event
- Typed Discord Gateway event payloads and dispatch decoding.
- helpers
- Convenience helpers for interaction responses and webhook followups.
- http
- Typed Discord REST client, request bodies, route helpers, and rate-limit handling.
- manager
- Shared manager traits for cached Discord model access.
- model
- Typed Discord API models and request payload shapes.
- oauth2
- OAuth2 authorization URL and token exchange helpers.
- parsers
- Parsers for Discord interaction and modal payloads.
- prelude
- Commonly used discord.rs types re-exported for application code.
- response
- Interaction response and message response builders.
- types
- Legacy compatibility types and shared builder aliases.
- webhook_
events - Typed parser for Discord application Webhook Events payloads.
Type Aliases§
- Error
Deprecated - Backward-compatible alias. Prefer
DiscordError.