Skip to content
GitHub

CommandInteractionType

type alias in meocord/interface Since 4.0.0

type CommandInteractionType<
  CBC extends BuildableCommandType,
  T extends CommandBuilderConstructor<CBC> | CommandType,
> =
  T extends CommandBuilderConstructor<CommandType.SLASH>
    ? ChatInputCommandInteraction
    : T extends CommandBuilderConstructor<CommandType.CONTEXT_MENU>
      ? ContextMenuInteractionOf<ReturnType<InstanceType<T>['build']>>
      : T extends CommandBuilderConstructor<CommandType.PRIMARY_ENTRY_POINT>
        ? PrimaryEntryPointCommandInteraction
        : T extends keyof ComponentInteractionMap
          ? ComponentInteractionMap[T]
          : never

The interaction a @Command handler receives, from its builder or its CommandType.

See also

  • Command