Skip to content

Setup Guide

How to set up the Project 1999 Discord bot for local development or production deployment.

  • Node.js 20+
  • npm (comes with Node.js)
  • PostgreSQL 14+ with an existing database and schema
  • Discord bot token with the Guilds intent enabled
  • (Optional) A local MediaWiki instance for item/spell lookups

Copy .env.example to .env and fill in the values:

Terminal window
cp .env.example .env
VariableDescription
DISCORD_TOKENBot token from the Discord Developer Portal
BOT_SELFBot’s application (client) ID
GUILD_IDID of the Discord server (guild) to register commands in
PGHOSTPostgreSQL hostname
PGPORTPostgreSQL port (default: 5432)
PGUSERDatabase username
PGPASSWORDDatabase password
POSTGRES_DBDatabase name
  1. Create a PostgreSQL database.
  2. Run the schema from schema.sql to create all tables and views.
  3. Populate reference tables (class_definitions, races, raids, etc.) with EverQuest data.

The bot uses synchronize: false in TypeORM, so it will not create or modify tables automatically.

Terminal window
# Install dependencies
npm install
# Compile TypeScript
npm run build
# Register slash commands with your guild (run once, or after adding new commands)
npx esrun register_guild_commands.ts
# Start the bot
npm start
Terminal window
# Install docs dependencies (first time only)
cd docs && npm install && cd ..
# Development server with hot reload
npm run docs:dev
# Production build
npm run docs:build
  1. Go to the Discord Developer Portal.
  2. Create a new application (or use an existing one).
  3. Under Bot, enable the Guilds intent.
  4. Copy the bot token to your .env file.
  5. Under OAuth2 > URL Generator, select the bot and applications.commands scopes.
  6. Select permissions: Manage Roles, Send Messages, Use Slash Commands, Embed Links.
  7. Use the generated URL to invite the bot to your server.

The bot is deployed on Railway:

  1. Connect your GitHub repository to a Railway project.
  2. Set all environment variables in the Railway dashboard.
  3. Railway will build with npm run build and run with npm start.
  4. Slash commands are registered separately — run register_guild_commands.ts from a local machine or a Railway one-off command.

Documentation is automatically built and deployed via GitHub Actions on every push to main:

  1. Enable GitHub Pages in your repository settings.
  2. Set the source to GitHub Actions.
  3. The .github/workflows/docs.yml workflow handles building and deploying.