Browse Source

chore: update docstrings

pull/10166/head
DA-344 1 month ago
parent
commit
ec186ab18f
  1. 4
      discord/abc.py
  2. 5
      discord/channel.py
  3. 7
      discord/client.py
  4. 4
      discord/webhook/async_.py
  5. 4
      discord/webhook/sync.py

4
discord/abc.py

@ -1546,10 +1546,12 @@ class Messageable:
If set, overrides the :attr:`~discord.AllowedMentions.replied_user` attribute of ``allowed_mentions``.
.. versionadded:: 1.6
view: :class:`discord.ui.View`
view: Union[:class:`discord.ui.View`, :class:`discord.ui.LayoutView`]
A Discord UI View to add to the message.
.. versionadded:: 2.0
.. versionchanged:: 2.6
This parameter now accepts :class:`discord.ui.LayoutView` instances.
stickers: Sequence[Union[:class:`~discord.GuildSticker`, :class:`~discord.StickerItem`]]
A list of stickers to upload. Must be a maximum of 3.

5
discord/channel.py

@ -2907,8 +2907,11 @@ class ForumChannel(discord.abc.GuildChannel, Hashable):
If set, overrides the :attr:`~discord.AllowedMentions.replied_user` attribute of ``allowed_mentions``.
applied_tags: List[:class:`discord.ForumTag`]
A list of tags to apply to the thread.
view: :class:`discord.ui.View`
view: Union[:class:`discord.ui.View`, :class:`discord.ui.LayoutView`]
A Discord UI View to add to the message.
.. versionchanged:: 2.6
This parameter now accepts :class:`discord.ui.LayoutView` instances.
stickers: Sequence[Union[:class:`~discord.GuildSticker`, :class:`~discord.StickerItem`]]
A list of stickers to upload. Must be a maximum of 3.
suppress_embeds: :class:`bool`

7
discord/client.py

@ -3159,8 +3159,11 @@ class Client:
Parameters
------------
view: :class:`discord.ui.View`
view: Union[:class:`discord.ui.View`, :class:`discord.ui.LayoutView`]
The view to register for dispatching.
.. versionchanged:: 2.6
This now accepts :class:`discord.ui.LayoutView` instances.
message_id: Optional[:class:`int`]
The message ID that the view is attached to. This is currently used to
refresh the view's state during message update events. If not given
@ -3188,7 +3191,7 @@ class Client:
@property
def persistent_views(self) -> Sequence[BaseView]:
"""Sequence[:class:`.View`]: A sequence of persistent views added to the client.
"""Sequence[Union[:class:`.View`, :class:`.LayoutView`]]: A sequence of persistent views added to the client.
.. versionadded:: 2.0
"""

4
discord/webhook/async_.py

@ -1734,12 +1734,14 @@ class Webhook(BaseWebhook):
Controls the mentions being processed in this message.
.. versionadded:: 1.4
view: :class:`discord.ui.View`
view: Union[:class:`discord.ui.View`, :class:`discord.ui.LayoutView`]
The view to send with the message. If the webhook is partial or
is not managed by the library, then you can only send URL buttons.
Otherwise, you can send views with any type of components.
.. versionadded:: 2.0
.. versionchanged:: 2.6
This now accepts :class:`discord.ui.LayoutView` instances.
thread: :class:`~discord.abc.Snowflake`
The thread to send this webhook to.

4
discord/webhook/sync.py

@ -996,13 +996,15 @@ class SyncWebhook(BaseWebhook):
When sending a Poll via webhook, you cannot manually end it.
.. versionadded:: 2.4
view: :class:`~discord.ui.View`
view: Union[:class:`~discord.ui.View`, :class:`~discord.ui.LayoutView`]
The view to send with the message. This can only have URL buttons, which donnot
require a state to be attached to it.
If you want to send a view with any component attached to it, check :meth:`Webhook.send`.
.. versionadded:: 2.5
.. versionchanged:: 2.6
This now accepts :class:`discord.ui.LayoutView` instances.
Raises
--------

Loading…
Cancel
Save