Skip to content
Functioncorev0.14.0Decorator

UserMenuRoute

Routes user select menu interactions to a UserMenuHandler.

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.users and this.members. Discord resolves the members only inside a guild.

UserMenuRoute<Defs>(
    defs: Defs
): <TCtor extends AnyHandlerCtor>(
    constructor: AssertComponentRoute<InteractionKind.UserMenu, Defs, TCtor>
) => void
\@UserMenuRoute(AssignId)
class Assign extends UserMenuHandler<[typeof AssignId]> {
    async execute() {
        const { roleId } = this.params;
        await this.reply(`assigning ${this.users.size} member(s) to <@&${roleId}>`);
    }
}

Defs

Defs

defs

defs: Defs

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