From 6b274da51c2a5edb2a062d1792a26b23b5877b03 Mon Sep 17 00:00:00 2001 From: Paillat Date: Fri, 15 Nov 2024 23:39:44 +0100 Subject: [PATCH] :memo: Requested changes --- discord/abc.py | 4 +--- discord/channel.py | 23 ++++------------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index a8217a53fb..842038a4e3 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -416,9 +416,7 @@ async def _edit( ) except KeyError: pass - if options.get("flags") and not isinstance( - options["flags"], int - ): # it shouldn't be an int but just in case + if options.get("flags"): options["flags"] = options["flags"].value try: options["available_tags"] = [ diff --git a/discord/channel.py b/discord/channel.py index 57c5cbb777..fb2a818961 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1377,6 +1377,8 @@ class MediaChannel(ForumChannel): Returns the channel's name. + .. versionadded:: 2.7 + Attributes ---------- name: :class:`str` @@ -1413,35 +1415,25 @@ class MediaChannel(ForumChannel): default_auto_archive_duration: :class:`int` The default auto archive duration in minutes for threads created in this channel. - .. versionadded:: 2.0 flags: :class:`ChannelFlags` Extra features of the channel. - .. versionadded:: 2.0 available_tags: List[:class:`ForumTag`] The set of tags that can be used in a forum channel. - .. versionadded:: 2.3 default_sort_order: Optional[:class:`SortOrder`] The default sort order type used to order posts in this channel. - .. versionadded:: 2.3 default_thread_slowmode_delay: Optional[:class:`int`] The initial slowmode delay to set on newly created threads in this channel. - .. versionadded:: 2.3 default_reaction_emoji: Optional[:class:`str` | :class:`discord.GuildEmoji`] The default forum reaction emoji. - - .. versionadded:: 2.5 """ @property - def hides_media_download_options(self): - """Whether media download options are be hidden in this media channel. - - .. versionadded:: 2.7 - """ + def hides_media_download_options(self) -> bool: + """Whether media download options are be hidden in this media channel.""" return self.flags.hide_media_download_options @overload @@ -1503,30 +1495,23 @@ async def edit(self, *, reason=None, **options): default_thread_slowmode_delay: :class:`int` The new default slowmode delay in seconds for threads created in this channel. - .. versionadded:: 2.3 default_sort_order: Optional[:class:`SortOrder`] The default sort order type to use to order posts in this channel. - .. versionadded:: 2.3 default_reaction_emoji: Optional[:class:`discord.GuildEmoji` | :class:`int` | :class:`str`] The default reaction emoji. Can be a unicode emoji or a custom emoji in the forms: :class:`GuildEmoji`, snowflake ID, string representation (eg. ''). - .. versionadded:: 2.5 available_tags: List[:class:`ForumTag`] The set of tags that can be used in this channel. Must be less than `20`. - .. versionadded:: 2.3 require_tag: :class:`bool` Whether a tag should be required to be specified when creating a thread in this channel. - .. versionadded:: 2.3 hide_media_download_options: :class:`bool` Whether media download options should be hidden in this media channel. - .. versionadded:: 2.7 - Returns ------- Optional[:class:`.MediaChannel`]