Documentation for each slash command pops up in Discord when you type / in a
message box.
A simple dice roller. Here are some examples:
/roll(defaults to 1d20) returns: "@userrolled 10."/roll sides: 20returns: "@userrolled 13."/roll sides: 6 rolls: 2returns: "@userrolled 2, 5."
Plays a user's introduction sound when they join a voice channel. This is configurable with the following commands:
/set_intro- Add an introduction sound from an attachment/clear_intro- Remove your introduction sound
- Sounds are set on a per-guild basis.
- The attachment video/audio length can be up to 5 seconds long.
- The bot joins the voice channel (if not already present) to play the introduction sound.
- The bot will stick around so that subsequent user joins can be announced faster.
- The bot leaves the voice channel after 5 minutes of inactivity.
The previous incarnation of this
bot
used a serverless API and Discord
Interactions
to handle the /roll slash command without a Discord framework. I was pretty
proud of that, but I wanted to add more features and learn more about Rust so
(as they say) I rewrote it in Rust.
This version uses Serenity,
Poise, and
Songbird for the Discord client.
They, along with ffmpeg and libopus, do all the heavy lifting.
Assuming you have Nix installed you can run the bot with:
nix develop --command bash -c 'INTROS_DIR="intros" DISCORD_TOKEN="<token>" cargo run'