Skip to main content

Function: isAnyInteractableInteraction()

isAnyInteractableInteraction(messageOrInteraction: APIMessage | BaseInteraction <CacheType> | Message<boolean>): messageOrInteraction is AnyInteractableInteraction

Checks whether the input messageOrInteraction is one of Message or any class that extends BaseInteraction As opposed to isAnyInteraction this also checks that the interaction can actually be interacted with by the user which means that this cannot be an AutocompleteInteraction. That said, this type guard filters the messageOrInteraction down to one of:

  • Interaction
  • ButtonInteraction
  • ChannelSelectMenuInteraction
  • ChatInputCommandInteraction
  • CommandInteraction
  • ContextMenuInteraction
  • MentionableSelectMenuInteraction
  • MessageComponentInteraction
  • MessageContextMenuCommandInteraction
  • ModalSubmitInteraction
  • RoleSelectMenuInteraction
  • SelectMenuInteraction
  • StringSelectMenuInteraction
  • UserContextMenuCommandInteraction
  • UserSelectMenuInteraction

Parameters

ParameterTypeDescription
messageOrInteractionAPIMessage | BaseInteraction <CacheType> | Message<boolean>The message or interaction that should be checked.

Returns

messageOrInteraction is AnyInteractableInteraction

true if the messageOrInteraction is an instanceof BaseInteraction and does NOT pass Interaction.isAutocomplete(), false otherwise.

Source

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:282