Skip to main content

Welcome Contributors!

Fire is an open-source Discord bot built with TypeScript, Discord.js, and Discord Akairo. This documentation will help you understand the codebase and contribute effectively.

Project Overview

Fire is designed to be a comprehensive Discord bot with:
  • Moderation tools
  • Utility commands
  • Content filtering
  • Ticket system
  • Starboard functionality
  • Premium features
  • And much more!

Technology Stack

Core Dependencies

  • Node.js: >=24.13.0
  • TypeScript: ^5.9.3
  • Discord.js: Custom fork with Fire-specific enhancements
  • Discord Akairo: Command/event framework
  • PostgreSQL: Database via ts-postgres

Key Libraries

package.json
{
  "discord.js": "github:FireDiscordBot/discord.js",
  "discord-akairo": "github:discord-akairo/discord-akairo",
  "ts-postgres": "^2.0.4",
  "@sentry/node": "^10.38.0",
  "i18next": "^25.8.1"
}

Development Workflow

Getting Started

1

Fork and Clone

Fork the repository and clone it to your local machine.
2

Install Dependencies

pnpm install
3

Set Up Environment

Configure your development environment (see Setup).
4

Start Development

pnpm dev

Contributing Guidelines

Code Style

  • Use TypeScript for all new code
  • Follow existing code patterns and conventions
  • Run Prettier before committing:
    pnpm format
    

File Organization

src/
├── commands/        # Bot commands organized by category
│   ├── Admin/
│   ├── Configuration/
│   ├── Fun/
│   ├── Main/
│   ├── Moderation/
│   ├── Premium/
│   ├── Starboard/
│   ├── Tags/
│   ├── Tickets/
│   └── Utilities/
├── modules/         # Bot modules (background tasks, filters)
├── listeners/       # Event listeners
├── inhibitors/      # Command inhibitors
├── arguments/       # Custom argument types
└── languages/       # Internationalization

lib/
├── Fire.ts          # Main bot client
├── Manager.ts       # Cluster manager
├── util/            # Utilities
│   ├── command.ts   # Command base class
│   ├── module.ts    # Module base class
│   └── constants.ts # Constants
└── extensions/      # Discord.js extensions

Module Aliases

The project uses TypeScript path aliases:
import { Fire } from "@fire/lib/Fire";
import { Command } from "@fire/lib/util/command";
import SomeModule from "@fire/src/modules/somemodule";
Path mappings (tsconfig.json:13-18):
  • @fire/lib/*lib/*
  • @fire/src/*src/*
  • @fire/config/*config/*
  • @fire/i18n/*languages/*

Commit Guidelines

Commit Messages

Use clear, descriptive commit messages:
feat: add user timeout command
fix: resolve avatar button interaction issue
refactor: optimize filter module performance
docs: update command creation guide

Before Committing

  • Test your changes thoroughly
  • Run pnpm format to format code
  • Ensure TypeScript compiles: pnpm compile
  • Verify no linting errors

Testing Your Changes

Local Testing

  1. Set up a test Discord server
  2. Create a bot application in Discord Developer Portal
  3. Configure environment variables
  4. Run the bot in development mode:
    pnpm dev
    

Production Build

Test the production build before submitting:
pnpm compile
pnpm start

Getting Help

  • Check existing documentation
  • Review similar commands/modules for examples
  • Ask questions in the Fire Discord server
  • Open an issue for bugs or feature requests

License

Fire is licensed under AGPL-3.0-only. All contributions must comply with this license.

Next Steps

Architecture

Learn about the codebase architecture

Setup Guide

Set up your development environment

Create Commands

Build your first command

Create Modules

Create background modules

Build docs developers (and LLMs) love