Skip to content

IsPherz/AOKillBoard-DiscordBot

Repository files navigation

AOKillboard-DiscordBot

A Discord bot for Albion Online's kill board.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

image image

Usage

  • !ping - replies with @user pong
  • !kbclear - deletes all messages in the config.botChannel
  • !kbinfo <eventId> - displays the kill board post for a specific kill to the current channel

Prerequisites

Installing

1. Local Setup

  1. Clone the repository:

    git clone https://github.com/pierrefeza/AOKillBoard-DiscordBot.git
    cd AOKillBoard-DiscordBot
    
  2. Install Node.js dependencies:

    npm install
    
  3. Create a new Discord Application:

  4. Set up your config.json:

    • Copy config.json.example to config.json
    • Update config.json with your bot token, botChannel, and other necessary details.

    Example config.json:

    "cmdPrefix": "!",
    "allianceName": "<NONE>",
    "guildName": "8-bit",
    "username": "AOKillBoard-DiscordBot",
    "admins": [
        "ADMIN_ID"
    ],
    "botChannel": "445822300890946337",
    "playingGame": "Albion Killboard Bot",
    "token": "YOUR_DISCORD_BOT_TOKEN"
    }```
    
    

2. Running with Docker Locally

  1. Build the Docker image:
    docker build -t aokillboard-discordbot .
    
  2. Run the Docker container:
    docker run -d --name aokillboard-discordbot aokillboard-discordbot 
    
  3. Check the logs:
    docker logs -f aokillboard-discordbot
    
  4. Summary commands
    docker stop aokillboard-discordbot
    docker rm aokillboard-discordbot
    docker build -t aokillboard-discordbot .
    docker run -d --name aokillboard-discordbot aokillboard-discordbot
    docker logs -f aokillboard-discordbot
    

3. Running on AWS EC2

  1. Launch an EC2 instance:

    • Use the AWS Management Console to launch an EC2 instance with Amazon Linux 2 AMI
    • Ensure the instance has a security group that allows inbound SSH (port 22) and the port your bot will use (usually 443 for HTTPS)
  2. Connect to your EC2 instance:

    ssh -i /path/to/your-key-pair.pem ec2-user@your-ec2-public-ip
    
  3. Install Docker on EC2:

    sudo yum update -y
    sudo amazon-linux-extras install docker
    sudo service docker start
    sudo usermod -a -G docker ec2-user
    
  4. Logout and login again to apply the Docker group changes:

     exit
    ssh -i /path/to/your-key-pair.pem ec2-user@your-ec2-public-ip
    
  5. Install Node.js dependencies for buildiung the Docker image:

    sudo yum install -y gcc-c++ make
    curl -sL https://rpm.nodesource.com/setup_16.x | sudo bash -
    sudo yum install -y nodejs
    
  6. Clone the repository on EC2:

    git clone https://github.com/pierrefeza/AOKillBoard-DiscordBot.git
    cd AOKillBoard-DiscordBot
    
  7. Copy your local config.json to the EC2 instance:

    scp -i /path/to/your-key-pair.pem /path/to/your/config.json ec2-user@your-ec2-public-ip:/home/ec2-user/AOKillBoard-DiscordBot/
    
  8. Build the Docker image on EC2:

    docker build -t aokillboard-discordbot .
    
  9. Run the Docker container on EC2:

    docker run -d --name aokillboard-discordbot aokillboard-discordbot
    
  10. Check the logs to ensure the bot is running:

    docker logs -f aokillboard-discordbot
    
    
  11. Commands to clean docker env*

    docker image prune -a -f
    docker container prune -f
    docker volume prune -f
    docker network prune -f
    docker system prune -a -f
    
    

Built With

  • Discord.js - Discord app library for Node.js and browsers.
  • Axios - Promise-based HTTP Client for node.js

Credits

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors