InteractionListener

export declare class InteractionListener<Client extends IgloClient = IgloClient> extends Base<Client> implements InteractionListenerOptions

Constructor

constructor(client: Client, options: InteractionListenerOptions): this;

Paramaters

nametypeoptionaldescription
clientClientNo-
optionsInteractionListenerOptionsNo-

Properties

check: (id: string) => boolean

client: Client

The Discord client to interact with Discord

filepath: string

The name of the filepath associated with the InteractionListener

name: string

The name (customId) of the Interaction

strategy: endsWith | startsWith | include | equal

The strategy the handler should use to check if the interaction should be ran by this class

default

"equal"

type: ComponentType.Button | ComponentType.StringSelect | InteractionType.ModalSubmit

The type of interactions you accept for the listener

Methods

_run(interaction)

function _run(interaction: Interaction): Promise<void>

Paramaters

nametypeoptionaldescription
interactionInteractionNo-

Description

load(options)

function load(options: InteractionListenerLoadOptions): void

Paramaters

nametypeoptionaldescription
optionsInteractionListenerLoadOptionsNo-

Description

Runs when the InteractionListener is loaded

requires

super callback on overwrite

run(interaction)

function run(interaction: Interaction): Awaitable<void>

Paramaters

nametypeoptionaldescription
interactionInteractionNo-

Description

unload()

function unload(): void

Description

Runs when the InteractionListener is unloaded

requires

super callback on overwrite