Carbon
CoreClasses

FieldsHandler

This class is used to parse the options of a command, and provide errors for any missing or invalid options. It is used internally by the Command class.

Extends

  • Base

Constructors

new FieldsHandler()

new FieldsHandler(client, interaction): FieldsHandler

Parameters

ParameterType
clientClient
interactionAPIModalSubmitInteraction

Returns

FieldsHandler

Overrides

Base.constructor

Properties

PropertyModifierTypeDefault valueDescriptionInherited from
clientpublicClientundefined-Base.client
errorsreadonlystring[][]The errors that were encountered while parsing the options.-
rawreadonlyobject{}The raw options that were in the interaction data, before they were parsed.-

Methods

getText()

getText(key, required)

getText(key, required?): undefined | string

Get the value of a text input.

Parameters
ParameterTypeDescription
keystringThe name of the input to get the value of.
required?false-
Returns

undefined | string

The value of the input, or undefined if the input was not provided.

getText(key, required)

getText(key, required): string

Parameters
ParameterType
keystring
requiredtrue
Returns

string

On this page

Edit on GitHub