Components & Interactions
autoCompleteOptionName
$autoCompleteOptionName
Returns the name of the option the user is typing in, inside an option’s autocomplete script. It takes no argument. Anywhere else it raises Autocomplete functions can only be used in an autocomplete script.
Syntax
$autoCompleteOptionName
Behavior
- The script is stored with the option (see
$appendOptionSuggestion), so this function lets the same script, copied to several options, branch on which one is active. - Read-only script, 2 seconds, 25 suggestions at most: same limits as
$appendOptionSuggestion.
Example
$if[$autoCompleteOptionName==color]
$appendOptionSuggestion[Red;red]
$else
$appendOptionSuggestion[Small;s]
$appendOptionSuggestion[Large;l]
$endif
Try it
Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.