#Button_click wait_for examples

1 messages · Page 1 of 1 (latest)

warm dune
#

Could someone give me an example of how to use await self.bot.wait_for(disnake.Event.button_click)?

And how to check if the custom_id is equivalent to something

restive lichen
#

-d Client.wait_for

lone radishBOT
#

wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Waits for a WebSocket event to be dispatched.

This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.

The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.11)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.11)") for you in case of timeout and is provided for ease of use.

In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.11)") containing those arguments is returned instead. Please check the [documentation](https://docs.disnake.dev/en/latest/api/events.html#disnake-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
warm dune
#

thank you