aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshuAgarwal <[email protected]>2021-08-18 04:45:02 +0000
committerGitHub <[email protected]>2021-08-18 00:45:02 -0400
commit6b6bcb92e610b4e3a2b3178c1f48fa7871b281e4 (patch)
tree874e96c1c4115235de70970d8b998c510e29fc38
parentAdd other message types exclusions to Message.is_system (diff)
downloaddiscord.py-6b6bcb92e610b4e3a2b3178c1f48fa7871b281e4.tar.xz
discord.py-6b6bcb92e610b4e3a2b3178c1f48fa7871b281e4.zip
Fix missing or broken versionadded in docstrings
This also documents BadFlagArgument.flag
-rw-r--r--discord/channel.py2
-rw-r--r--discord/client.py15
-rw-r--r--discord/ext/commands/errors.py8
-rw-r--r--discord/message.py2
-rw-r--r--docs/api.rst2
5 files changed, 26 insertions, 3 deletions
diff --git a/discord/channel.py b/discord/channel.py
index c859103a..ffb11ffc 100644
--- a/discord/channel.py
+++ b/discord/channel.py
@@ -785,6 +785,8 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
This includes both private and public threads.
+ .. versionadded:: 2.0
+
Raises
------
HTTPException
diff --git a/discord/client.py b/discord/client.py
index cdfc6bdb..569d17c0 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -328,6 +328,8 @@ class Client:
If this is not passed via ``__init__`` then this is retrieved
through the gateway when an event contains the data. Usually
after :func:`~discord.on_connect` is called.
+
+ .. versionadded:: 2.0
"""
return self._connection.application_id
@@ -335,7 +337,7 @@ class Client:
def application_flags(self) -> ApplicationFlags:
""":class:`~discord.ApplicationFlags`: The client's application flags.
- .. versionadded: 2.0
+ .. versionadded:: 2.0
"""
return self._connection.application_flags # type: ignore
@@ -734,6 +736,8 @@ class Client:
This is useful if you have a channel_id but don't want to do an API call
to send messages to it.
+
+ .. versionadded:: 2.0
Parameters
-----------
@@ -744,7 +748,7 @@ class Client:
Returns
--------
- :class:`PartialMessageable`
+ :class:`.PartialMessageable`
The partial messageable
"""
return PartialMessageable(state=self._connection, id=id, type=type)
@@ -1575,6 +1579,8 @@ class Client:
This method should be used for when a view is comprised of components
that last longer than the lifecycle of the program.
+
+ .. versionadded:: 2.0
Parameters
------------
@@ -1604,5 +1610,8 @@ class Client:
@property
def persistent_views(self) -> Sequence[View]:
- """Sequence[:class:`.View`]: A sequence of persistent views added to the client."""
+ """Sequence[:class:`.View`]: A sequence of persistent views added to the client.
+
+ .. versionadded:: 2.0
+ """
return self._connection.persistent_views
diff --git a/discord/ext/commands/errors.py b/discord/ext/commands/errors.py
index 9c9c7bab..55bc9a12 100644
--- a/discord/ext/commands/errors.py
+++ b/discord/ext/commands/errors.py
@@ -931,6 +931,14 @@ class TooManyFlags(FlagError):
class BadFlagArgument(FlagError):
"""An exception raised when a flag failed to convert a value.
+ This inherits from :exc:`FlagError`
+
+ .. versionadded:: 2.0
+
+ Attributes
+ -----------
+ flag: :class:`~discord.ext.commands.Flag`
+ The flag that failed to convert.
"""
def __init__(self, flag):
self.flag = flag
diff --git a/discord/message.py b/discord/message.py
index 22d3b160..2f499b60 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -1485,6 +1485,8 @@ class Message(Hashable):
:attr:`~discord.Permissions.use_threads` in order to create a thread.
The channel this message belongs in must be a :class:`TextChannel`.
+
+ .. versionadded:: 2.0
Parameters
-----------
diff --git a/docs/api.rst b/docs/api.rst
index 82978e7c..1ce97377 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -739,6 +739,8 @@ to handle it, which defaults to print a traceback and ignoring the exception.
This requires :attr:`Intents.members` to be enabled.
+ .. versionadded:: 2.0
+
:param member: The member who joined or left.
:type member: :class:`ThreadMember`