This is, the one and only, Riveting bot. It's built in Rust with Twilight and runs in a Docker container ...or without.
Primarily made for the Riveting community discord server. (And to keep that one guy in check.)
The bot will read the discord token from the environment variable DISCORD_TOKEN
,
which must be set for the bot to connect.
You may use a .env
file in the project root directory to specify the token
or any other environment variables for the bot.
- Have rust-lang installed with latest nightly toolchain.
- a) To just build it, run
cargo build
(for debug build) orcargo build --release
(for optimized build). - b) Or to build and run:
cargo run
orcargo run --release
. - (Optional) You can use
cargo
options--features
and--no-default-features
to build with other features. - (Optional) You can run the executable directly, once built. By default, found in
./target/<build>/
.
cargo build --features=debug
cargo run --release --no-default-features --features=admin,bulk-delete
-
Have Docker installed.
-
- To run:
docker compose up -d
. To also rebuild the image before starting, add--build
to it. - To stop the container(s):
docker compose down
.
- To run:
-
- To build, run
docker build -t riveting-bot .
in the project root directory. - To run the container, run
docker run -d --rm --name riveting-bot --env-file .env riveting-bot
(you can use--env
option instead if you don't have a.env
file). You may want to set up a volume bind with--mount type=bind,source="$(pwd)"/data,target=/data
. - To shutdown the container, run
docker stop riveting-bot
.
Dockerfile
:default
(minimal size, default for docker-compose)Dockerfile.extras
:default
+voice
(built bydocker
github workflow)
- To build, run
voice
feature requires Opus, it can be built from source ifcmake
is available. Additionally,yt-dlp
is required at runtime. For more information, see songbird dependencies.
- The best place to search docs for the many crates of
twilight
is probably their documentation.
- All of bot's data is located in
./data
folder, which will be created if it doesn't exist yet. It will contain logs and configs. - Any manual changes to configs while the bot is running may be lost.
- To control what is logged to a log file, the bot uses
RUST_LOG
environment variable. eg.RUST_LOG=warn,twilight=info,riveting_bot=debug
which will logwarn
messages,info
fortwilight*
, anddebug
forriveting_bot
sources. - Why
twilight
and notserenity
or something? Because, yes.