Skip to content

Leo32onGIT/tibia-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

690 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

Production:

Current features include:

  • Online List
  • Levels List
  • Deaths List
  • Activity List (guild & name changes)
  • Poke if enemy dies fullbless
  • Poke if anyone dies to a rare nemesis boss

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 and roles in my discord server.
You will need to change this to point to your emojis and your discord roles.

  1. Open the discord.conf file and edit it.
  2. Point to emoji ids to ones that exist on your discord server.

Prepare your linux machine to host the bot

  1. Ensure docker is installed.
  2. Ensure default-jre 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. Run the postgres docker image:
    docker run --rm -d -t --env-file prod.env --hostname sqlhost --name postgres -p 5432:5432 -v pgdata:/var/lib/postgresql/data postgres
  3. Run the docker container you just created & parse the prod.env file:
    docker run --rm -d -t --env-file prod.env --link postgres:postgres --name tibia-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 2

  •  
  •  

Languages