Skip to content
GitHub

CommandType

enum in meocord/enum Since 4.0.0

enum CommandType

The kind of interaction a @Command handles, such as a slash command or a button.

Pass it to @Command with the command's name or the component's customId pattern. Each member is one Discord interaction type, so the handler's parameter type follows from it; entity select menus are separate members for that reason.

Examples

TypeScript
@Command('profile/{uid}', CommandType.BUTTON)
async profile(interaction: ButtonInteraction, { uid }: { uid: string }) {
  await respond(interaction).send(`Profile of <@${uid}>`)
}

Members

BUTTON

BUTTON = 'BUTTON'

Button, routed by its customId pattern.

CHANNEL_SELECT_MENU

CHANNEL_SELECT_MENU = 'CHANNEL_SELECT_MENU'

Channel select menu.

CONTEXT_MENU

CONTEXT_MENU = 'CONTEXT_MENU'

User or message context menu command, the handler typed with the kind its builder's setType() names.

MENTIONABLE_SELECT_MENU

MENTIONABLE_SELECT_MENU = 'MENTIONABLE_SELECT_MENU'

Mentionable select menu, of users and roles.

MODAL_SUBMIT = 'MODAL_SUBMIT'

Modal submission, routed by its customId pattern.

PRIMARY_ENTRY_POINT

PRIMARY_ENTRY_POINT = 'PRIMARY_ENTRY_POINT'

Activity launch command (ApplicationCommandType.PrimaryEntryPoint).

ROLE_SELECT_MENU

ROLE_SELECT_MENU = 'ROLE_SELECT_MENU'

Role select menu.

SELECT_MENU

SELECT_MENU = 'SELECT_MENU'

String select menu — the one whose options the application defines itself.

SLASH

SLASH = 'SLASH'

Chat input command, or one subcommand of it.

USER_SELECT_MENU

USER_SELECT_MENU = 'USER_SELECT_MENU'

User select menu.

See also

  • Command