A modular Discord bot written in Rust and powered by Serenity, built for flexible command organization, strong type safety, and configuration through environment variables.
Death Bot is a Discord bot project implemented in Rust with the Serenity framework at its core. Its layout is intentionally modular, which helps keep command logic separated, easier to extend, and simpler to maintain over time.
The project is a practical fit for developers who want a type-safe base for Discord automation, along with a straightforward way to add commands, handlers, and configuration-driven behavior. It is centered on consistent command flow and sensible error handling.
- Modular architecture that breaks bot logic into smaller, easier-to-manage parts
- Command handling designed to be extended as bot behavior grows
- Rust-based implementation with strong type safety and compile-time checks
- Serenity integration for Discord API access and event handling
- Environment-driven configuration so runtime settings stay outside the codebase
- Error handling intended to make runtime issues easier to diagnose
- Organized for long-term maintainability as more commands are added
- A solid starting point for custom Discord bot workflows
Clone the repository and compile it with Cargo:
git clone https://github.com/noahcppscott1919/death-bot-type-safe.git cd REPO cargo build --release`
Once the build finishes, run the compiled binary and ensure the necessary environment variables are set before startup.
After configuration is in place, start the bot and invite it to your Discord server with the permissions it needs.
Typical workflow:
- Set your Discord token and any other environment values.
- Build or run the project with Cargo.
- Start the bot process.
- Add or adjust commands in the modular command structure.
- Restart the bot after changes when needed.
Example run command:
cargo run --release
The bot reads its configuration from environment variables instead of relying on a large local settings file. That keeps sensitive values out of the repository and makes the setup easier to move between environments.
Example layout:
DISCORD_TOKEN=your_token_here
RUST_LOG=info
If you extend the project, continue placing additional bot settings in environment variables or in a separate config layer that fits the modular design.
- Rust toolchain
- Cargo for building and running the project
- Discord bot credentials
- Network access to Discord services
- A system capable of running a Rust application
How do I update the bot?
Pull the newest changes from the repository, rebuild with Cargo, and deploy the updated binary.
Where do I change settings?
Core runtime settings should come from environment variables. If you add more options later, keep them grouped in a simple configuration approach.
What if a command fails?
Review the bot logs and the error path for the affected command or module. The modular layout should make it easier to trace problems.
Can I add more commands?
Yes. The command system is meant to be extended, so you can add new command modules without redesigning the entire bot.
What should I check first if the bot does not start?
Confirm the Discord token, verify that the environment variables are loaded, and check that the Rust build completed without errors.
GNU GPL v3.0 - see LICENSE for details.