Skip to content
Functioncorev0.14.0Decorator

UserContextMenuRoute

Routes one or more user context-menu commands to a UserContextMenuHandler.

Every name is checked against the user registry. The handler's generic must declare the same names, checked in both directions.

UserContextMenuRoute<Names>(
    names: Names[]
): <TCtor extends AnyHandlerCtor>(
    constructor: AssertContextMenuRoute<ApplicationCommandType.User, Names, TCtor>
) => void
\@UserContextMenuRoute('View Profile')
class ViewProfile extends UserContextMenuHandler<'View Profile'> {
    async execute() {
        const user = this.target;
    }
}

Names

Names

names

names: Names[]

The command name(s) this handler serves.