Brynjolf Suite

A lightweight, modular toolkit for building scalable Discord bots with TypeScript decorators and simplified command registration.

The Brynjolf Suite is a collection of developer tools designed to streamline the creation of Discord bots. It focuses on reducing boilerplate and providing a modular, stateful architecture for handling commands and events using modern TypeScript features.

Components

Brynjolf Commands

A library-agnostic command handler that simplifies the registration and management of Discord interactions. It avoids deeply nested object literals in favor of a clean, builder-based approach.

Brynjolf Events

A modular event listener system that uses TypeScript decorators to convert classes into listeners. It allows for decentralized event handling without needing a constant reference to the Discord client.

Key Features

  • Decorator-Based Listeners: Clean and modular event handling using @Event decorators.
  • Simplified Registration: Register all commands and events with single function calls.
  • Library Agnostic: Designed to work with the Discord API directly or through popular libraries like Discord.js.
  • Developer Experience: Built-in intellisense and full TypeScript support for a smooth coding experience.

Technology Stack

  • Language: TypeScript
  • Environment: Node.js
  • Dependencies: Minimal (Brynjolf Events has zero dependencies)

Local Setup

To use the Brynjolf Suite in your project:

  1. Install the Packages:

    npm install @brynjolf/commands @brynjolf/events
    
  2. Initialize in your Main File:

    import { events } from "@brynjolf/events";
    import { commands } from "@brynjolf/commands";
    
    // Pass your Discord client to the suite
    events.client(client);
    
    // Register your commands
    commands.setToken(process.env.TOKEN);
    commands.registerAll();