Skip to content

Wait for Component #103

Answered by breqdev
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the kind words, I'm glad you find this useful!

The easiest way to do what you mention is by using a followup to edit the original message, disabling the button. I just added an example of something similar:

https://github.com/Breq16/flask-discord-interactions/blob/785ea3668e99faa13616f6a640a695ca6f8cd9ee/examples/followup.py#L97-L158

If the timeout is going to take a while and you'd rather not have a background thread for that whole time, you could instead try storing the timestamp of the original message inside the custom_id, then when a button press comes in, using the current time to determine if it's past the time limit. That wouldn't update the appearance of the button, th…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant