Giter Club home page Giter Club logo

yuri's Introduction

~ Yuri ~

If you believe or not, the best discord soundboard in whole north korea!
And it can be controlled with HOTKEYS or over the WEBINTERFACE!


     

 

Branch Status
Master
Dev
Master @ HotkeyClient

Commands

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

What you need

  • Node.JS and npm
  • FFMPEG

OR

  • docker

Setup

Register a Discord Bot and its OAuth2 here. In OAuth2 add a redirect to <serveraddress>/authorize (i.e. http://zekro.de:6612/authorize) where <serveraddress> is the same one in config.json!

There are 2 options for self-hosting yuri:

  1. With the supplied Docker image
  2. With manual node.js setup configuration (way more complex)

1 - Using the supplied Docker image

Go to Releases and download the latest Docker image of yuri.
The image contains:
- an image of node.js LTS (8.12.0) on Debian Jessie
- the source code of yuri
- a FFMPEG installation

i) load the image to docker with

$ sudo docker load -i yuri.dockerimage.tar

ii) create a directory expose with the folder sounds in it with

$ mkdir -p expose/sounds

iii) 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

iv) a config.json should have been created in the expose directory. Open the config and enter your Bot application token from here. Also enter your preffered prefix the bot will listen to, your ID to identify you as the bot owner and the websocket password/token. Set the sound files directory to "./expose/sounds".

v) you can put all your sounds into the expose/sounds directory.

vi) 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

8080 is just an example. You can expose the web interface to whatever port you want. Keep in mind, that the paths 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, use the stop command with the container ID:

$ sudo docker stop 1bdf62abc781

2 - Manual configuration of your node.js setup

Why you need to do all this stuff? Simply, the sound library of yuri has some problems with later versions of node.js than 9.4.0. So, you need to install all dependencies on this version and run the bot with it.

i) Clone the repository

$ git clone https://github.com/zekroTJA/yuri.git && cd yuri

ii) Install ffmpeg on your system by following the steps described in this blog post.

iii) Install npm package n, which will be used to manage multiple node.js versions

$ sudo npm i -g n

iv) Install node 9.4.0 and check that the version has changed

$ sudo n 9.4.0
$ node -v
v9.4.0

v) Install all node modules

$ npm i

vi) 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"
},

vii) Start the bot once to create the config.json located in the expose folder.

$ npm start

viii) Open the config and enter your Bot application token from here. Also enter your preffered prefix the bot will listen to, your ID to identify you as the bot owner and the websocket password/token. Set the sound files directory where you want to store your sound files. Attention: This directory will not be created automatically by bot, so you will need to create the directory manually!

ix) start the bot with the runner.sh script to ensure that the bot restarts after using the restart function. In the best case, 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, omit the L argument.

x) change back to your latest version of node

$ sudo n latest

...or enter the version you prefer to use normally.


Web Interface

If you set a valid token in the config, you can log in to the web interface accessed through http://<ipoftheserver>:6612 or with the port you set to if you changed it.

Then, join a voice channel in a guild the bot is connected to and enter your token and user ID. More information can be found in the info field.

After logging in, you can play sounds by clicking the tiles, search for sounds, or manage the bot.


Hotkey Client

Here you will find more information about setting up the websocket and getting the hotkey client.


To Do

Here you can find current tasks to do and ideas to implement.


Used 3rd party dependencies


© 2018 zekro Development (Ringo Hoffmann)
zekro.de | contact[at]zekro.de

yuri's People

Contributors

devmaxiss avatar error2507 avatar zekrotja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

yuri's Issues

Error leaving guild channel without web interface logout

Issue Type

  • Bug
  • Enhancement
  • Feature Suggestion
  • Crash (?)

Application

  • Discord Bot Client
  • Websocket API
  • Hotkey Client
  • Web Interface

Description

Error when not logging out but leaving voice channel on guild created player and session in.

Steps to reproduce

  1. Step
    • Join channel, create player and log in to create session
  2. Step
    • Quit voice channel of guild
  3. Step
    • Reload webpanel

Logs & Screenshots

TypeError: Cannot read property 'id' of undefined
    at Websocket.app.get (/Programs/discordBots/soundBoard2/src/core/websocket.js:102:36)
    at Layer.handle [as handle_request] (/Programs/discordBots/soundBoard2/node_modules/express/lib/router/layer.js:95:5)
    at next (/Programs/discordBots/soundBoard2/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/Programs/discordBots/soundBoard2/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/Programs/discordBots/soundBoard2/node_modules/express/lib/router/layer.js:95:5)
    at /Programs/discordBots/soundBoard2/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/Programs/discordBots/soundBoard2/node_modules/express/lib/router/index.js:335:12)
    at next (/Programs/discordBots/soundBoard2/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/Programs/discordBots/soundBoard2/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:160:13)

Add Lavalink support

Issue Type

  • Bug
  • Enhancement
  • Feature Suggestion
  • Crash

Application

  • Discord Bot Client
  • Websocket API
  • Hotkey Client
  • Web Interface

Description

Add lavalink support. https://github.com/Frederikam/Lavalink (https://github.com/sedmelluq/lavaplayer)
The current issue with Yuri is that you have to restart the bot after you've been running it for a while. It gets slower and slower.
Lavalink should solve this problem. It's a proven solution used by Rythm, RedDiscord-Bot, Dyno, Fredboat, ... .
It's a solution written in java but you can treat it as a blackbox. There are clients written in python, javascript, java, etc. .
You download the .jar file and run the server with java -jar Lavalink.jar. Configuration of the lavalink server is done via application.yml.
On your Discord Bot you connect to the lavalink server by providing the hostname, the port and the password.

The massive advantage is you have a really performant audio player with low memory footprint

C# client recognizes wron keybinds

Issue Type

  • Bug
  • Enhancement
  • Feature Suggestion
  • Crash

Application

  • Discord Bot Client
  • Websocket API
  • Hotkey Client
  • Web Interface

Description

(Windoof) Keybinds like CTRL+1 are recognized randomly as CTRL+WIN+1 or CTRL+ALT+1

Steps to reproduce

I bound multiple sounds, but just on my number keys - I got keybinds for CTRL+1, CTRL+2..., and some for CTR+ALT+1...
Sometimes, the keybinds are recognized as a different one.
image

Relogin / Refetch button in web interface

Issue Type

  • Bug
  • Enhancement
  • Feature Suggestion
  • Crash

Application

  • Discord Bot Client
  • Websocket API
  • Hotkey Client
  • Web Interface

Description

Relogin / Refetch button to re-create session if logged in users guild changed.

Session Idle Timeout

Issue Type

  • Bug
  • Enhancement
  • Feature Suggestion
  • Crash

Application

  • Discord Bot Client
  • Websocket API
  • Hotkey Client
  • Web Interface

Description

If you dont do any action with the soundboard for a defined time, the the session will be destroyed and you must re-login.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.