A pretty ok music bot.
I use docker compose to make life easy, but you don't have to.
Configure a .env file in the project root directory. You can copy example.env and fill it out.
Official images are hosted on Docker Hub under kmvf/drbot. Currently images are built for linux/amd64 and linux/arm64.
To run the bot:
sudo docker compose up
To auto-restart in daemon mode:
sudo docker compose up -d
In case you're running on different architecture, or just want to build it, a build.yaml file is here for convenience.
Just run:
sudo docker compose --file build.yaml up --build
A Redis container with Redisearch is included in the default compose.yaml and build.yaml. If you prefer to use your own, remove it and provide your own REDIS_URL environment variable.
You can run the bot without docker, it lives in the /bot folder.
npm ci
To build for the current environment:
npm run build
To watch for changes:
npm run build:watch
A release specific build, without js map files, etc:
npm run build:release
Environment variables are used to configure the bot.
Copy bot/example.env to bot/.env, and fill in your own values.
Note that bot/.env gets a REDIS_URL variable, while the docker specific .env file does not. This is because the docker compose setup creates its own Redis instance.
To start the bot:
npm run start
If you're not using docker, you'll have to provide your own Redis server with Redisearch installed. Pass the url with the REDIS_URL environment variable.
There is an example.env file to use with the default compose.yaml and build.yaml docker compose files.
Create a file called .env in the root directory of the project, copy example.env and replace with your own values.
# user id of the bot owner (you probably! look up how to get your id)
DISCORD_OWNER=123456789098765432
# bot application id
DISCORD_APPLICATION_ID=1234567890987654321
# bot token
DISCORD_TOKEN=MfeGhjewwejqwGwqf72Ghfe1gF.mA7g0q.f8FuHFgwkjfeu436Hwgq1Fh8A9FE_a08fg3gH1
# path to audio files
MEDIA_PATH=/path/to/audio/files
# maybe turn this off on big libraries that don't change?
SCAN_MEDIA_ON_START=true
# should we watch MEDIA_PATH for updates?
WATCH_MEDIA=true
# how many files can we access at once - helps prevent crashes on large libraries and not-great hardware
DISK_ACCESS_CONCURRENCY=50
# FOR NON-DOCKER/DIRECT NODEJS - url pointing to a redis server
REDIS_URL=redis://some.redis.server:6379
Support this project by becoming a sponsor.
Licensed under the GNU GENERAL PUBLIC LICENSE. See the LICENSE file for details.
Content type
Image
Digest
sha256:32f5255d3…
Size
79.9 MB
Last updated
9 months ago
docker pull kmvf/drbot