This project is still WIP. C++ Discord library with node bindings focused on audio playback.
The Core parts as networking with discord/audio decoding and encoding is written in c++11. Theres a thin api wrapper around the native bindings written in Typescript
- MPEG3(mp3)
- opus(.opus in ogg container)
- WAV(experimental!)
To use the demo bot simply use the docker image
docker pull liz3/relight
Note: The windows support isnt fully done and i cannot guarantee stability on windows
First of install windows-build-toold (Admin cmd/Powershell)
npm install --global --production windows-build-tools
Then also install vcpkg
Install native dependencies
brew install mad libsodium opus opusfile nlohmann-json
Then simply: ./setup.sh
(This is applied to apt using distros, but should work on all, tested in ubuntu 19.10 docker container)
apt install nlohmann-json3-dev libmad0-dev libsodium-dev libopus-dev libopusfile-dev
Then simply: ./setup.sh
Run this in the folder where you installed vcpkg
> vcpkg install libsodium:x64-windows
> vcpkg install opusfile:x64-windows
> vcpkg install opus:x64-windows
> vcpkg install ixwebsocket[mbedtls]:x64-windows
> vcpkg install nlohmann-json:x64-windows
> vcpkg install libmad:x64-windows
npm install
npm run compile
(Make sure to use forward slashes!, use git bash for the sake of inline env vars)
npm install
VCPKG_ROOT=/path/to/vcpkg-root npm run compile
, Example:VCPKG_ROOT=C:/Users/liz3/Desktop/vcpkg npm run compile
After building, in order to run you can use the npm start
script.
TOKEN=my_discord_token npm start
(Use git bash)
TOKEN=my_discord_token npm start
To add Youtube dl which is needed by the web fetcher, simply run the script to fetch it. The script will clone and build youtube-dl.
(Make sure you have python)
./youtube-dl.sh
- nlohmann/json
- IXWebsocket
- node-addon-api
- opus
- mad
- sodium
- opusfile
Tokio is free software licensed under GPL 2.0