Skip to content

Leo32onGIT/tibia-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

742 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Violent Bot

This branch is intended for hosting dedicated instances of Violent Bot.
You can run this locally free/m or on a vps for vps hosting cost/m

Patreon

Join Patreon as a paid supporter and I will send you an invite link for the bot I am running myself.
This is the best option if you are non-technical and simply wish to use Violent Bot.

Production:

Current features include:

  • Online List
  • Levels List
  • Deaths List
  • Activity Feed
  • Server Save Notifications
  • Command Log

Pre-requisites:

Create the new bot in Discord

  1. Go to: https://discord.com/developers/applications and create a New Application.
  2. Go to the Bot tab and click on Add Bot.
  3. Click Reset Token & take note of the Token that is generated.

Custom Emojis and Poke Roles

The bot is configured to point to emojis in my discord server.
You will need to change this to point to your emojis.

  1. Upload the emojis provided in the discord emojis folder to your discord.
  2. Open the discord.conf file and edit it.
  3. Point to emoji ids to ones that exist on your discord server - the ones you uploaded in step 1.

Prepare your linux machine to host the bot

  1. Ensure docker is installed.
  2. Ensure Java JDK 8 is installed.
  3. Ensure sbt is installed.
  4. Download the postgres docker image:
    docker pull postgres

Deployment Steps

  1. Clone the repository to your host machine.
  2. Compile the code into a docker image:
    sbt docker:publishLocal
  3. Take note of the docker <image id> you just created: docker images

docker image id

  1. Create a prod.env file with the discord server/channel id & bot authentication token:
TOKEN=XXXXXXXXXXXXXXXXXXXXXX   
POSTGRES_HOST=sqlhost
POSTGRES_PASSWORD=XXXXXXXXXX
TIBIADATA_HOST=https://api.tibiadata.com/
  1. Create the docker volume for the postgres database:
    docker volume create --name pgdata
  2. Create the docker network for the postgres database and violent bot to communicate over:
    docker network create violentbot
  3. Run the postgres docker image:
    docker run --rm -d -t --env-file prod.env --hostname sqlhost --network=violentbot --name postgres -p 5432:5432 -v pgdata:/var/lib/postgresql postgres
  4. Run the docker container you just created & parse the prod.env file:
    docker run --rm -d -t --env-file prod.env --network=violentbot --name violent-bot <image_id>

Debugging

  1. If something isn't working correctly you should be able to see why very clearly in the logs.
  2. Use docker ps to find the <container id> for the running bot.
  3. Use docker logs <container id> to view the logs.
  4. Use docker pull dpage/pgadmin4 and docker run -t --name pgadmin -p 0.0.0.0:82:80 --link postgres:postgres -e 'PGADMIN_DEFAULT_EMAIL=XXXXXXX@gmail.com' -e 'PGADMIN_DEFAULT_PASSWORD=XXXXXXXX' -d dpage/pgadmin4 if you need to visualise the postgres dbs

About

Violent Bot

Resources

Stars

Watchers

Forks

Contributors

Languages