Skip to main content

Crate discord_user

Crate discord_user 

Source
Expand description

Discord Control - A Discord self-bot client library for Rust

This library provides functionality to interact with Discord as a user account, including WebSocket gateway connection, message operations, and event handling.

§Warning

This library implements Discord self-botting which violates Discord’s Terms of Service. Use at your own risk.

Re-exports§

pub use context::DiscordContext;
pub use discord_user::ConnectionInfo;
pub use discord_user::DiscordUser;
pub use discord_user::DiscordUserBuilder;
pub use error::DiscordError;
pub use error::Result;
pub use events::DispatchEvent;
pub use message_builder::EmbedBuilder;
pub use message_builder::MessageBuilder;
pub use typed_events::TypedEvent;
pub use types::*;

Modules§

builder
Type-state builder pattern for compile-time required-field enforcement.
cache
In-memory event-driven cache for Discord objects.
cache_http
Cache-fallback-to-HTTP pattern.
client
HTTP client for Discord API requests
collector
Stream-based event collectors.
components
Message component builders — buttons, select menus, and action rows.
content_safe
Content safety and mention sanitization.
context
discord_user
Main DiscordUser client combining HTTP, WebSocket, and event handling
error
Error types for the discord-user-rs library
events
Event system for Discord dispatch events
fmt
Discord message formatting helpers.
framework
Text (prefix) command framework.
gateway
Discord WebSocket Gateway connection
json
JSON parsing shim — conditionally backed by serde_json (default) or simd-json (when the simd_json feature flag is enabled).
mention
Mention and ID parsing utilities.
message_builder
Message builder for ergonomic message sending
modal
Quick modal builder for Discord interactions.
operations
Operations module - provides specialized operation traits for DiscordUser
permissions
Effective permission calculation.
proto
Protobuf encoding for Discord user settings (PreloadedUserSettings proto)
route
typed_events
Typed event definitions and handlers for Discord gateway events
typemap
TypeMap — type-safe shared state for event handlers.
types
Core Discord types and data structures
utils
Miscellaneous utility helpers.
validate
Model-level validation — catches Discord constraint violations before HTTP.