Skip to content

scorixear/kellerus

Repository files navigation

kellerus

Another Discord Bot

Table of Contents

Set up repository for collaboration (Windows)

1. Download and Install Node.js

Node.js is what will be used to run the bot. Download Node.js 6.x from the website. Open the Node.js Setup. In the options, make sure Node.js runtime,npm package manager and Add to PATH are enabled. After that install Node.js.

2. Install Windows-Build-Tools

Open up a windows powershell and run npm i -g windows-build-tools. This will take a while as it will download and install both python 2.7 and c++ build tools, so you can run node-gyp builds.

3. Download and Install Git

And install it. The website is http://git-scm.com and make sure you choose "for command prompt".

4. Download FFMPEG

Download FFMPEG from this website. Make sure to find the current Static Build for your OS Architecture (32bit/64bit).

5. Install & Configure FFMPEG

Extract the files to the root of your harddrive, and rename the folder to ffmpeg.

Then add FFMPEG to your Path variable:

  1. windows key + x
  2. go to system
  3. on the left Advanced system settings
  4. Environment Variables
  5. under System variables find the variable Path hit edit
  • Depending on your version of windows you may have a list of entries or a semicolon sperated field of entries.

If Windows 10:

  1. Hit the new button on the right
  2. add c:\ffmpeg\bin

If older versions of Windows:

  1. add ;c:\ffmpeg\bin to the end of the field.

6. Download and Install kellerus

Next you'll need to download the bot and configure it. Download the master branch and put the unzipped files in a new folder on your computer. Next rename config_template.json to config.json and enter the correct information (more on that under Setting up kellerus).

For obtaining a Discord Bot token, please see this page.

Before running the bot you need to install the dependencies. In the folder you put the files in, Shift+Right click and select open command window here. In the command prompt type npm install.

The bot should now be ready! Open a command prompt like above and type npm run start to start the bot and see if it works.

7. Install Dependencies

Windows

Shift-RightClick in the folder that you downloaded and select Open command window here. Then type npm install and hit Enter.

Linux

cd to where you cloned the GitHub repo and type npm install. This will take a while.

Credits to bdistin/OhGodMusicBot


Setting up kellerus

When deploying Kellerus, you need to initialize the config.json once! Copy the config_template.json from /src/ to /src/config.json. In this file, there are some mandatory and some optional settings. You need to change the mandatory settings, otherwise the Bot will not run.

Changing the Mandatory Settings

The mandatory settings are token, dbhost, dbuser, dbpassword and dbport.

Discord API token

You can retrieve the token from your discord application (on https://discordapp.com/developers/applications). You need to create a separate application for this bot. Under Bot, click on the Copy button under "Click to Reveal Token" and paste it in the config.json.

Database Setup

The bot needs a db connection. This database must be mysql or mariadb. We do not support a db-less version of this bot. To create a database for local testing, you can use the docker_compose.yaml for a docker setup or create your own database by hand. Copy the host, user, passwort and port into the config.json. We highly recommend to use a local database on the same instance as this bot will run.

This bot will not create its own database. The database must be created by you. The user the bot will use must have full access to this database, and this database only. The dbDataBase specifies the name of this created database.

Changing the Youtube API Key

The bot will contact the Youtube Data API provided by Google. This lets the bot search for youtube videos by given search strings. The YoutubeApiKey must be set in order to provide this functionality. Otherwise the Bot will spit out errors if the queue commmand is used with search attributes.

Changing Optional Settings

Optional Settings are the discordUrl, botPrefix, playPrefix, language and commands. These settings can be left as they are, but give you some modifiability.

  • discordUrl, this is a preset for a possible invite link for this bot. You need to fill in the client_id. This will give the Bot every permission that it does and will need.
  • botPrefix, this represents the single character, that will indicate a command to the bot. The message must start with this character in order to be detected as a legitimate command.
  • playPrefix, the bot has the functionaltiy to save and play small soundfiles. These can be uploaded to the bot via the command add and played via play. Writing every time play is kind of tedious, this playPrefix provides a shortcut for the play command.
  • language, currently the bot is translated to german and english. You can add your own translations by copying the /src/assets/language/en-EN.json and renaming it to you language-code. This setting can be changed while running the bot via the command lang.
  • commands, this is a collection of settings, that limit the SoundFiles, that can be uploaded to the bots server. We suggest to leave them as they are, but you can fiddle with them a bit if you want.

Setting up Puppeteer

Kellerus uses Puppeteer to retrieve current numbers of the ongoing covid19 pandemic. These numbers are retrieved via puppeteer. Running this bot in Windows is not a problem, running it on Linux or Mac require some mandatory addditional packages to be installed. See the Puppeteer on Linux repository for a detailed explanation and the dependencies that must be installed. If the bot is not working because if puppeteer, it will almost definitly be because of missing or changed dependencies.