Browse Source

Fix version directives

pull/10109/head
dolfies 6 months ago
parent
commit
f96854c90d
  1. 2
      discord/abc.py
  2. 6
      discord/activity.py
  3. 2
      discord/automod.py
  4. 4
      discord/channel.py
  5. 4
      discord/ext/commands/flags.py
  6. 4
      discord/flags.py
  7. 14
      discord/guild.py
  8. 8
      discord/message.py
  9. 12
      discord/permissions.py
  10. 6
      discord/poll.py
  11. 8
      discord/raw_models.py
  12. 8
      discord/reaction.py
  13. 2
      discord/role.py
  14. 2
      discord/threads.py
  15. 2
      discord/voice_client.py
  16. 2
      discord/webhook/async_.py
  17. 16
      docs/api.rst

2
discord/abc.py

@ -1833,7 +1833,7 @@ class Messageable:
poll: :class:`~discord.Poll` poll: :class:`~discord.Poll`
The poll to send with this message. The poll to send with this message.
.. versionadded:: 2.4 .. versionadded:: 2.1
Raises Raises
-------- --------

6
discord/activity.py

@ -168,7 +168,7 @@ class Activity(BaseActivity):
platform: Optional[:class:`str`] platform: Optional[:class:`str`]
The user's current platform. The user's current platform.
.. versionadded:: 2.4 .. versionadded:: 2.1
timestamps: :class:`dict` timestamps: :class:`dict`
A dictionary of timestamps. It contains the following optional keys: A dictionary of timestamps. It contains the following optional keys:
@ -382,7 +382,7 @@ class Game(BaseActivity):
platform: Optional[:class:`str`] platform: Optional[:class:`str`]
Where the user is playing from (ie. PS5, Xbox). Where the user is playing from (ie. PS5, Xbox).
.. versionadded:: 2.4 .. versionadded:: 2.1
assets: :class:`dict` assets: :class:`dict`
A dictionary representing the images and their hover text of a game. A dictionary representing the images and their hover text of a game.
@ -393,7 +393,7 @@ class Game(BaseActivity):
- ``small_image``: A string representing the ID for the small image asset. - ``small_image``: A string representing the ID for the small image asset.
- ``small_text``: A string representing the text when hovering over the small image asset. - ``small_text``: A string representing the text when hovering over the small image asset.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
__slots__ = ('name', '_end', '_start', 'platform', 'assets') __slots__ = ('name', '_end', '_start', 'platform', 'assets')

2
discord/automod.py

@ -241,7 +241,7 @@ class AutoModTrigger:
mention_raid_protection: :class:`bool` mention_raid_protection: :class:`bool`
Whether mention raid protection is enabled or not. Whether mention raid protection is enabled or not.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
__slots__ = ( __slots__ = (

4
discord/channel.py

@ -1599,7 +1599,7 @@ class VoiceChannel(VocalGuildChannel):
The new voice channel status. It can be up to 500 characters. The new voice channel status. It can be up to 500 characters.
Can be ``None`` to remove the status. Can be ``None`` to remove the status.
.. versionadded:: 2.4 .. versionadded:: 2.1
Raises Raises
------ ------
@ -2652,7 +2652,7 @@ class ForumChannel(discord.abc.GuildChannel, Hashable):
def is_media(self) -> bool: def is_media(self) -> bool:
""":class:`bool`: Checks if the channel is a media channel. """:class:`bool`: Checks if the channel is a media channel.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
return self._type == ChannelType.media.value return self._type == ChannelType.media.value

4
discord/ext/commands/flags.py

@ -81,7 +81,7 @@ class Flag:
positional: :class:`bool` positional: :class:`bool`
Whether the flag is positional or not. There can only be one positional flag. Whether the flag is positional or not. There can only be one positional flag.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
name: str = MISSING name: str = MISSING
@ -143,7 +143,7 @@ def flag(
positional: :class:`bool` positional: :class:`bool`
Whether the flag is positional or not. There can only be one positional flag. Whether the flag is positional or not. There can only be one positional flag.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
return Flag( return Flag(
name=name, name=name,

4
discord/flags.py

@ -1458,7 +1458,7 @@ class ChannelFlags(BaseFlags):
""":class:`bool`: Returns ``True`` if the client hides embedded media download options in a :class:`ForumChannel`. """:class:`bool`: Returns ``True`` if the client hides embedded media download options in a :class:`ForumChannel`.
Only available in media channels. Only available in media channels.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
return 1 << 15 return 1 << 15
@ -2750,7 +2750,7 @@ class AttachmentFlags(BaseFlags):
class RoleFlags(BaseFlags): class RoleFlags(BaseFlags):
r"""Wraps up the Discord Role flags r"""Wraps up the Discord Role flags
.. versionadded:: 2.4 .. versionadded:: 2.1
.. container:: operations .. container:: operations

14
discord/guild.py

@ -2310,13 +2310,13 @@ class Guild(Hashable):
The time when invites should be enabled again, or ``None`` to disable the action. The time when invites should be enabled again, or ``None`` to disable the action.
This must be a timezone-aware datetime object. Consider using :func:`utils.utcnow`. This must be a timezone-aware datetime object. Consider using :func:`utils.utcnow`.
.. versionadded:: 2.4 .. versionadded:: 2.1
dms_disabled_until: Optional[:class:`datetime.datetime`] dms_disabled_until: Optional[:class:`datetime.datetime`]
The time when direct messages should be allowed again, or ``None`` to disable the action. The time when direct messages should be allowed again, or ``None`` to disable the action.
This must be a timezone-aware datetime object. Consider using :func:`utils.utcnow`. This must be a timezone-aware datetime object. Consider using :func:`utils.utcnow`.
.. versionadded:: 2.4 .. versionadded:: 2.1
Raises Raises
------- -------
@ -4383,7 +4383,7 @@ class Guild(Hashable):
You must have :attr:`~Permissions.ban_members` and :attr:`~Permissions.manage_guild` to do this. You must have :attr:`~Permissions.ban_members` and :attr:`~Permissions.manage_guild` to do this.
.. versionadded:: 2.4 .. versionadded:: 2.1
Parameters Parameters
----------- -----------
@ -5555,7 +5555,7 @@ class Guild(Hashable):
"""Optional[:class:`datetime.datetime`]: If invites are paused, returns when """Optional[:class:`datetime.datetime`]: If invites are paused, returns when
invites will get enabled in UTC, otherwise returns None. invites will get enabled in UTC, otherwise returns None.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
if not self._incidents_data: if not self._incidents_data:
return None return None
@ -5567,7 +5567,7 @@ class Guild(Hashable):
"""Optional[:class:`datetime.datetime`]: If DMs are paused, returns when DMs """Optional[:class:`datetime.datetime`]: If DMs are paused, returns when DMs
will get enabled in UTC, otherwise returns None. will get enabled in UTC, otherwise returns None.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
if not self._incidents_data: if not self._incidents_data:
return None return None
@ -5599,7 +5599,7 @@ class Guild(Hashable):
def invites_paused(self) -> bool: def invites_paused(self) -> bool:
""":class:`bool`: Whether invites are paused in the guild. """:class:`bool`: Whether invites are paused in the guild.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
if not self.invites_paused_until: if not self.invites_paused_until:
return 'INVITES_DISABLED' in self.features return 'INVITES_DISABLED' in self.features
@ -5609,7 +5609,7 @@ class Guild(Hashable):
def dms_paused(self) -> bool: def dms_paused(self) -> bool:
""":class:`bool`: Whether DMs are paused in the guild. """:class:`bool`: Whether DMs are paused in the guild.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
if not self.dms_paused_until: if not self.dms_paused_until:
return False return False

8
discord/message.py

@ -950,7 +950,7 @@ class PartialMessage(Hashable):
This does not retrieve archived threads, as they are not retained in the internal This does not retrieve archived threads, as they are not retained in the internal
cache. Use :meth:`fetch_thread` instead. cache. Use :meth:`fetch_thread` instead.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
if self.guild is not None: if self.guild is not None:
return self.guild.get_thread(self.id) return self.guild.get_thread(self.id)
@ -1452,7 +1452,7 @@ class PartialMessage(Hashable):
This method is an API call. For general usage, consider :attr:`thread` instead. This method is an API call. For general usage, consider :attr:`thread` instead.
.. versionadded:: 2.4 .. versionadded:: 2.1
Raises Raises
------- -------
@ -1858,7 +1858,7 @@ class Message(PartialMessage, Hashable):
poll: Optional[:class:`Poll`] poll: Optional[:class:`Poll`]
The poll attached to this message. The poll attached to this message.
.. versionadded:: 2.4 .. versionadded:: 2.1
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.
@ -2393,7 +2393,7 @@ class Message(PartialMessage, Hashable):
For messages received via the gateway this does not retrieve archived threads, as they For messages received via the gateway this does not retrieve archived threads, as they
are not retained in the internal cache. Use :meth:`fetch_thread` instead. are not retained in the internal cache. Use :meth:`fetch_thread` instead.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
if self.guild is not None: if self.guild is not None:
# Fall back to guild threads in case one was created after the message # Fall back to guild threads in case one was created after the message

12
discord/permissions.py

@ -354,7 +354,7 @@ class Permissions(BaseFlags):
"""A factory method that creates a :class:`Permissions` with all """A factory method that creates a :class:`Permissions` with all
"Events" permissions from the official Discord UI set to ``True``. "Events" permissions from the official Discord UI set to ``True``.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
return cls(0b0000_0000_0000_0000_0001_0000_0000_0010_0000_0000_0000_0000_0000_0000_0000_0000) return cls(0b0000_0000_0000_0000_0001_0000_0000_0010_0000_0000_0000_0000_0000_0000_0000_0000)
@ -702,7 +702,7 @@ class Permissions(BaseFlags):
def view_creator_monetization_analytics(self) -> int: def view_creator_monetization_analytics(self) -> int:
""":class:`bool`: Returns ``True`` if a user can view role subscription insights. """:class:`bool`: Returns ``True`` if a user can view role subscription insights.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
return 1 << 41 return 1 << 41
@ -726,7 +726,7 @@ class Permissions(BaseFlags):
def create_events(self) -> int: def create_events(self) -> int:
""":class:`bool`: Returns ``True`` if a user can create guild events. """:class:`bool`: Returns ``True`` if a user can create guild events.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
return 1 << 44 return 1 << 44
@ -750,7 +750,7 @@ class Permissions(BaseFlags):
def send_polls(self) -> int: def send_polls(self) -> int:
""":class:`bool`: Returns ``True`` if a user can send poll messages. """:class:`bool`: Returns ``True`` if a user can send poll messages.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
return 1 << 49 return 1 << 49
@ -758,7 +758,7 @@ class Permissions(BaseFlags):
def create_polls(self) -> int: def create_polls(self) -> int:
""":class:`bool`: An alias for :attr:`send_polls`. """:class:`bool`: An alias for :attr:`send_polls`.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
return 1 << 49 return 1 << 49
@ -766,7 +766,7 @@ class Permissions(BaseFlags):
def use_external_apps(self) -> int: def use_external_apps(self) -> int:
""":class:`bool`: Returns ``True`` if a user can use external apps. """:class:`bool`: Returns ``True`` if a user can use external apps.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
return 1 << 50 return 1 << 50

6
discord/poll.py

@ -68,7 +68,7 @@ PollMediaEmoji = Union[PartialEmoji, Emoji, str]
class PollMedia: class PollMedia:
"""Represents the poll media for a poll item. """Represents the poll media for a poll item.
.. versionadded:: 2.4 .. versionadded:: 2.1
Attributes Attributes
---------- ----------
@ -113,7 +113,7 @@ class PollAnswer:
Returns this answer's text, if any. Returns this answer's text, if any.
.. versionadded:: 2.4 .. versionadded:: 2.1
Attributes Attributes
---------- ----------
@ -300,7 +300,7 @@ class PollAnswer:
class Poll: class Poll:
"""Represents a message's Poll. """Represents a message's Poll.
.. versionadded:: 2.4 .. versionadded:: 2.1
Parameters Parameters
---------- ----------

8
discord/raw_models.py

@ -210,7 +210,7 @@ class RawReactionActionEvent(_RawReprMixin):
burst: :class:`bool` burst: :class:`bool`
Whether the reaction was a burst reaction, also known as a "super reaction". Whether the reaction was a burst reaction, also known as a "super reaction".
.. versionadded:: 2.4 .. versionadded:: 2.1
burst_colours: List[:class:`Colour`] burst_colours: List[:class:`Colour`]
A list of colours used for burst reaction animation. Only available if ``burst`` is ``True`` A list of colours used for burst reaction animation. Only available if ``burst`` is ``True``
and if ``event_type`` is ``REACTION_ADD``. and if ``event_type`` is ``REACTION_ADD``.
@ -219,7 +219,7 @@ class RawReactionActionEvent(_RawReprMixin):
type: :class:`ReactionType` type: :class:`ReactionType`
The type of the reaction. The type of the reaction.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
__slots__ = ( __slots__ = (
@ -257,7 +257,7 @@ class RawReactionActionEvent(_RawReprMixin):
def burst_colors(self) -> List[Colour]: def burst_colors(self) -> List[Colour]:
"""An alias of :attr:`burst_colours`. """An alias of :attr:`burst_colours`.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
return self.burst_colours return self.burst_colours
@ -514,7 +514,7 @@ class RawPollVoteActionEvent(_RawReprMixin):
"""Represents the payload for a :func:`on_raw_poll_vote_add` or :func:`on_raw_poll_vote_remove` """Represents the payload for a :func:`on_raw_poll_vote_add` or :func:`on_raw_poll_vote_remove`
event. event.
.. versionadded:: 2.4 .. versionadded:: 2.1
Attributes Attributes
---------- ----------

8
discord/reaction.py

@ -83,19 +83,19 @@ class Reaction:
me_burst: :class:`bool` me_burst: :class:`bool`
If the user sent this super reaction. If the user sent this super reaction.
.. versionadded:: 2.4 .. versionadded:: 2.1
normal_count: :class:`int` normal_count: :class:`int`
The number of times this reaction was made using normal reactions. The number of times this reaction was made using normal reactions.
This is not available in the gateway events such as :func:`on_reaction_add` This is not available in the gateway events such as :func:`on_reaction_add`
or :func:`on_reaction_remove`. or :func:`on_reaction_remove`.
.. versionadded:: 2.4 .. versionadded:: 2.1
burst_count: :class:`int` burst_count: :class:`int`
The number of times this reaction was made using super reactions. The number of times this reaction was made using super reactions.
This is not available in the gateway events such as :func:`on_reaction_add` This is not available in the gateway events such as :func:`on_reaction_add`
or :func:`on_reaction_remove`. or :func:`on_reaction_remove`.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
__slots__ = ('message', 'count', 'emoji', 'me', 'me_burst', 'normal_count', 'burst_count') __slots__ = ('message', 'count', 'emoji', 'me', 'me_burst', 'normal_count', 'burst_count')
@ -226,7 +226,7 @@ class Reaction:
The type of reaction to return users from. The type of reaction to return users from.
Defaults to :attr:`ReactionType.normal`. Defaults to :attr:`ReactionType.normal`.
.. versionadded:: 2.4 .. versionadded:: 2.1
Raises Raises
-------- --------

2
discord/role.py

@ -388,7 +388,7 @@ class Role(Hashable):
def flags(self) -> RoleFlags: def flags(self) -> RoleFlags:
""":class:`RoleFlags`: Returns the role's flags. """:class:`RoleFlags`: Returns the role's flags.
.. versionadded:: 2.4 .. versionadded:: 2.1
""" """
return RoleFlags._from_value(self._flags) return RoleFlags._from_value(self._flags)

2
discord/threads.py

@ -908,7 +908,7 @@ class Thread(Messageable, Hashable):
The reason for deleting this thread. The reason for deleting this thread.
Shows up on the audit log. Shows up on the audit log.
.. versionadded:: 2.4 .. versionadded:: 2.1
Raises Raises
------- -------

2
discord/voice_client.py

@ -353,7 +353,7 @@ class VoiceClient(VoiceProtocol):
timeout: Optional[:class:`float`] timeout: Optional[:class:`float`]
How long to wait for the move to complete. How long to wait for the move to complete.
.. versionadded:: 2.4 .. versionadded:: 2.1
Raises Raises
------- -------

2
discord/webhook/async_.py

@ -1502,7 +1502,7 @@ class Webhook(BaseWebhook):
When sending a Poll via webhook, you cannot manually end it. When sending a Poll via webhook, you cannot manually end it.
.. versionadded:: 2.4 .. versionadded:: 2.1
Raises Raises
-------- --------

16
docs/api.rst

@ -1791,7 +1791,7 @@ of :class:`enum.Enum`.
A media channel. A media channel.
.. versionadded:: 2.4 .. versionadded:: 2.1
.. class:: MessageType .. class:: MessageType
@ -1997,25 +1997,25 @@ of :class:`enum.Enum`.
The system message sent when security actions is enabled. The system message sent when security actions is enabled.
.. versionadded:: 2.4 .. versionadded:: 2.1
.. attribute:: guild_incident_alert_mode_disabled .. attribute:: guild_incident_alert_mode_disabled
The system message sent when security actions is disabled. The system message sent when security actions is disabled.
.. versionadded:: 2.4 .. versionadded:: 2.1
.. attribute:: guild_incident_report_raid .. attribute:: guild_incident_report_raid
The system message sent when a raid is reported. The system message sent when a raid is reported.
.. versionadded:: 2.4 .. versionadded:: 2.1
.. attribute:: guild_incident_report_false_alarm .. attribute:: guild_incident_report_false_alarm
The system message sent when a false alarm is reported. The system message sent when a false alarm is reported.
.. versionadded:: 2.4 .. versionadded:: 2.1
.. attribute:: purchase_notification .. attribute:: purchase_notification
@ -5891,7 +5891,7 @@ of :class:`enum.Enum`.
The rule will trigger when a user's profile contains a keyword. The rule will trigger when a user's profile contains a keyword.
.. versionadded:: 2.4 .. versionadded:: 2.1
.. class:: AutoModRuleEventType .. class:: AutoModRuleEventType
@ -5907,7 +5907,7 @@ of :class:`enum.Enum`.
The rule will trigger when a member's profile is updated. The rule will trigger when a member's profile is updated.
.. versionadded:: 2.4 .. versionadded:: 2.1
.. class:: AutoModRuleActionType .. class:: AutoModRuleActionType
@ -5932,7 +5932,7 @@ of :class:`enum.Enum`.
Similar to :attr:`timeout`, except the user will be timed out indefinitely. Similar to :attr:`timeout`, except the user will be timed out indefinitely.
This will request the user to edit it's profile. This will request the user to edit it's profile.
.. versionadded:: 2.4 .. versionadded:: 2.1
.. class:: ForumLayoutType .. class:: ForumLayoutType

Loading…
Cancel
Save