A simple NodeJS Discord bot using the Discord.js API

tarfeef101 b831f3cf14 Merge branch 'total_rework' 4 vuotta sitten
node_modules 90ff2c6696 Bring In Standard Music Features (#2) 7 vuotta sitten
src 419f3c0212 got finishing a playlist to work, and removed a bad log/output line 4 vuotta sitten
.gitignore 39bb95142a gitignore the config file 4 vuotta sitten
Dockerfile 6d6ee6ae01 fix permissions+user to use host beet db and user files, can play a song! 4 vuotta sitten
LICENSE cda39da2e0 Initial commit 7 vuotta sitten
Queue.js 90ff2c6696 Bring In Standard Music Features (#2) 7 vuotta sitten
README.md 2a972581d2 technicality update in readme 4 vuotta sitten
config.json 1a7c8469d8 Initial setup (#1) 7 vuotta sitten
docker-compose.yaml 603300b6ac "turn on" restart behaviour" 4 vuotta sitten
ideas.txt 1a7c8469d8 Initial setup (#1) 7 vuotta sitten
package-lock.json 90ff2c6696 Bring In Standard Music Features (#2) 7 vuotta sitten
package.json 90ff2c6696 Bring In Standard Music Features (#2) 7 vuotta sitten
viki.js 90ff2c6696 Bring In Standard Music Features (#2) 7 vuotta sitten

README.md

Viki

Viki is a bot focused mainly on music streaming. Specifically, streaming from a beets music library on the docker host on which the viki container is run. Yes, this is a very specific, narrow use case.

Usage

To get this running on your server, other than the normal creation of a bot user stuff on the discord, side, do the following:

  • create src/config.json and add:
    • "token", your bot's token
    • "prefix", the character that is the prefix for bot commands in your server
    • "whitelist", an array of users in the form username#tag who can run addmusic for your bot
  • in docker-compose.yaml:
    • change the volumes to the locations of your beets config and media folder(s)
    • optionally change the restart policy to your preference
  • in Dockerfile:
    • change the added user to the user who owns the media library on the host
    • change the uid and gid of this user to match the host, if necessary
    • ensure the version of beets to be installed is equal or at least compatible with the host's
  • run docker-compose up --build -d to run the bot

Caveats

  • as mentioned above, yes, this is a very narrow use case
  • anyone you whitelist can technically execute arbitrary code in your container (and since there's bind mounts, place code on the host) through addmusic. so that's great
  • yes, the whitelist is an array in the config file, not role-based
  • yes, these are solvable problems