Skip to content
Components & Interactions getStringSelectCount

$getStringSelectCount

$getStringSelectCount returns the number of values selected by the user in a string select menu, as a number.

Syntax

$getStringSelectCount

It takes no argument.

Behavior

  • Only usable in the callback of a component interaction (a select menu choice). Elsewhere it raises “Select values require a component callback.”.
  • If the callback carries no stringSelect selection it raises “This callback has no stringSelect selection.”.
  • To read the selected values themselves, use $getStringSelectValues.

Example

$sendMessage[You selected $getStringSelectCount value(s).]

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.