Browse Source

Fix version directives

pull/10109/head
dolfies 5 months ago
parent
commit
00fed75092
  1. 2
      discord/abc.py
  2. 2
      discord/channel.py
  3. 2
      discord/colour.py
  4. 14
      discord/ext/commands/converter.py
  5. 4
      discord/ext/commands/parameters.py
  6. 2
      discord/flags.py
  7. 10
      discord/guild.py
  8. 18
      discord/message.py
  9. 4
      discord/permissions.py
  10. 2
      discord/voice_client.py
  11. 4
      docs/api.rst

2
discord/abc.py

@ -1279,7 +1279,7 @@ class GuildChannel:
.. versionadded:: 1.1 .. versionadded:: 1.1
.. versionchanged:: 2.5 .. versionchanged:: 2.1
The ``category`` keyword-only parameter was added. The ``category`` keyword-only parameter was added.

2
discord/channel.py

@ -4593,7 +4593,7 @@ class PartialMessageable(discord.abc.Messageable, Hashable):
def mention(self) -> str: def mention(self) -> str:
""":class:`str`: Returns a string that allows you to mention the channel. """:class:`str`: Returns a string that allows you to mention the channel.
.. versionadded:: 2.5 .. versionadded:: 2.1
""" """
return f'<#{self.id}>' return f'<#{self.id}>'

2
discord/colour.py

@ -518,7 +518,7 @@ class Colour:
.. colour:: #EB459F .. colour:: #EB459F
.. versionadded:: 2.3 .. versionadded:: 2.1
""" """
return cls(0xEB459F) return cls(0xEB459F)

14
discord/ext/commands/converter.py

@ -447,7 +447,7 @@ class GuildChannelConverter(IDConverter[discord.abc.GuildChannel]):
.. versionadded:: 2.0 .. versionadded:: 2.0
.. versionchanged:: 2.4 .. versionchanged:: 2.1
Add lookup by channel URL, accessed via "Copy Link" in the Discord client within channels. Add lookup by channel URL, accessed via "Copy Link" in the Discord client within channels.
""" """
@ -541,7 +541,7 @@ class TextChannelConverter(IDConverter[discord.TextChannel]):
.. versionchanged:: 1.5 .. versionchanged:: 1.5
Raise :exc:`.ChannelNotFound` instead of generic :exc:`.BadArgument` Raise :exc:`.ChannelNotFound` instead of generic :exc:`.BadArgument`
.. versionchanged:: 2.4 .. versionchanged:: 2.1
Add lookup by channel URL, accessed via "Copy Link" in the Discord client within channels. Add lookup by channel URL, accessed via "Copy Link" in the Discord client within channels.
""" """
@ -565,7 +565,7 @@ class VoiceChannelConverter(IDConverter[discord.VoiceChannel]):
.. versionchanged:: 1.5 .. versionchanged:: 1.5
Raise :exc:`.ChannelNotFound` instead of generic :exc:`.BadArgument` Raise :exc:`.ChannelNotFound` instead of generic :exc:`.BadArgument`
.. versionchanged:: 2.4 .. versionchanged:: 2.1
Add lookup by channel URL, accessed via "Copy Link" in the Discord client within channels. Add lookup by channel URL, accessed via "Copy Link" in the Discord client within channels.
""" """
@ -588,7 +588,7 @@ class StageChannelConverter(IDConverter[discord.StageChannel]):
3. Lookup by channel URL. 3. Lookup by channel URL.
4. Lookup by name 4. Lookup by name
.. versionchanged:: 2.4 .. versionchanged:: 2.1
Add lookup by channel URL, accessed via "Copy Link" in the Discord client within channels. Add lookup by channel URL, accessed via "Copy Link" in the Discord client within channels.
""" """
@ -609,7 +609,7 @@ class CategoryChannelConverter(IDConverter[discord.CategoryChannel]):
3. Lookup by channel URL. 3. Lookup by channel URL.
4. Lookup by name 4. Lookup by name
.. versionchanged:: 2.4 .. versionchanged:: 2.1
Add lookup by channel URL, accessed via "Copy Link" in the Discord client within channels. Add lookup by channel URL, accessed via "Copy Link" in the Discord client within channels.
.. versionchanged:: 1.5 .. versionchanged:: 1.5
@ -634,7 +634,7 @@ class ThreadConverter(IDConverter[discord.Thread]):
.. versionadded: 2.0 .. versionadded: 2.0
.. versionchanged:: 2.4 .. versionchanged:: 2.1
Add lookup by channel URL, accessed via "Copy Link" in the Discord client within channels. Add lookup by channel URL, accessed via "Copy Link" in the Discord client within channels.
""" """
@ -657,7 +657,7 @@ class ForumChannelConverter(IDConverter[discord.ForumChannel]):
.. versionadded:: 2.0 .. versionadded:: 2.0
.. versionchanged:: 2.4 .. versionchanged:: 2.1
Add lookup by channel URL, accessed via "Copy Link" in the Discord client within channels. Add lookup by channel URL, accessed via "Copy Link" in the Discord client within channels.
""" """

4
discord/ext/commands/parameters.py

@ -187,7 +187,7 @@ class Parameter(inspect.Parameter):
def displayed_name(self) -> Optional[str]: def displayed_name(self) -> Optional[str]:
"""Optional[:class:`str`]: The name that is displayed to the user. """Optional[:class:`str`]: The name that is displayed to the user.
.. versionadded:: 2.3 .. versionadded:: 2.1
""" """
return self._displayed_name if self._displayed_name is not empty else None return self._displayed_name if self._displayed_name is not empty else None
@ -245,7 +245,7 @@ def parameter(
displayed_name: :class:`str` displayed_name: :class:`str`
The name that is displayed to the user. The name that is displayed to the user.
.. versionadded:: 2.3 .. versionadded:: 2.1
""" """
if isinstance(default, Parameter): if isinstance(default, Parameter):
if displayed_default is empty: if displayed_default is empty:

2
discord/flags.py

@ -678,7 +678,7 @@ class MessageFlags(BaseFlags):
def forwarded(self): def forwarded(self):
""":class:`bool`: Returns ``True`` if the message is a forwarded message. """:class:`bool`: Returns ``True`` if the message is a forwarded message.
.. versionadded:: 2.5 .. versionadded:: 2.1
""" """
return 16384 return 16384

10
discord/guild.py

@ -3983,7 +3983,7 @@ class Guild(Hashable):
Retrieves a :class:`Role` with the specified ID. Retrieves a :class:`Role` with the specified ID.
.. versionadded:: 2.5 .. versionadded:: 2.1
.. note:: .. note::
@ -5578,7 +5578,7 @@ class Guild(Hashable):
def dm_spam_detected_at(self) -> Optional[datetime.datetime]: def dm_spam_detected_at(self) -> Optional[datetime.datetime]:
""":class:`datetime.datetime`: Returns the time when DM spam was detected in the guild. """:class:`datetime.datetime`: Returns the time when DM spam was detected in the guild.
.. versionadded:: 2.5 .. versionadded:: 2.1
""" """
if not self._incidents_data: if not self._incidents_data:
return None return None
@ -5589,7 +5589,7 @@ class Guild(Hashable):
def raid_detected_at(self) -> Optional[datetime.datetime]: def raid_detected_at(self) -> Optional[datetime.datetime]:
"""Optional[:class:`datetime.datetime`]: Returns the time when a raid was detected in the guild. """Optional[:class:`datetime.datetime`]: Returns the time when a raid was detected in the guild.
.. versionadded:: 2.5 .. versionadded:: 2.1
""" """
if not self._incidents_data: if not self._incidents_data:
return None return None
@ -5619,7 +5619,7 @@ class Guild(Hashable):
def is_dm_spam_detected(self) -> bool: def is_dm_spam_detected(self) -> bool:
""":class:`bool`: Whether DM spam was detected in the guild. """:class:`bool`: Whether DM spam was detected in the guild.
.. versionadded:: 2.5 .. versionadded:: 2.1
""" """
if not self.dm_spam_detected_at: if not self.dm_spam_detected_at:
return False return False
@ -5629,7 +5629,7 @@ class Guild(Hashable):
def is_raid_detected(self) -> bool: def is_raid_detected(self) -> bool:
""":class:`bool`: Whether a raid was detected in the guild. """:class:`bool`: Whether a raid was detected in the guild.
.. versionadded:: 2.5 .. versionadded:: 2.1
""" """
if not self.raid_detected_at: if not self.raid_detected_at:
return False return False

18
discord/message.py

@ -475,7 +475,7 @@ class DeletedReferencedMessage:
class MessageSnapshot: class MessageSnapshot:
"""Represents a message snapshot attached to a forwarded message. """Represents a message snapshot attached to a forwarded message.
.. versionadded:: 2.5 .. versionadded:: 2.1
Attributes Attributes
----------- -----------
@ -612,7 +612,7 @@ class MessageReference:
type: :class:`MessageReferenceType` type: :class:`MessageReferenceType`
The type of message reference. The type of message reference.
.. versionadded:: 2.5 .. versionadded:: 2.1
message_id: Optional[:class:`int`] message_id: Optional[:class:`int`]
The id of the message referenced. The id of the message referenced.
channel_id: :class:`int` channel_id: :class:`int`
@ -690,7 +690,7 @@ class MessageReference:
type: :class:`~discord.MessageReferenceType` type: :class:`~discord.MessageReferenceType`
The type of message reference this is. The type of message reference this is.
.. versionadded:: 2.5 .. versionadded:: 2.1
Returns Returns
------- -------
@ -789,7 +789,7 @@ class RoleSubscriptionInfo:
class GuildProductPurchase: class GuildProductPurchase:
"""Represents a message's guild product that the user has purchased. """Represents a message's guild product that the user has purchased.
.. versionadded:: 2.5 .. versionadded:: 2.1
Attributes Attributes
----------- -----------
@ -820,7 +820,7 @@ class PurchaseNotification:
This is currently only attached to messages of type :attr:`MessageType.purchase_notification`. This is currently only attached to messages of type :attr:`MessageType.purchase_notification`.
.. versionadded:: 2.5 .. versionadded:: 2.1
Attributes Attributes
----------- -----------
@ -1659,7 +1659,7 @@ class PartialMessage(Hashable):
type: :class:`MessageReferenceType` type: :class:`MessageReferenceType`
The type of message reference. The type of message reference.
.. versionadded:: 2.5 .. versionadded:: 2.1
Returns Returns
--------- ---------
@ -1679,7 +1679,7 @@ class PartialMessage(Hashable):
Forwards this message to a channel. Forwards this message to a channel.
.. versionadded:: 2.5 .. versionadded:: 2.1
Parameters Parameters
---------- ----------
@ -1862,11 +1862,11 @@ class Message(PartialMessage, Hashable):
purchase_notification: Optional[:class:`PurchaseNotification`] purchase_notification: Optional[:class:`PurchaseNotification`]
The data of the purchase notification that prompted this :attr:`MessageType.purchase_notification` message. The data of the purchase notification that prompted this :attr:`MessageType.purchase_notification` message.
.. versionadded:: 2.5 .. versionadded:: 2.1
message_snapshots: List[:class:`MessageSnapshot`] message_snapshots: List[:class:`MessageSnapshot`]
The message snapshots attached to this message. The message snapshots attached to this message.
.. versionadded:: 2.5 .. versionadded:: 2.1
hit: :class:`bool` hit: :class:`bool`
Whether the message was a hit in a search result. As surrounding messages Whether the message was a hit in a search result. As surrounding messages
are no longer returned in search results, this is always ``True`` for search results. are no longer returned in search results, this is always ``True`` for search results.

4
discord/permissions.py

@ -259,7 +259,7 @@ class Permissions(BaseFlags):
.. versionchanged:: 2.1 .. versionchanged:: 2.1
Added :attr:`create_expressions` permission. Added :attr:`create_expressions` permission.
.. versionchanged:: 2.4 .. versionchanged:: 2.1
Added :attr:`view_creator_monetization_analytics` permission. Added :attr:`view_creator_monetization_analytics` permission.
""" """
return cls(0b0000_0000_0000_0000_0000_1010_0000_0000_0111_0000_0000_1000_0000_0100_1011_0000) return cls(0b0000_0000_0000_0000_0000_1010_0000_0000_0111_0000_0000_1000_0000_0100_1011_0000)
@ -292,7 +292,7 @@ class Permissions(BaseFlags):
.. versionchanged:: 2.1 .. versionchanged:: 2.1
Added :attr:`send_voice_messages` permission. Added :attr:`send_voice_messages` permission.
.. versionchanged:: 2.4 .. versionchanged:: 2.1
Added :attr:`send_polls` and :attr:`use_external_apps` permissions. Added :attr:`send_polls` and :attr:`use_external_apps` permissions.
""" """
return cls(0b0000_0000_0000_0110_0100_0000_0111_1100_1000_0000_0000_0111_1111_1000_0100_0000) return cls(0b0000_0000_0000_0110_0100_0000_0111_1100_1000_0000_0000_0111_1111_1000_0100_0000)

2
discord/voice_client.py

@ -439,7 +439,7 @@ class VoiceClient(VoiceProtocol):
.. versionchanged:: 2.0 .. versionchanged:: 2.0
Instead of writing to ``sys.stderr``, the library's logger is used. Instead of writing to ``sys.stderr``, the library's logger is used.
.. versionchanged:: 2.4 .. versionchanged:: 2.1
Added encoder parameters as keyword arguments. Added encoder parameters as keyword arguments.
Parameters Parameters

4
docs/api.rst

@ -2021,7 +2021,7 @@ of :class:`enum.Enum`.
The system message sent when a purchase is made in the guild. The system message sent when a purchase is made in the guild.
.. versionadded:: 2.5 .. versionadded:: 2.1
.. class:: UserFlags .. class:: UserFlags
@ -6093,7 +6093,7 @@ of :class:`enum.Enum`.
Represents the type of a message reference. Represents the type of a message reference.
.. versionadded:: 2.5 .. versionadded:: 2.1
.. attribute:: reply .. attribute:: reply

Loading…
Cancel
Save