#StringSelect with several values

1 messages · Page 1 of 1 (latest)

vast dust
#

How get selected values?
Code:

row.add_string_select(
      placeholder='Select...',
      custom_id='select_perm_role',
      options=select_menu_options,
      min_values=1,
      max_values=7
    )
delicate fern
vast dust
delicate fern
#

Ummm.

vast dust
#

I'm select 7 values

delicate fern
#

We only want the first (and in this case, only) one.

await inter.response.send_message(f"Your favorite type of animal is: {self.values[0]}")

vast dust
#

but inter.values return nothing

delicate fern
#

Should be able to figure out how to handle multiple since self.values is a list of the selected options.

#

You should how you're adding the select, but no callback code, so one can only assume you're using a View.

delicate fern
#

Since that is the more common way

#

If you can't figure it out from the docs and guide, then you'll need to provide relevant callback code.

soft fractal
#

If I am not wrong it should also be in interactiondata

delicate fern
#

I mean, you can do that, but that's a long way to inter.values.