bindTo

@CheckReturnValue
open fun bindTo(handler: Consumer<E>): T(source)
abstract fun bindTo(handler: suspend (E) -> Unit): T(source)

Binds the given handler to this component.

Captured entities

Pay extra attention to not capture JDA entities in such handlers as they can stop being updated by JDA. You should instead make a variable from the entity's ID, outside the lambda, then capture it.

Parameters

handler

The handler to run when the button is clicked