/Shiro.py

Play song quizzes and enhance your guild with anime features!

Primary LanguageModelicaGNU Affero General Public License v3.0AGPL-3.0

Shiro Avatar

Shiro.py - Work in progress

Codacy Badge Build Status Documentation Status Crowdin

Python Version Discord Server Bot Version License

Want to guess anime openings with your friends? Get Shiro to play song quizzes and enhance your guild with fun related anime features!

Table of Contents

Setup

The following setup is done with docker on debian. If you're using another os, it may variate a bit. If you don't like docker, you can also install everything on your own. But be aware, you won't get automatic patches then!

Docker

First of all you need to install docker. Check this tutorial

sudo apt-get update
sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce

Postgres Database

Then you have to download and run the postgres docker image and mount it to a dir.

docker pull postgres
mkdir -p $HOME/docker/volumes/postgres
docker run --rm --name postgres -e POSTGRES_DATABASE=shiro -e POSTGRES_USER=shiro -e POSTGRES_PASSWORD=shiro -d -p 5432:5432 -v $HOME/docker/volumes/postgres:/var/lib/postgresql/data postgres

Lavalink Server

Also, you have to setup a Lavalink server in order for the bot to play music. More about Lavalink

docker pull fredboat/lavalink:master
mkdir -p $HOME/docker/volumes/lavalink
nano $HOME/docker/volumes/lavalink/application.yml # Paste default config from Lavalink and set password
docker docker run --rm --name lavalink -v $HOME/docker/volumes/lavalink/application.yml:/opt/Lavalink/application.yml -d -p 2333:2333 fredboat/lavalink:master

Shiro

After installing and running all requirements, we finally can start Shiro. It will automatically create all tables in the database. Configure

docker pull mrspinne/shiro.py:master
docker run --rm --name shiro -e DISCORD_TOKEN=shiro -d mrspinne/shiro.py:master

Watchtower

The following will keep you docker container up to date. If you only want to auto update specific container, have a look here.

docker pull containrrr/watchtower
docker run --rm --name watchtower -d -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower

Configuration

The configuration file is located in data/config.ini. If you use docker, it's recommended to pass config values via environmental variables (or you mount the config).

Config options

Please note that sections marked with optional in the config.ini aren't supposed to be used by you. Create a Discord application

config.ini (the part you have to configure)

[Discord]
token = 

[Postgres]
host =
port =
database =
user =
password =

[Lavalink]
host =
port =
password =
region =

Environmental Variables

If you want to use envs, here is how to pass them. You can look up them from the config. Example envs: DISCORD_TOKEN, POSTGRES_HOST, POSTGRES_PORT, LAVALINK_PASSWORD

Contribute

I'd like to hear your thoughts about the whole project. It's far from perfect so feel free to contribute.

Links

All important links can be found on the landing page at https://shiro.pro.

Bot lists

Below are all bot lists, Shiro is currently on. (Only lists with widget shown)