- Rust 97%
- Nix 2.4%
- Dockerfile 0.6%
| .zed | init | |
| assets | feat: avatarsync | |
| bot_commands | feat: I have a suggestion. | |
| bot_core | feat: command cooldowns/ratelimiting | |
| bot_events | feat: help command | |
| data/migrations | feat: avatarsync | |
| src | feat: avatarsync | |
| .env.example | docs: add readme | |
| .envrc | init | |
| .gitignore | feat: avatarsync | |
| alejandra.toml | init | |
| Cargo.lock | feat: avatarsync | |
| Cargo.toml | feat: avatarsync | |
| diesel.toml | feat: avatarsync | |
| Dockerfile | big refactoring | |
| flake.lock | init | |
| flake.nix | feat: avatarsync | |
| LICENSE | big refactoring | |
| README.md | feat: print more bot info in ready event | |
| rustfmt.toml | init | |
paige/bot
Yet Another Blazingly Fast Discord Bot
overview
this is a multi-crate project to keep things tidy:
src/main.rs: the entrypointbot_commands: slash commandsbot_core: core types and structs and some utilitiesbot_events: event handlers
the structure is heavily inspired by Discord-TTS/Bot. however, most of this is written from scratch.
notably, this project uses Nix. if you aren't familiar with it, it's a tool to simplify build processes and managing dependencies. you can see the flake if you're interested in how it's used.
building
use a shell that supports direnv and simply clone and cd into this repo (recommended):
git clone git@codeberg.org:paige/bot.git && cd bot
cargo build
or manually grab the build dependencies, this varies depending
on the OS you use, see the packages that the flake.nix uses
and find & install them on your system accordingly. however,
i recommend you just stick to direnv and nix, as it is much
easier
usage
click here to make a discord application.
see the intents here and specify them accordingly.
copy .env.example to .env and paste your token there.
after running the bot, you need to run ~register in a channel
in order for slash commands to appear. you can invite the bot
with the link that is printed in the terminal. this link also
includes the necessary permissions that the bot needs to run.