Skip to content

Discord Music Bot written in Grandpa of JavaScript

License

Notifications You must be signed in to change notification settings

Henonicks/Musicat

 
 

Repository files navigation

Musicat - Discord Music Bot written in C++

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.

Dependencies

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)

Docker

  • 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

Installing Dependencies

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

Compiling

  • 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, see exe/sha_conf.example.json) and run the binary
# register the commands
./Shasha reg g

# run the bot
./Shasha

About

Discord Music Bot written in Grandpa of JavaScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 99.4%
  • CMake 0.4%
  • Python 0.1%
  • C 0.1%
  • Shell 0.0%
  • Dockerfile 0.0%