- Rust 94.3%
- Dockerfile 5.7%
| .github/workflows | Don't build docker for arm (Overkill) | |
| src | Add persistent storage | |
| .dockerignore | Add persistent storage | |
| .gitignore | Add persistent storage | |
| Cargo.lock | Add persistent storage | |
| Cargo.toml | Add persistent storage | |
| config.example.json | Add persistent storage | |
| docker-compose.yml | Explain persistent storage for docker/general in README | |
| Dockerfile | Pin rust version to 1.91 | |
| LICENSE | first commit | |
| README.md | Explain persistent storage for docker/general in README | |
Big Bangers Bot 🤩
This Discord starboard bot is designed to support large servers with multiple channels of varying activity levels. It provides users with the ability to prioritize specific channels for starboard posting while ignoring others. Built with efficiency in mind.
- Channel Prioritization: Specify which channels to prioritize when scanning.
- Channel Ignoring: Choose which channels to ignore.
- Efficient Resource Usage: Consuming less than 12MB of RAM for a discord server with 30 channels and 1.7 million messages
Setup 🛠️
Create a config.json file based on config.example.json
Configuration Options
discordChannel: The ID of the channel where starred messages will be posted (starboard channel)discordServer: The ID of your Discord serverdiscordToken: Your Discord bot tokenthreshold: Minimum number of reactions required for a message to be posted to the starboardreply: Whether the bot should reply to starred messages with a configured responsereplies: Array of possible reply messages the bot can send (randomly selected ifreplyis true)enableChannelWhitelist: When true, only monitors channels listed in thechannelsarraychannels: Array of channel objects to whitelist (only used ifenableChannelWhitelistis true)id: Channel ID to include in the whitelist
persistenceFile: (Optional) Path to the file where approved messages are saved (defaults toapproved_messages.json)
Persistence
The bot automatically saves the mapping of original messages to starboard posts when shutting down. This data is loaded on startup, allowing the bot to:
- Update existing starboard posts when reactions change
- Avoid duplicate posts after restarts
- Maintain continuity across bot restarts
Run 🏃
Using Cargo
cargo run
Using Docker
# Option 1: Use the pre-built image from GitHub Container Registry
docker run -v $(pwd)/config.json:/app/config.json:ro \
-v $(pwd)/approved_messages.json:/app/approved_messages.json \
ghcr.io/annsanns/bigbangersbot:latest
# Option 2: Build locally
docker build -t big-bangers-bot .
docker run -v $(pwd)/config.json:/app/config.json:ro \
-v $(pwd)/approved_messages.json:/app/approved_messages.json \
big-bangers-bot
Note: The approved_messages.json volume mount is needed for persistence. The file will be created automatically on first run.
Using Docker Compose
By default the docker-compose.yml is set to use the pre-built image from GitHub Container Registry. If you want to build the image locally instead, comment out the image line and uncomment the build line.
# Make sure config.json exists in the project directory
docker-compose up -d
The docker-compose.yml file already includes the persistence file mount.
Build 🏗️
Native Build
cargo build --release
Docker Build
docker build -t big-bangers-bot .
Contributions 🤝
Contributions are welcome! If you have suggestions for improvements, new features, or encounter any issues, feel free to open an issue or pull request on GitHub.
License 📜
This project is licensed under the EUPL license - see the LICENSE file for details