option
constoption:object
Defined in: packages/core/src/commands.ts:137
Describes the options of a command. The key you give each one in
command({ options }) is its name; the handler gets them typed.
- An option is required when
required: true, and also never missing when it has adefault. user,roleandchannelgive the id;mentionablegives{ id, type };attachmentgives the attachment.
Type Declaration
Section titled “Type Declaration”attachment
Section titled “attachment”attachment: <
C>(config?) =>OptionDef<APIAttachment,C>
Type Parameters
Section titled “Type Parameters”C extends OptionConfig
Parameters
Section titled “Parameters”config?
Section titled “config?”C
Returns
Section titled “Returns”boolean
Section titled “boolean”boolean: <
C>(config?) =>OptionDef<boolean,C>
Type Parameters
Section titled “Type Parameters”C extends BooleanConfig
Parameters
Section titled “Parameters”config?
Section titled “config?”C
Returns
Section titled “Returns”OptionDef<boolean, C>
channel
Section titled “channel”channel: <
C>(config?) =>OptionDef<string,C>
Type Parameters
Section titled “Type Parameters”C extends ChannelConfig
Parameters
Section titled “Parameters”config?
Section titled “config?”C
Returns
Section titled “Returns”OptionDef<string, C>
choice
Section titled “choice”choice: <
W,C>(words,config?) =>OptionDef<W[number],C>
A choice between fixed words; the handler gets the word, typed as the union.
Type Parameters
Section titled “Type Parameters”W extends readonly string[]
C extends ChoiceConfig<W[number]>
Parameters
Section titled “Parameters”W
config?
Section titled “config?”C
Returns
Section titled “Returns”OptionDef<W[number], C>
integer
Section titled “integer”integer: <
C>(config?) =>OptionDef<number,C>
Type Parameters
Section titled “Type Parameters”C extends NumberConfig
Parameters
Section titled “Parameters”config?
Section titled “config?”C
Returns
Section titled “Returns”OptionDef<number, C>
mentionable
Section titled “mentionable”mentionable: <
C>(config?) =>OptionDef<MentionableValue,C>
Type Parameters
Section titled “Type Parameters”C extends OptionConfig
Parameters
Section titled “Parameters”config?
Section titled “config?”C
Returns
Section titled “Returns”OptionDef<MentionableValue, C>
number
Section titled “number”number: <
C>(config?) =>OptionDef<number,C>
Type Parameters
Section titled “Type Parameters”C extends NumberConfig
Parameters
Section titled “Parameters”config?
Section titled “config?”C
Returns
Section titled “Returns”OptionDef<number, C>
role: <
C>(config?) =>OptionDef<string,C>
Type Parameters
Section titled “Type Parameters”C extends OptionConfig
Parameters
Section titled “Parameters”config?
Section titled “config?”C
Returns
Section titled “Returns”OptionDef<string, C>
string
Section titled “string”string: <
C>(config?) =>OptionDef<string,C>
Type Parameters
Section titled “Type Parameters”C extends StringConfig
Parameters
Section titled “Parameters”config?
Section titled “config?”C
Returns
Section titled “Returns”OptionDef<string, C>
user: <
C>(config?) =>OptionDef<string,C>
Type Parameters
Section titled “Type Parameters”C extends OptionConfig
Parameters
Section titled “Parameters”config?
Section titled “config?”C
Returns
Section titled “Returns”OptionDef<string, C>