Skip to content
Functioncorev0.14.0Decorator

ButtonRoute

Routes button interactions to handler classes.

Pass the CustomId definition(s) this handler decodes and list the same ones in the handler's generic. Passing different definitions to the decorator and the generic is a compile error. A wire minted from an older shape still reaches the handler because routing matches the stable prefix. Reading this.params there throws StaleCustomId, and the controller boundary turns it into a reply.

ButtonRoute<Defs>(
    defs: Defs
): <TCtor extends AnyHandlerCtor>(
    constructor: AssertComponentRoute<InteractionKind.Button, Defs, TCtor>
) => void

Defs

Defs

defs

defs: Defs

The customId definition(s) this handler decodes, one per route.