oopscord.js
    Preparing search index...

    Class DiscordApp

    Main application class for managing Discord bot functionality.

    Handles initialization, login, command deployment, and interaction routing for a Discord application. This class uses the Discord.js library and implements a decorator-based command and component system.

    import { DiscordApp } from "oopscord.js";
    import { AppModule } from "./app.module";

    async function bootstrap() {
    const app = DiscordApp.create(AppModule);
    await app.login();
    }

    bootstrap();
    • Must be instantiated using the static create() method
    • Supports global and guild-specific (private) command deployment
    • Routes interactions (commands, buttons, select menus, modals) to appropriate handlers
    • Uses reflection metadata for decorator-based configuration
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Creates a new Discord application. This is the main entry point of the library. You must provide a class that extends BaseDiscordModule, which will be used as the main module of the application.

      Parameters

      • discordModule: typeof BaseDiscordModule

        The main module of the application. This class must extend BaseDiscordModule.

      • options: DiscordAppOptions = {}

        The options for the application.

      Returns DiscordApp

      import { DiscordApp } from "oopscord.js";
      import { AppModule } from "./app.module";

      async function bootstrap() {
      const app = DiscordApp.create(AppModule);

      await app.login();
      }

      bootstrap();