bindTo

@CheckReturnValue
open fun bindTo(handlerName: String, vararg data: Any?): T(source)
@CheckReturnValue
open fun bindTo(handlerName: String, data: List<Any?>): T(source)

Binds the given handler name with its arguments to this component.

Handler data

The data passed is transformed with toString, except snowflakes which get their IDs stored.

The data can only be reconstructed if a ComponentParameterResolver exists for the handler's parameter type.

Remember the parameters need to be annotated with @ComponentData.

Parameters

handlerName

The name of the handler to run when the button is clicked, defined by either JDAButtonListener or JDASelectMenuListener

data

The data to pass to the component handler


@CheckReturnValue
abstract fun bindTo(handlerName: String, block: ReceiverConsumer<PersistentHandlerBuilder>): T(source)

Deprecated

Nothing else to be configured than the data, will be removed, pass your data to bindTo directly

Binds the given handler name with its arguments to this component.

Parameters

handlerName

The name of the handler to run when the button is clicked, defined by either JDAButtonListener or JDASelectMenuListener