Home
A fast, lightweight, and feature-rich Discord bot library written in Rust.
Development Notice
RustyCord is currently in heavy development and is NOT ready for production use.
- APIs may change without notice
- Features are incomplete and experimental
- Breaking changes occur frequently
- Documentation may be outdated
- Use at your own risk for development/testing only
Do not use this library for production bots yet. Wait for the stable 1.0 release.
Current Status
- ✅ Basic bot functionality working
- ✅ Message edit, deletion, replies, files, embeds, and reactions
- ✅ Prefix and slash command systems functional
- ✅ HTTP rate limiting and gateway resume support
- ⚠️ Advanced features under development
- ❌ Voice support not available
- ❌ Comprehensive production testing needed
Overview¶
rustycord is a modern Discord bot library that provides a clean, type-safe API for building Discord bots. Built with performance and reliability in mind, it offers comprehensive logging, flexible message handling, and an intuitive event system.
Key Features¶
- 🚀 Async/Await Support: Built on Tokio for high-performance async operations
- 📝 Comprehensive Logging: 5-level logging system with console and file output
- 🔧 Flexible Message Handlers: Trait-based message handling system
- 🎯 Type Safety: Leverages Rust's type system for compile-time safety
- 📡 WebSocket Gateway: Discord Gateway v10 support with heartbeat, resume, and reconnect backoff
- 🌐 HTTP Client: Discord REST API client with per-resource rate limiting
- 🎨 Rich Embeds: Built-in embed builder with sized media and repeated fields
- 📎 File Attachments: Multipart file uploads with attachment metadata
- ⚡ Event System: Message, reaction, and application-command event handling
- 🛠️ Guild Management: Channel, role, kick, ban, timeout, and member-role wrappers
Quick Start¶
use rustycord::{bot::Bot, gateway::intents};
#[tokio::main]
async fn main() {
// Create the bot
let intent = intents::ALL_INTENTS;
let mut bot = Bot::builder(Some(intent)).await;
let token = std::env::var("DISCORD_TOKEN")?;
// Start the bot
bot.run(token, Some("info".to_string())).await;
}
Installation¶
Add this to your Cargo.toml:
Getting Started¶
Ready to build your first Discord bot? Check out our Getting Started Guide to learn how to set up your development environment and create your first bot.
Examples¶
- Basic Bot - Simple echo bot
- Message Handler - Custom message handling
- Embeds - Rich embed messages
- Logging - Comprehensive logging setup
Documentation¶
- User Guide - Learn the fundamentals
- Slash Commands - Register and handle application commands
- Messages and Moderation - Replies, files, reactions, and guild controls
- API Reference - Complete API documentation
- Examples - Working code examples
Community¶
- GitHub Issues - Bug reports and feature requests
- Discussions - Community support
License¶
This project is licensed under the MIT License - see the LICENSE file for details.