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`
The poll to send with this message.
.. versionadded:: 2.4
.. versionadded:: 2.1
Raises
--------

6
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')

2
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__ = (

4
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

4
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,

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`.
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

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.
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

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
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

12
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

6
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
----------

8
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
----------

8
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
--------

2
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)

2
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
-------

2
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
-------

2
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
--------

16
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

Loading…
Cancel
Save