Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Enabling buttons dynamically #103

Answered by kvsxxx
Roopesh-J asked this question in Q&A
Nov 2, 2021 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Well, yes but no. You can enable the button dynamically, but this will send a edit request to the api, so you would kind of edit the message.

In the current version, this can be done by enabling all components in the message

...
# send the message
msg = await ctx.send("this is a test", components=[
    # disable the button with disabled=True
    Button("hmm", "test", disabled=True), 
    SelectMenu("test", [SelectOption("2", "test")])
])
# wait for a selection
select = await msg.wait_for("select", bot)
# respond to the selected menu
await select.respond()
# enable all components, setting the disable parameter to False, 
# so for every component the `.disabled` property will be set to Fals…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Roopesh-J
Comment options

@Roopesh-J
Comment options

@kvsxxx
Comment options

@Roopesh-J
Comment options

Answer selected by kvsxxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants