And it can be controlled with HOTKEYS or over the WEBINTERFACE!
Branch | Status |
---|---|
Master | |
Dev | |
Master @ HotkeyClient |
Command | Aliases | Description |
---|---|---|
<sound> |
-/- | Play a sound |
bind <sound> /r/reset |
-/- | bind a sound or random sounds to the fast key, "reset" to reset |
disable | enable | disable or enable the soundboatd [OWNER ONLY] |
help | -/- | Display this help message |
info | -/- | Display some info about this bot |
list [s] |
ls | List all sounds (add argument "s" for time-sorted list) |
log | logs, history | display guilds sound history |
quit | -/- | Quit current voice channel |
random | r, rand | Play a random sound |
search <query/regexp> |
s | search for sounds by query or regexp |
stop | -/- | Stop currently playing sound (does not quit channel) |
summon | -/- | Summons the bot in the voice channel without playing a sound |
- Node.JS and npm
- FFMPEG
OR
- docker
First of all, you need to create a Discord API Bot Application here. Also, you need to create an OAuth2 application with it by clicking on "OAuth2" and add a redirect to <serveraddress>/authorize
(i.e. http://zekro.de:6612/authorize
). It is very important that the <serveraddress>
is exactly the same as configured in the config.json
!
Now, you have 2 options for self-hosting yuri:
- With the supplied Docker image
- With manual node.js setup configuration (way more complex)
Go ahead to Releases and download the latest Docker image of yuri.
This image contains:
- an image of node.js LTS (8.12.0) on Debian Jessie
- the source code of yuri
- a FFMPEG installation
Then, load the image to docker with
$ sudo docker load -i yuri.dockerimage.tar
Now, create a directory expose
with the folder sounds
in it with
$ mkdir -p expose/sounds
Now, start the Docker container once to create the config file in the expose folder
$ sudo docker run -v $PWD/expose:/usr/src/app/expose yuri
Then, there sould be a created config.json
in the expose
directory. Open it, enter your Bot application token got from here, your prefered prefix the bot will listen to, your ID to identify you as the owner of the bot and the websocket password/token. Also, set the sound files directory to "./expose/sounds"
.
Now, you can put all your sounds into the expose/sounds
directory.
Finally, run the Docker container as deamon with the prefered port of the websocket expose:
$ sudo docker run -p 8080:6612 -v $PWD/expose:/usr/src/app/expose -d yuri
Of course, 8080
is just an exaple here. You can expose the web interface to whatever port you want. Just keep in mind, that the pathes on the left side of the :
behind the -v
tag always needs to be an absolute path!
Now, you can check the status of the container with
sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1bdf62abc781 yuri "bash runner.sh" 19 hours ago Up 19 hours 0.0.0.0:6612->6612/tcp fervent_carson
To stop the container, just use the stop command with the container ID of this output:
$ sudo docker stop 1bdf62abc781
Why you need to do all this stuff: Simply, the sound library of yuri has some problems with later versions of node.js then 9.4.0. So, you need to install all dependencies on this version and run the bot with it.
- Clone the repository
$ git clone https://github.com/zekroTJA/yuri.git && cd yuri
-
You need to install ffmpeg on your system. To do this, just follow the steps described in this blog post.
-
Now, you need to install npm package
n
, which will be used to manage multiple node.js versions
$ sudo npm i -g n
- Install node 9.4.0 and check, that the version has changed
$ sudo n 9.4.0
$ node -v
v9.4.0
- Now, install all node modules
$ npm i
- Then, open the
package.json
file and change the"start"
command to"n use 9.4.0 src/main.js"
"scripts": {
"start": "n use 9.4.0 src/main.js"
},
- After that, start the bot once to create the
config.json
located in theexpose
folder.
$ npm start
-
Open the config file, enter your Bot application token got from here, your prefered prefix the bot will listen to, your ID to identify you as the owner of the bot and the websocket password/token. Also, set the sound files directory where you want to store your sound files. Attention: This directory will not be automatically created from the bot, so you will need to create the directory manually!
-
Finally, you need to start the bot with the
runner.sh
script to ensure that the bot restarts after using the restart function. In best case, you should run all of this in a screen session
$ screen -dmLS yuri bash runner.sh
If you do not want to log the output of the screen, just do not use the L
argument.
- At last, you should change back to your latest version of node
$ sudo n latest
...or enter the version you prefer to use normally.
If you set a valid token in the config, you can login to a web interface. This can be accessed on http://<ipoftheserver>:6612
or with the port you set to if you changed it.
Then, join a voice channel on a guild the bot is connecte to and enter your token and your user ID. More information about that you can find in the info field.
After login, you can play sounds by clicking the tiles, search for sounds or manage the bot.
Here you will find more information about setting up the websocket and getting the hotkey client.
Here you can find current tasks to do and ideas to implement.
- body-parser
- cookie-parser
- colors
- discord.js
- express
- express-handlebars
- node-opus
- socket.io
- request
- sqlite3
- sha256
© 2018 zekro Development (Ringo Hoffmann)
zekro.de | contact[at]zekro.de