Tagscript

MapOptions

TagScript


Function: mapOptions()

mapOptions(options, resolved, transformers, prefix?): void

Defined in: tagscript-plugin-discord/src/lib/Utils/CommandInteraction.ts:28

Maps a slash command's options onto transformers, following subcommands into the same flat object.

Parameters

options

readonly APIApplicationCommandInteractionDataOption[]

The options to map

resolved

APIInteractionDataResolved

The interaction's resolved data, which holds the objects the options point at

transformers

Record<string, ITransformer>

The object to write the transformers onto

prefix?

string = ''

Prepended to every option name, used to namespace subcommand options

Returns

void

On this page