Sign inSign up

kmvf/drbot

By kmvf

Updated 9 months ago

A (local) music bot for discord

Image
0

1.4K

kmvf/drbot repository overview

drbot

Sponsor TypeScript version Node.js version GPLv3+

A pretty ok music bot.

Getting Started

With docker

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

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
Building your own

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
Redis

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.


Without docker

You can run the bot without docker, it lives in the /bot folder.

Installation
npm ci
Building

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
Configuring

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.

Starting

To start the bot:

npm run start
Redis

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.

Environment variables

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

Backers & Sponsors

Support this project by becoming a sponsor.

License

Licensed under the GNU GENERAL PUBLIC LICENSE. See the LICENSE file for details.

Tag summary

Content type

Image

Digest

sha256:32f5255d3

Size

79.9 MB

Last updated

9 months ago

docker pull kmvf/drbot