Skip to content
Functioncorev0.14.0Decorator

RoleMenuRoute

Routes role select menu interactions to a RoleMenuHandler.

Pass the CustomId definition(s) this handler decodes and list the same ones in the handler's generic. Beside this.values the handler declares this.roles.

RoleMenuRoute<Defs>(
    defs: Defs
): <TCtor extends AnyHandlerCtor>(
    constructor: AssertComponentRoute<InteractionKind.RoleMenu, Defs, TCtor>
) => void
\@RoleMenuRoute(GrantId)
class Grant extends RoleMenuHandler<[typeof GrantId]> {
    async execute() {
        await this.update(`granting ${this.roles.size} role(s)`);
    }
}

Defs

Defs

defs

defs: Defs

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