Skip to main content

nodecord

@SlashCommand()
export class StatusCommand {
  constructor(private readonly db: DatabaseService) {}

  @DeferReply()
  @UseInterceptors(EmbedFormatInterceptor)
  execute(@Author() user: User): string {
    return `Hello `${user.username}`, bot is online`;
  }
}
01

Dependency Injection

Built on top of Inversify, Nodecord provides a fully-featured IoC container with scoped modules, global providers, and parent-child container hierarchies.

02

Decorator-driven

Define commands, listeners, interceptors, and providers with expressive decorators like @SlashCommand, @ContextMenu, @Module, and @Injectable.

03

Composable execution pipeline

Every interaction flows through a layered pipeline: module-scoped interceptors, handler interceptors, and param resolvers. All composable, all replaceable. Add logging, guards, or response transforms without touching your handlers.

04

Framework, not a wrapper

@nodecord/core has zero knowledge of any Discord library. The framework defines the pipeline; adapters connect it to the outside world. One ships for discord.js, and you can build your own for anything else.

05

Built for testing

Full unit and integration testing without a live Discord connection. Override providers with TestingModule, or run end-to-end flows with simulateInteraction().

const ctx = createMockChatInputInteraction('ping');
await adapter.simulateInteraction(ctx);
expect(ctx.reply).toHaveBeenCalledWith('Pong!');