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.
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.jsonand 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 formusername#tagwho can runaddmusicfor your bot
- in
docker-compose.yaml:- change the volumes to the locations of your
beetsconfig and media folder(s) - optionally change the restart policy to your preference
- change the volumes to the locations of your
- in
Dockerfile:- change the added user to the user who owns the media library on the host
- change the
uidandgidof this user to match the host, if necessary - ensure the version of
beetsto be installed is equal or at least compatible with the host's
- run
docker-compose up --build -dto run the bot
The bot recognizes commands sent by non-bot users, prepended with the prefix character set in the config.json. Below is a list of commands the bot recognizes.
ping- responds to the commands with the one-way and round-trip latency for the bot
- e.g.
!ping
join channelname- Joins the voice channel named
channelname - e.g.
!join General
- Joins the voice channel named
leave channelname- Leaves the voice channel named
channelname - e.g.
!leave General
- Leaves the voice channel named
price type weapon- Returns riven price data for the
weaponof mod typetype, wheretypeis eitherrolledorunrolled - e.g.
!price unrolled kuva bramma
- Returns riven price data for the
search querytype querystring- Looks up music in the host DB, and adds responds w/ the results
- Valid
querytypesinclude['track', 'title', 'song', 'artist', 'album'] querystringis the actual query, so ifquerytypewasartist, a validquerystringwould begreen day
addmusic querytype querystring- Looks up music in the host DB, and adds matching songs to the playlist, and starts playing if nothing is playing already
- Same argument syntax as
search
stop- Stops playback and clears the playlist
next- Returns the next song in the playlist
previous- Returns the previous song that was played
playlist- Returns the contents of the current playlist
pause- Pauses playback
resume- Resumes playback
repeat setting- Sets repeat behaviour to
off,one, orall. The default behaviour of the bot isoff
- Sets repeat behaviour to
skip- Skips to the next song in the playlist
back- Goes back to replay the previous song, and adds the song that was playing at the time of the command back onto the front of the playlist
shuffle- Shuffles the playlist's order
- 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