Skip to main content
ApplyOptions<Options>(optionsOrFn): ClassDecorator
Defined in: packages/http-framework/src/lib/decorators/ApplyOptions.ts:41 Decorator that sets the options of a Piece, such as a Command, a Listener, or an InteractionHandler.

Type Parameters

Options

Options extends PieceOptions = PieceOptions

Parameters

optionsOrFn

Options | ((context) => Options) The options to pass to the piece’s constructor, or a function that builds them from the loader context.

Returns

ClassDecorator A class decorator.

Remarks

The options are merged on top of the ones the piece was constructed with, so a piece that also passes options through super(context, options) will have the decorator’s values win on conflicting keys.

Examples