A hassle-free, highly performant, host-it-yourself, cracking smoking Discord music bot
Thanks to the guys over at alwaysdata for hosting the website, web portal, email, etc for this project for free, in their Open Source program.
- Create a bot account
- Copy the token and application id to a
.env
with theDISCORD_TOKEN
andDISCORD_APP_ID
environment variables respectively. - Define
DATABASE_URL
,PG_USER
,PG_PASSWORD
for the Postgres database. - Optional define
SPOTIFY_CLIENT_ID
andSPOTIFY_CLIENT_SECRET
for Spotify support. - Optional define
OPENAI_API_KEY
for chatgpt support. - Optional define
VIRUSTOTAL_API_KEY
for osint URL checking. - Use .env.example as a starting point.
docker run -d --env-file .env --restart unless-stopped --name cracktunes ghcr.io/cycle-five/cracktunes:latest
Make sure you've installed Rust. You can install Rust and its package manager, cargo
by following the instructions on https://rustup.rs/.
After installing the requirements below, simply run cargo run
.
The commands below install a C compiler, GNU autotools and FFmpeg, as well as yt-dlp through Python's package manager, pip.
apt install build-essential autoconf automake libtool ffmpeg
pip install -U yt-dlp
brew install autoconf automake libtool ffmpeg
pip install -U yt-dlp
If you are using the MSVC toolchain, a prebuilt DLL for Opus is already provided for you.
You will only need to download FFmpeg, and install yt-dlp which can be done through Python's package manager, pip.
pip install -U yt-dlp
If you are using Windows Subsystem for Linux (WSL), you should follow the Linux/MacOS guide, and, in addition to the other required packages, install pkg-config, which you may do by running:
apt install -y pkg-config
The following command will run all tests:
cargo +nightly test --all-features --workspace
Some tests are available inside the src/tests
folder, others are in their respective
files. It's recommended that you run the tests before submitting a Pull Request.
Increasing the test coverage is also welcome. Test coverage is tracked using
tarpaulin.
cargo +nightly tarpaulin --all-features --workspace
cargo +nightly clippy --profile=release --all-features --workspace -- -D warnings -D clippy:all
cargo +nightly build --profile=release --features crack-osint,crack-bf,crack-fpt --workspace --locked
cargo dist init --hosting github
# make change `pr-run-mode = "upload"`
git add .
git commit -am "chore: cargo-dist"
cargo dist build --profile=release --features crack-gpt,crack-bf,crack-osint
git tag vX.X.X
git push --tags
# publish to crates.io (optional)
cargo publish
Within the project folder, simply run the following:
docker build -t cracktunes .
docker compose up -d
Originally forked from Parrot