3.4 KiB
Siren is a D&D Bot built for Discord, written in Rust. Features include:
- Play tracks from Youtube or locally hosted files
- Assistant DM tools to be defined later
Running
- Setup the Discord Developer Application and bot
- Copy
.env.TEMPLATEto.envand fill out the fields - Build the Docker application with
make build - Start the application with
make up
Setting up the Discord Developer Application
Visit the Discord Developer Portal and create a new application. Click here for guides and more information.
Required Scopes:
- bot
- application.commands
Example Invite:
https://discord.com/api/oauth2/authorize?client_id=<CLIENT_ID>&permissions=40671259392832&scope=bot%20applications.commands
The CLIENT_ID can be found in the General Information tab on the Discord Developer Portal for your application, under Application ID
The DISCORD_TOKEN (used in the .env file) can be found under the Bot tab on the Discord Developer Portal for your application.
Contributing
Rust must be installed to run locally. See serenity-rs/serenity for more information about Rust Discord API Library.
The following packages must be installed for serenity-rs/songbird. View the repository for additional installation and setup information on other operating systems.
Unix Installation
Notes:- yt-dlp is preferred over youtube-dl.
sudo apt install libopus-dev
sudo apt install ffmpeg
sudo apt apt install youtube-dl # See notes above
# PostgreSQL Headers
sudo apt install libpq5
sudo apt install libpq-dev
- Potentially requires yt-dlp and yt-dlp FFmpeg Static Auto-Builds.
Mac Installation
Notes:- Homebrew must be installed to run the following commands.
- youtube-dl is deprecated, yt-dlp is preferred
brew install opus
brew install ffmpeg
brew install yt-dlp # See notes above
brew install postgresql
Running Locally
- Build the Docker containers with
make build - Start the utility containers with
make utils - Start the application with
cargo run
The application can also be tested from within a Docker container:
docker build -t siren:latest .
docker run --env-file .env -it --rm --name siren siren:latest
Authentication
The Siren service uses a stateful JWT authentication system, which allows for the ability to revoke and expire tokens, as well as to allow for the ability to have multiple tokens per user. A public/private key is needed for the JWT. The keys can be generated with ./generate_keys.sh. These keys should be located within a /keys directory in the root of the project. The KEYS_DIR_PATH within the service's .env file should be updated to reflect the location of the keys.

