@@ -133,11 +133,6 @@ async def respond(self, content=MISSING, *, tts=False, embed=MISSING, embeds=MIS
133133 -------
134134 :return: Returns the sent message
135135 :type: :class:`~Message` | :class:`EphemeralMessage`
136-
137- .. note::
138-
139- If the response is hidden, a EphemeralMessage will be returned, which is an empty class
140-
141136 """
142137 if ninja_mode is True or all (y in [MISSING , False ] for x , y in locals ().items () if x not in ["self" ]):
143138 try :
@@ -212,7 +207,7 @@ async def send(self, content=None, *, tts=False, embed=MISSING, embeds=MISSING,
212207 ----------
213208 content: :class:`str`, optional
214209 The raw message content
215- tts: `bool`
210+ tts: :class: `bool`
216211 Whether the message should be send with text-to-speech
217212 embed: :class:`discord.Embed`
218213 Embed rich content
@@ -239,9 +234,6 @@ async def send(self, content=None, *, tts=False, embed=MISSING, embeds=MISSING,
239234 -------
240235 :return: Returns the sent message
241236 :type: :class:`~Message` | :class:`EphemeralMessage`
242-
243- .. note::
244- If the response is hidden, a EphemeralMessage will be returned, which is an empty class
245237 """
246238 if self .responded is False :
247239 return await self .respond (content = content , tts = tts , embed = embed , embeds = embeds , file = file , files = files , nonce = nonce , allowed_mentions = allowed_mentions , mention_author = mention_author , components = components , hidden = hidden )
@@ -536,34 +528,49 @@ async def wait_for(self, event_name: Literal["select", "button"], client, custom
536528
537529 Parameters
538530 -----------
539- event_name: :class:`str`
540- The name of the event which will be awaited [``"select"`` | ``"button"``]
541-
542- .. note::
543-
544- ``event_name`` must be ``select`` for a select menu selection and ``button`` for a button press
545-
546- client: :class:`discord.ext.commands.Bot`
547- The discord client
548- custom_id: :class:`str`, Optional
549- Filters the waiting for a custom_id
550- by: :class:`discord.User` | :class:`discord.Member` | :class:`int` | :class:`str`, Optional
551- The user or the user id by that has to create the component interaction
552- check: :class:`function`, Optional
553- A check that has to return True in order to break from the event and return the received component
554- The function takes the received component as the parameter
555- timeout: :class:`float`, Optional
556- After how many seconds the waiting should be canceled.
557- Throws an :class:`asyncio.TimeoutError` Exception
531+ event_name: :class:`str`
532+ The name of the event which will be awaited [``"select"`` | ``"button"``]
533+
534+ .. note::
535+
536+ ``event_name`` must be ``select`` for a select menu selection and ``button`` for a button press
537+
538+ client: :class:`discord.ext.commands.Bot`
539+ The discord client
540+ custom_id: :class:`str`, Optional
541+ Filters the waiting for a custom_id
542+ by: :class:`discord.User` | :class:`discord.Member` | :class:`int` | :class:`str`, Optional
543+ The user or the user id by that has to create the component interaction
544+ check: :class:`function`, Optional
545+ A check that has to return True in order to break from the event and return the received component
546+ The function takes the received component as the parameter
547+ timeout: :class:`float`, Optional
548+ After how many seconds the waiting should be canceled.
549+ Throws an :class:`asyncio.TimeoutError` Exception
558550
559551 Raises
560552 ------
561553 :raises: :class:`discord_ui.errors.InvalidEvent` : The event name passed was invalid
562554
563555 Returns
564556 ----------
565- :returns: The component that was waited for
566- :type: :class:`~PressedButton` | :class:`~SelectedMenu`
557+ :returns: The component that was waited for
558+ :type: :class:`~PressedButton` | :class:`~SelectedMenu`
559+
560+ Example
561+ ---------
562+
563+ .. code-block::
564+
565+ # send a message with comoponents
566+ msg = await ctx.send("okayy", components=[Button("a_custom_id", ...)])
567+ try:
568+ # wait for the button
569+ btn = await msg.wait_for("button", client, "a_custom_id", by=ctx.author, timeout=20)
570+ # send response
571+ btn.respond()
572+ except asyncio.TimeoutError:
573+ # no button press was received in 20 seconds timespan
567574 """
568575 if event_name .lower () in ["button" , "select" ]:
569576 def _check (com ):
0 commit comments