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
If you want to use Nessie for your own projects, you would need the following before getting started:
- Have a Discord Application created from the Discord Dev Portal
- Have the Discord Application invited to a Discord Server
- Node with a version of at least v16.13.0
- Yarn
- An API key generated from https://apexlegendsapi.com/
- Clone this repository and then change directly into it
git clone [this repo]
cd [your new repo file]
- Install dependencies
yarn install
- 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
- You would need the following core environment variables in order to start your Discord bot:
- Start your App
yarn start
Nessie uses Discord's Slash Commands /
:
br
: map rotation for battle royalemixtape
: map rotation for mixtapestatus help
: information on how to set up automatic map updatesstatus start
: display configuration steps to start automatic map updatesstatus stop
: display configuration steps to stop existing automatic map updatesabout
: information hub of Nessiehelp
: list of commandsinvite
: generates Nessie's invite link
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:
- Windows: https://www.postgresqltutorial.com/postgresql-getting-started/install-postgresql/
- Mac: https://postgresapp.com/
- Linux: https://www.postgresqltutorial.com/postgresql-getting-started/install-postgresql-linux/
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:
- Design Prototypes
- Adventures in Discord's Rate Limits
- Spike on Time Taken for Status Cycles
- Edge Cases
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 readmeCreate alternative branch to make Nessie easily self hosted[Not Doing]Create contribution guideRestructure non-command files- Make command files object-oriented
Migrate to TypescriptMake error handling a reusable componentUse webhooks instead of manually sending logs through messages- Research multithreading
CircleCi Integration[Using github actions]Metabase Integration[Using Trevor instead]- Datadog Integration
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!
- Create a new branch
git checkout -b your-new-branch
- Commit your changes
git commit -a -m 'Description of the changes'
- Push your branch
git push origin your-new-branch
- Open a pull request
Distributed under the MIT License