#SelectMenu Callback Disable
1 messages · Page 1 of 1 (latest)
Hey! Once your issue is solved, press the button below to close this thread!
Is there a helpful page in the docs? I only found the callbacks for buttons, but not for SelectMenus
Can you show thee code you did for how you sent the select menu?
you need to edit the message and send again the disabled component
ctx.edit_origin(components=...)
@interactions.slash_command(
name="test"
)
async def test(ctx: interactions.SlashContext):
comp = interactions.StringSelectMenu(
interactions.StringSelectOption(label="1", value="1", description="...", emoji=":beers:"),
interactions.StringSelectOption(label="2", value="2", description="???...!!!", emoji=":skull:"),
interactions.StringSelectOption(label="3", value="3", description=",,", emoji=":800AAAA2:"),
interactions.StringSelectOption(label="4", value="4", description="Something", emoji=":beers:"),
custom_id="sm",
placeholder="Choose one option",
min_values=1,
max_values=1
)
await ctx.send(components=comp)
@interactions.component_callback("sm")
async def callback(ctx: interactions.ComponentContext):
print(ctx.values)
ctx.component.disabled = True
await ctx.send(f"You clicked!")
^
Aw, yes, sry I've seen it too late 😉
It works, thank you! 👍