Moonbot is a Discord bot used (at this moment) to play music on channel.
Moonbot can be used with already prepared Docker containers with required services, or can be configured to work with custom instances of these services.
When used with Docker and Docker Compose bot still lives outside of containers- only Lavalink and Redis instances are contenerized.
To setup services using Docker make sure you have Docker and Docker Compose installed.
Docker Compose is by default shipped with Docker on Windows, so its separate installation in most cases will not be required.
After Docker and Docker Compose installation is complete we can run our container.
docker-compose up
We may want to detach from containers (to make it running 'in background') by using:
docker-compose up -d
On Linux based systems you may need to use sudo
to run the command with root privillages.
When running our containers first time we need to give the lavalink
service some time
to build.
After services are ready you can proceed to [setting up bot](#setting up bot).
In some cases you may want to set up services without using Docker.
To do that, you have to create instances of Redis and Lavalink. You can find Lavalink server configuration guide in its readme. Redis installation is covered in its documentation, or in many guides in the internet.
Bot requires Node runtime and Yarn package manager to work. You may also try to use npm instead of Yarn, however differences between bot behavior when using Yarn and npm won't be considered as bugs- only Yarn is supported.
Bot reads configuration from config.json
file. You can get scaffold of this file by copying config.sample.json
to
config.json
.
When using Docker Compose you usually want to leave default configuration options (except these related to Discord API, not bot services).
You can run bot wihout building it to files using:
yarn start
If you also want bot to restart after each change you make you may want to use:
yarn dev
Bot can be built using:
yarn build
Important: building bot has different rules than just running it, so in early versions of bot this command may throw errors disallowing to build bot to files.
After bot is built you can run bot using:
node dist/
Feel free to contribute to the bot by reporting bugs, requesting features, solving issues, or using it. If you have any problem with using or developing the bot feel free to create an issue with a question.
Thanks to authors of