From f96854c90d1e8b225e0e8199a4b6c0025a5fd622 Mon Sep 17 00:00:00 2001 From: dolfies Date: Wed, 4 Dec 2024 02:24:32 -0500 Subject: [PATCH] Fix version directives --- discord/abc.py | 2 +- discord/activity.py | 6 +++--- discord/automod.py | 2 +- discord/channel.py | 4 ++-- discord/ext/commands/flags.py | 4 ++-- discord/flags.py | 4 ++-- discord/guild.py | 14 +++++++------- discord/message.py | 8 ++++---- discord/permissions.py | 12 ++++++------ discord/poll.py | 6 +++--- discord/raw_models.py | 8 ++++---- discord/reaction.py | 8 ++++---- discord/role.py | 2 +- discord/threads.py | 2 +- discord/voice_client.py | 2 +- discord/webhook/async_.py | 2 +- docs/api.rst | 16 ++++++++-------- 17 files changed, 51 insertions(+), 51 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index 400709a16..02ad626fc 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -1833,7 +1833,7 @@ class Messageable: poll: :class:`~discord.Poll` The poll to send with this message. - .. versionadded:: 2.4 + .. versionadded:: 2.1 Raises -------- diff --git a/discord/activity.py b/discord/activity.py index c0a089aa3..9c898c944 100644 --- a/discord/activity.py +++ b/discord/activity.py @@ -168,7 +168,7 @@ class Activity(BaseActivity): platform: Optional[:class:`str`] The user's current platform. - .. versionadded:: 2.4 + .. versionadded:: 2.1 timestamps: :class:`dict` A dictionary of timestamps. It contains the following optional keys: @@ -382,7 +382,7 @@ class Game(BaseActivity): platform: Optional[:class:`str`] Where the user is playing from (ie. PS5, Xbox). - .. versionadded:: 2.4 + .. versionadded:: 2.1 assets: :class:`dict` 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_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') diff --git a/discord/automod.py b/discord/automod.py index e4a7b751c..a1c83eb06 100644 --- a/discord/automod.py +++ b/discord/automod.py @@ -241,7 +241,7 @@ class AutoModTrigger: mention_raid_protection: :class:`bool` Whether mention raid protection is enabled or not. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ __slots__ = ( diff --git a/discord/channel.py b/discord/channel.py index 182e7fa08..48661718d 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1599,7 +1599,7 @@ class VoiceChannel(VocalGuildChannel): The new voice channel status. It can be up to 500 characters. Can be ``None`` to remove the status. - .. versionadded:: 2.4 + .. versionadded:: 2.1 Raises ------ @@ -2652,7 +2652,7 @@ class ForumChannel(discord.abc.GuildChannel, Hashable): def is_media(self) -> bool: """:class:`bool`: Checks if the channel is a media channel. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ return self._type == ChannelType.media.value diff --git a/discord/ext/commands/flags.py b/discord/ext/commands/flags.py index 2085daa96..cacdf5d1c 100644 --- a/discord/ext/commands/flags.py +++ b/discord/ext/commands/flags.py @@ -81,7 +81,7 @@ class Flag: positional: :class:`bool` Whether the flag is positional or not. There can only be one positional flag. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ name: str = MISSING @@ -143,7 +143,7 @@ def flag( positional: :class:`bool` Whether the flag is positional or not. There can only be one positional flag. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ return Flag( name=name, diff --git a/discord/flags.py b/discord/flags.py index 4260d4489..b6707432d 100644 --- a/discord/flags.py +++ b/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`. Only available in media channels. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ return 1 << 15 @@ -2750,7 +2750,7 @@ class AttachmentFlags(BaseFlags): class RoleFlags(BaseFlags): r"""Wraps up the Discord Role flags - .. versionadded:: 2.4 + .. versionadded:: 2.1 .. container:: operations diff --git a/discord/guild.py b/discord/guild.py index 4e2599c53..5fd3521d5 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -2310,13 +2310,13 @@ class Guild(Hashable): 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`. - .. versionadded:: 2.4 + .. versionadded:: 2.1 dms_disabled_until: Optional[:class:`datetime.datetime`] 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`. - .. versionadded:: 2.4 + .. versionadded:: 2.1 Raises ------- @@ -4383,7 +4383,7 @@ class Guild(Hashable): You must have :attr:`~Permissions.ban_members` and :attr:`~Permissions.manage_guild` to do this. - .. versionadded:: 2.4 + .. versionadded:: 2.1 Parameters ----------- @@ -5555,7 +5555,7 @@ class Guild(Hashable): """Optional[:class:`datetime.datetime`]: If invites are paused, returns when invites will get enabled in UTC, otherwise returns None. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ if not self._incidents_data: return None @@ -5567,7 +5567,7 @@ class Guild(Hashable): """Optional[:class:`datetime.datetime`]: If DMs are paused, returns when DMs will get enabled in UTC, otherwise returns None. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ if not self._incidents_data: return None @@ -5599,7 +5599,7 @@ class Guild(Hashable): def invites_paused(self) -> bool: """:class:`bool`: Whether invites are paused in the guild. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ if not self.invites_paused_until: return 'INVITES_DISABLED' in self.features @@ -5609,7 +5609,7 @@ class Guild(Hashable): def dms_paused(self) -> bool: """:class:`bool`: Whether DMs are paused in the guild. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ if not self.dms_paused_until: return False diff --git a/discord/message.py b/discord/message.py index 31b55f13b..309a2ca89 100644 --- a/discord/message.py +++ b/discord/message.py @@ -950,7 +950,7 @@ class PartialMessage(Hashable): This does not retrieve archived threads, as they are not retained in the internal cache. Use :meth:`fetch_thread` instead. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ if self.guild is not None: 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. - .. versionadded:: 2.4 + .. versionadded:: 2.1 Raises ------- @@ -1858,7 +1858,7 @@ class Message(PartialMessage, Hashable): poll: Optional[:class:`Poll`] The poll attached to this message. - .. versionadded:: 2.4 + .. versionadded:: 2.1 purchase_notification: Optional[:class:`PurchaseNotification`] 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 are not retained in the internal cache. Use :meth:`fetch_thread` instead. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ if self.guild is not None: # Fall back to guild threads in case one was created after the message diff --git a/discord/permissions.py b/discord/permissions.py index 36a7e2bd3..533f7aed3 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -354,7 +354,7 @@ class Permissions(BaseFlags): """A factory method that creates a :class:`Permissions` with all "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) @@ -702,7 +702,7 @@ class Permissions(BaseFlags): def view_creator_monetization_analytics(self) -> int: """:class:`bool`: Returns ``True`` if a user can view role subscription insights. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ return 1 << 41 @@ -726,7 +726,7 @@ class Permissions(BaseFlags): def create_events(self) -> int: """:class:`bool`: Returns ``True`` if a user can create guild events. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ return 1 << 44 @@ -750,7 +750,7 @@ class Permissions(BaseFlags): def send_polls(self) -> int: """:class:`bool`: Returns ``True`` if a user can send poll messages. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ return 1 << 49 @@ -758,7 +758,7 @@ class Permissions(BaseFlags): def create_polls(self) -> int: """:class:`bool`: An alias for :attr:`send_polls`. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ return 1 << 49 @@ -766,7 +766,7 @@ class Permissions(BaseFlags): def use_external_apps(self) -> int: """:class:`bool`: Returns ``True`` if a user can use external apps. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ return 1 << 50 diff --git a/discord/poll.py b/discord/poll.py index 7dc3897ac..15cb52b4a 100644 --- a/discord/poll.py +++ b/discord/poll.py @@ -68,7 +68,7 @@ PollMediaEmoji = Union[PartialEmoji, Emoji, str] class PollMedia: """Represents the poll media for a poll item. - .. versionadded:: 2.4 + .. versionadded:: 2.1 Attributes ---------- @@ -113,7 +113,7 @@ class PollAnswer: Returns this answer's text, if any. - .. versionadded:: 2.4 + .. versionadded:: 2.1 Attributes ---------- @@ -300,7 +300,7 @@ class PollAnswer: class Poll: """Represents a message's Poll. - .. versionadded:: 2.4 + .. versionadded:: 2.1 Parameters ---------- diff --git a/discord/raw_models.py b/discord/raw_models.py index a873f439f..96d64fd28 100644 --- a/discord/raw_models.py +++ b/discord/raw_models.py @@ -210,7 +210,7 @@ class RawReactionActionEvent(_RawReprMixin): burst: :class:`bool` Whether the reaction was a burst reaction, also known as a "super reaction". - .. versionadded:: 2.4 + .. versionadded:: 2.1 burst_colours: List[:class:`Colour`] A list of colours used for burst reaction animation. Only available if ``burst`` is ``True`` and if ``event_type`` is ``REACTION_ADD``. @@ -219,7 +219,7 @@ class RawReactionActionEvent(_RawReprMixin): type: :class:`ReactionType` The type of the reaction. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ __slots__ = ( @@ -257,7 +257,7 @@ class RawReactionActionEvent(_RawReprMixin): def burst_colors(self) -> List[Colour]: """An alias of :attr:`burst_colours`. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ 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` event. - .. versionadded:: 2.4 + .. versionadded:: 2.1 Attributes ---------- diff --git a/discord/reaction.py b/discord/reaction.py index d2e19e1a5..796e5c731 100644 --- a/discord/reaction.py +++ b/discord/reaction.py @@ -83,19 +83,19 @@ class Reaction: me_burst: :class:`bool` If the user sent this super reaction. - .. versionadded:: 2.4 + .. versionadded:: 2.1 normal_count: :class:`int` 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` or :func:`on_reaction_remove`. - .. versionadded:: 2.4 + .. versionadded:: 2.1 burst_count: :class:`int` 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` or :func:`on_reaction_remove`. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ __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. Defaults to :attr:`ReactionType.normal`. - .. versionadded:: 2.4 + .. versionadded:: 2.1 Raises -------- diff --git a/discord/role.py b/discord/role.py index 3058c34f3..229e0cf94 100644 --- a/discord/role.py +++ b/discord/role.py @@ -388,7 +388,7 @@ class Role(Hashable): def flags(self) -> RoleFlags: """:class:`RoleFlags`: Returns the role's flags. - .. versionadded:: 2.4 + .. versionadded:: 2.1 """ return RoleFlags._from_value(self._flags) diff --git a/discord/threads.py b/discord/threads.py index 8c5fb9f75..c723e2db5 100644 --- a/discord/threads.py +++ b/discord/threads.py @@ -908,7 +908,7 @@ class Thread(Messageable, Hashable): The reason for deleting this thread. Shows up on the audit log. - .. versionadded:: 2.4 + .. versionadded:: 2.1 Raises ------- diff --git a/discord/voice_client.py b/discord/voice_client.py index 793732825..70c3f6e78 100644 --- a/discord/voice_client.py +++ b/discord/voice_client.py @@ -353,7 +353,7 @@ class VoiceClient(VoiceProtocol): timeout: Optional[:class:`float`] How long to wait for the move to complete. - .. versionadded:: 2.4 + .. versionadded:: 2.1 Raises ------- diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index ee4c08444..23c2416eb 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -1502,7 +1502,7 @@ class Webhook(BaseWebhook): When sending a Poll via webhook, you cannot manually end it. - .. versionadded:: 2.4 + .. versionadded:: 2.1 Raises -------- diff --git a/docs/api.rst b/docs/api.rst index f8b8fbf4f..92fe8e1db 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1791,7 +1791,7 @@ of :class:`enum.Enum`. A media channel. - .. versionadded:: 2.4 + .. versionadded:: 2.1 .. class:: MessageType @@ -1997,25 +1997,25 @@ of :class:`enum.Enum`. The system message sent when security actions is enabled. - .. versionadded:: 2.4 + .. versionadded:: 2.1 .. attribute:: guild_incident_alert_mode_disabled The system message sent when security actions is disabled. - .. versionadded:: 2.4 + .. versionadded:: 2.1 .. attribute:: guild_incident_report_raid The system message sent when a raid is reported. - .. versionadded:: 2.4 + .. versionadded:: 2.1 .. attribute:: guild_incident_report_false_alarm The system message sent when a false alarm is reported. - .. versionadded:: 2.4 + .. versionadded:: 2.1 .. attribute:: purchase_notification @@ -5891,7 +5891,7 @@ of :class:`enum.Enum`. The rule will trigger when a user's profile contains a keyword. - .. versionadded:: 2.4 + .. versionadded:: 2.1 .. class:: AutoModRuleEventType @@ -5907,7 +5907,7 @@ of :class:`enum.Enum`. The rule will trigger when a member's profile is updated. - .. versionadded:: 2.4 + .. versionadded:: 2.1 .. class:: AutoModRuleActionType @@ -5932,7 +5932,7 @@ of :class:`enum.Enum`. Similar to :attr:`timeout`, except the user will be timed out indefinitely. This will request the user to edit it's profile. - .. versionadded:: 2.4 + .. versionadded:: 2.1 .. class:: ForumLayoutType