Skip to content

vexuas/nessie

Repository files navigation

nessie
Apex Legends Map Status Discord Bot

Simple discord bot that provides an easy way to get status updates of map rotations in the game Apex Legends. Data extracted from https://apexlegendsapi.com/ and @SDCore

image

image image

Prerequisites

If you want to use Nessie for your own projects, you would need the following before getting started:

Installation

  1. Clone this repository and then change directly into it
    • git clone [this repo]
    • cd [your new repo file]
  2. Install dependencies
    • yarn install
  3. Add required environment variables
    • You would need the following core environment variables in order to start your Discord bot:
      • BOT_TOKEN
      • BOT_ID
      • GUILD_ID
      • ALS_API_KEY
    • Generate these configurations using:
      yarn config:init
      
    • Finally, fill in the required variables above with your data
      src/config/environment.ts
      //Bot Configuration; Required
      export const BOT_TOKEN = 'Your Discord Bot Token';
      export const BOT_ID = 'Your Discord Bot ID';
      export const GUILD_ID = 'The Discord Server ID you want the bot to register Slash Commands in';
      
      //API key to retrieve apex data
      export const ALS_API_KEY = 'Your API key from apexlegendsapi';
    • Note: You may have noticed at this point there are other environment variables generated as well. These are optional to use and is not necessary for the bot to run but they are defined to avoid typescript errors. More information on these variables in this discord bot template here
  4. Start your App
    • yarn start

Command list

Nessie uses Discord's Slash Commands /:

  • br: map rotation for battle royale
  • mixtape: map rotation for mixtape
  • status help: information on how to set up automatic map updates
  • status start: display configuration steps to start automatic map updates
  • status stop: display configuration steps to stop existing automatic map updates
  • about: information hub of Nessie
  • help: list of commands
  • invite: generates Nessie's invite link

Setting Up Automatic Map Status

Gonna add a detailed guide here someday but use status help for now! It's probably straightforward enough. Probably.

For self-hosted projects, you are required to set up a PostgreSQL database to make the automatic updates work. Without the database, it will create the relevant channels, webhooks and the initial status message but the functionality stops there. I should probably also set up some guides for that but here are a couple of links to get you started with it for now:

After setting up the database, you would need to fill in the environment variable DATABASE_CONFIG with your database credentials. The typing for this is generally

type DatabaseConfig = {
  database: string;
  host: string;
  user: string;
  port: number;
  password: string;
  ssl: {
    rejectUnauthorized: boolean;
  };
};

A more detailed breakdown of this can be found through the node-postgres package

With these done, give status start a whirl and the automatic updates should be working now

Some cool links regarding the status command:

TODO

Full list here. Kinda exhausted myself working on Nessie so most of these would probably only get picked up after October 2022; gonna be working on other projects in the meantime

  • Add installation guide to this readme
  • Create alternative branch to make Nessie easily self hosted [Not Doing]
  • Create contribution guide
  • Restructure non-command files
  • Make command files object-oriented
  • Migrate to Typescript
  • Make error handling a reusable component
  • Use webhooks instead of manually sending logs through messages
  • Research multithreading
  • CircleCi Integration [Using github actions]
  • Metabase Integration [Using Trevor instead]
  • Datadog Integration

Contributing

Any contributions are greatly appreciated! If you have any suggestions that would make Nessie better, you can either create a pull request or simply open an issue!

  1. Create a new branch
    • git checkout -b your-new-branch
  2. Commit your changes
    • git commit -a -m 'Description of the changes'
  3. Push your branch
    • git push origin your-new-branch
  4. Open a pull request

License

Distributed under the MIT License