Discord Music Bot written in C++
- Just install dependencies, compile and fill out
exe/sha_cfg.json
, config file should be in one directory as the binary. - Musicat is fully slash command and need to register the commands to discord, run
./Shasha reg g
or./Shasha reg <guild_id>
to register slash commands.
Need to install:
- FFmpeg - Should be installed on your machine
- libpq - Library
- libopus - Library
- libogg - Library
- libcurl - Library
- libsodium - Library
- openssl - Library
- opus - Library
Included:
- DPP - Library (included as submodule)
- yt-dlp - CLI App (included as submodule)
- uWebSockets - Library (included as submodule)
- curlpp - Library (included as submodule)
- liboggz - Library (included as submodule)
- yt-search.h - Included (included as submodule)
- nekos-bestpp - Included (included as submodule)
- encode.h - Included (included as submodule)
- nlohmann/json - Headers only, included
- ICU 73 - Library (downloaded at compile time)
- Clone the repo
git clone https://github.com/Neko-Life/Musicat.git --recurse-submodules
cd Musicat
- Build the image
docker build . -t shasha/musicat:latest
- Register the commands. Can be as simple as
docker run -it --rm -v ./exe/sha_conf-docker.json:/root/Musicat/exe/sha_conf.json --name Musicat-Register shasha/musicat:latest ./Shasha reg g
- Running
docker run -it --rm -p 3000:3000 -v ./exe/sha_conf-docker.json:/root/Musicat/exe/sha_conf.json -v ./exe/music:/root/music --name Musicat shasha/musicat:latest
You can create a docker-compose.yml file to integrate with postgresql, configure however you want.
- Misc
- Creating container
docker container create -p 9001:9001 -v ./exe/sha_conf.docker.json:/root/Musicat/exe/sha_conf.json -v ./exe/music:/root/music --name Musicat shasha/musicat:latest
- Running container
docker container start Musicat
- Creating container
Ubuntu 22.04.2 LTS:
- Upgrade first is recommended
apt update
apt upgrade
- Install
apt install build-essential pkg-config cmake make zlib1g-dev autoconf automake libtool libcurl4-openssl-dev libssl-dev libsodium-dev libopus-dev libogg-dev ffmpeg postgresql libpq-dev
-
Make sure to have
pkg-config
installed as cmake need it to be able to detect libsodium and libopus -
Clone the repo and cd into it
git clone https://github.com/Neko-Life/Musicat.git --recurse-submodules
cd Musicat
- Compile
mkdir build
cd build
cmake ..
# configure the `-j` flag according to your available RAM as needed
make all -j$(nproc)
Some distro have liboggz2
or liboggz2-dev
, if you got compile error about
oggz/oggz.h
not found but you already have liboggz
installed,
you might need to install that.
- Move the built binary to
exe/
(or wherever you want along with a config file)
mv Shasha ../exe
- Create and fill the config file (config file must be named
sha_conf.json
, seeexe/sha_conf.example.json
) and run the binary
# register the commands
./Shasha reg g
# run the bot
./Shasha