Skip to content

@bight-ts/plugin-message-commands

import {
createMessageCommandsPlugin,
defineMessageCommand,
} from "@bight-ts/plugin-message-commands";

Registers message-based command handlers that trigger on chat messages.

PropertyTypeRequiredDescription
commandsMessageCommand[]YesArray of message command definitions
enabledbooleanNoToggle the plugin
namestringNoPlugin name. Defaults to "message-commands"

Defines a command that matches against chat messages.

PropertyTypeRequiredDescription
data{ name: string, description: string }YesCommand metadata (used in diagnostics, not Discord UI)
match(input: { message, context }) => booleanYesReturns true if this command should handle the message
execute(input: { message, context }) => voidYesThe command handler
preconditionsstring[]NoNamed preconditions
onDeniedBightDeniedHandlerNoCustom denial handler
  • Commands are evaluated in declaration order. The first match that returns true wins.
  • Requires GuildMessages and MessageContent gateway intents.
  • Errors and denials are recorded as diagnostic events.