From 426bb6a21f10b44996c3e24c9db71cca088a6db1 Mon Sep 17 00:00:00 2001 From: Lumabots <144063653+Lumabots@users.noreply.github.com> Date: Sat, 29 Mar 2025 14:08:37 +0200 Subject: [PATCH 01/17] Update guild.py Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com> --- discord/guild.py | 136 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 133 insertions(+), 3 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index 337abd31c0..901d584c6c 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1130,6 +1130,8 @@ async def create_text_channel( slowmode_delay: int = MISSING, nsfw: bool = MISSING, overwrites: dict[Role | Member, PermissionOverwrite] = MISSING, + default_thread_slowmode_delay: int | None = MISSING, + default_auto_archive_duration: int = MISSING, ) -> TextChannel: """|coro| @@ -1172,6 +1174,16 @@ async def create_text_channel( reason: Optional[:class:`str`] The reason for creating this channel. Shows up on the audit log. + default_thread_slowmode_delay: Optional[:class:`int`] + The initial slowmode delay to set on newly created threads in this channel. + + .. versionadded:: 2.7 + + default_auto_archive_duration: :class:`int` + The default auto archive duration in minutes for threads created in this channel. + + .. versionadded:: 2.7 + Returns ------- :class:`TextChannel` @@ -1219,6 +1231,12 @@ async def create_text_channel( if nsfw is not MISSING: options["nsfw"] = nsfw + + if default_thread_slowmode_delay is not MISSING: + options["default_thread_slowmode_delay"] = default_thread_slowmode_delay + + if default_auto_archive_duration is not MISSING: + options["default_auto_archive_duration"] = default_auto_archive_duration data = await self._create_channel( name, @@ -1246,6 +1264,8 @@ async def create_voice_channel( rtc_region: VoiceRegion | None = MISSING, video_quality_mode: VideoQualityMode = MISSING, overwrites: dict[Role | Member, PermissionOverwrite] = MISSING, + slowmode_delay: int = MISSING, + nsfw: bool = MISSING, ) -> VoiceChannel: """|coro| @@ -1280,6 +1300,17 @@ async def create_voice_channel( reason: Optional[:class:`str`] The reason for creating this channel. Shows up on the audit log. + slowmode_delay: :class:`int` + Specifies the slowmode rate limit for user in this channel, in seconds. + The maximum value possible is `21600`. + + .. versionadded:: 2.7 + + nsfw: :class:`bool` + To mark the channel as NSFW or not. + + .. versionadded:: 2.7 + Returns ------- :class:`VoiceChannel` @@ -1310,6 +1341,12 @@ async def create_voice_channel( if video_quality_mode is not MISSING: options["video_quality_mode"] = video_quality_mode.value + if slowmode_delay is not MISSING: + options["rate_limit_per_user"] = slowmode_delay + + if nsfw is not MISSING: + options["nsfw"] = nsfw + data = await self._create_channel( name, overwrites=overwrites, @@ -1333,6 +1370,12 @@ async def create_stage_channel( overwrites: dict[Role | Member, PermissionOverwrite] = MISSING, category: CategoryChannel | None = None, reason: str | None = None, + bitrate: int = MISSING, + user_limit: int = MISSING, + rtc_region: VoiceRegion | None = MISSING, + video_quality_mode: VideoQualityMode = MISSING, + slowmode_delay: int = MISSING, + nsfw: bool = MISSING, ) -> StageChannel: """|coro| @@ -1358,6 +1401,39 @@ async def create_stage_channel( reason: Optional[:class:`str`] The reason for creating this channel. Shows up on the audit log. + + bitrate: :class:`int` + The channel's preferred audio bitrate in bits per second. + + .. versionadded:: 2.7 + + user_limit: :class:`int` + The channel's limit for number of members that can be in a voice channel. + + .. versionadded:: 2.7 + + rtc_region: Optional[:class:`VoiceRegion`] + The region for the voice channel's voice communication. + A value of ``None`` indicates automatic voice region detection. + + .. versionadded:: 2.7 + + video_quality_mode: :class:`VideoQualityMode` + The camera video quality for the voice channel's participants. + + .. versionadded:: 2.7 + + slowmode_delay: :class:`int` + Specifies the slowmode rate limit for user in this channel, in seconds. + The maximum value possible is `21600`. + + .. versionadded:: 2.7 + + nsfw: :class:`bool` + To mark the channel as NSFW or not. + + .. versionadded:: 2.7 + Returns ------- :class:`StageChannel` @@ -1379,6 +1455,24 @@ async def create_stage_channel( if position is not MISSING: options["position"] = position + if bitrate is not MISSING: + options["bitrate"] = bitrate + + if user_limit is not MISSING: + options["user_limit"] = user_limit + + if rtc_region is not MISSING: + options["rtc_region"] = None if rtc_region is None else str(rtc_region) + + if video_quality_mode is not MISSING: + options["video_quality_mode"] = video_quality_mode.value + + if slowmode_delay is not MISSING: + options["rate_limit_per_user"] = slowmode_delay + + if nsfw is not MISSING: + options["nsfw"] = nsfw + data = await self._create_channel( name, overwrites=overwrites, @@ -1405,6 +1499,10 @@ async def create_forum_channel( nsfw: bool = MISSING, overwrites: dict[Role | Member, PermissionOverwrite] = MISSING, default_reaction_emoji: GuildEmoji | int | str = MISSING, + available_tags: list[ForumTag] = MISSING, + default_sort_order: SortOrder | None = MISSING, + default_thread_slowmode_delay: int | None = MISSING, + default_auto_archive_duration: int = MISSING, ) -> ForumChannel: """|coro| @@ -1453,6 +1551,26 @@ async def create_forum_channel( .. versionadded:: v2.5 + available_tags: List[:class:`ForumTag`] + The set of tags that can be used in a forum channel. + + .. versionadded:: 2.7 + + default_sort_order: Optional[:class:`SortOrder`] + The default sort order type used to order posts in this channel. + + .. versionadded:: 2.7 + + default_thread_slowmode_delay: Optional[:class:`int`] + The initial slowmode delay to set on newly created threads in this channel. + + .. versionadded:: 2.7 + + default_auto_archive_duration: :class:`int` + The default auto archive duration in minutes for threads created in this channel. + + .. versionadded:: 2.7 + Returns ------- :class:`ForumChannel` @@ -1491,15 +1609,27 @@ async def create_forum_channel( options = {} if position is not MISSING: options["position"] = position - + if topic is not MISSING: options["topic"] = topic - + if slowmode_delay is not MISSING: options["rate_limit_per_user"] = slowmode_delay - + if nsfw is not MISSING: options["nsfw"] = nsfw + + if available_tags is not MISSING: + options["available_tags"] = [tag.to_dict() for tag in available_tags] + + if default_sort_order is not MISSING: + options["default_sort_order"] = default_sort_order.value if default_sort_order else None + + if default_thread_slowmode_delay is not MISSING: + options["default_thread_slowmode_delay"] = default_thread_slowmode_delay + + if default_auto_archive_duration is not MISSING: + options["default_auto_archive_duration"] = default_auto_archive_duration if default_reaction_emoji is not MISSING: if isinstance( From 6e68b7abbc57c9106f3dfca6057bef56a1562f76 Mon Sep 17 00:00:00 2001 From: Lumabots <144063653+Lumabots@users.noreply.github.com> Date: Sat, 29 Mar 2025 14:25:50 +0200 Subject: [PATCH 02/17] Update channel.py add missings docs Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com> --- discord/channel.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/discord/channel.py b/discord/channel.py index 687baa5e5a..21649d6ff2 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1724,6 +1724,11 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel): Extra features of the channel. .. versionadded:: 2.0 + + nsfw: :class:`bool` + To mark the channel as NSFW or not. + + .. versionadded:: 2.7 """ def __init__( @@ -2042,6 +2047,7 @@ async def edit( rtc_region: VoiceRegion | None = ..., video_quality_mode: VideoQualityMode = ..., slowmode_delay: int = ..., + nsfw: int = ..., reason: str | None = ..., ) -> VoiceChannel | None: ... @@ -2092,6 +2098,17 @@ async def edit(self, *, reason=None, **options): .. versionadded:: 2.0 + slowmode_delay: :class:`int` + Specifies the slowmode rate limit for user in this channel, in seconds. + The maximum value possible is `21600`. + + .. versionadded:: 2.7 + + nsfw: :class:`bool` + To mark the channel as NSFW or not. + + .. versionadded:: 2.7 + Returns ------- Optional[:class:`.VoiceChannel`] @@ -2250,6 +2267,17 @@ class StageChannel(discord.abc.Messageable, VocalGuildChannel): last_message_id: Optional[:class:`int`] The ID of the last message sent to this channel. It may not always point to an existing or valid message. .. versionadded:: 2.5 + + slowmode_delay: :class:`int` + Specifies the slowmode rate limit for user in this channel, in seconds. + The maximum value possible is `21600`. + + .. versionadded:: 2.7 + + nsfw: :class:`bool` + To mark the channel as NSFW or not. + + .. versionadded:: 2.7 """ __slots__ = ("topic",) @@ -2734,6 +2762,32 @@ async def edit(self, *, reason=None, **options): .. versionadded:: 2.0 + bitrate: :class:`int` + The channel's preferred audio bitrate in bits per second. + + .. versionadded:: 2.7 + + user_limit: :class:`int` + The channel's limit for number of members that can be in a voice channel. + + .. versionadded:: 2.7 + + slowmode_delay: :class:`int` + Specifies the slowmode rate limit for user in this channel, in seconds. + The maximum value possible is `21600`. + + .. versionadded:: 2.7 + + nsfw: :class:`bool` + To mark the channel as NSFW or not. + + .. versionadded:: 2.7 + + Returns + ------- + :class:`StageChannel` + The channel that was just created. + Returns ------- Optional[:class:`.StageChannel`] From 46aa60899bbd3b5692cab94eabca4a7de0dcdc7d Mon Sep 17 00:00:00 2001 From: Lumabots <144063653+Lumabots@users.noreply.github.com> Date: Sat, 29 Mar 2025 14:27:42 +0200 Subject: [PATCH 03/17] Update guild.py Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com> --- discord/guild.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/discord/guild.py b/discord/guild.py index 901d584c6c..baac523531 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1672,6 +1672,7 @@ async def create_category( overwrites: dict[Role | Member, PermissionOverwrite] = MISSING, reason: str | None = None, position: int = MISSING, + nsfw: bool = MISSING, ) -> CategoryChannel: """|coro| @@ -1699,7 +1700,10 @@ async def create_category( options: dict[str, Any] = {} if position is not MISSING: options["position"] = position - + + if nsfw is not MISSING: + options["nsfw"] = nsfw + data = await self._create_channel( name, overwrites=overwrites, From 332e652b4ffdb825774c246582f5c82a1d96089c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 29 Mar 2025 12:30:32 +0000 Subject: [PATCH 04/17] style(pre-commit): auto fixes from pre-commit.com hooks --- discord/channel.py | 25 +++++++---------- discord/guild.py | 69 +++++++++++++++++++++++----------------------- 2 files changed, 45 insertions(+), 49 deletions(-) diff --git a/discord/channel.py b/discord/channel.py index 21649d6ff2..f80774eff5 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -2101,12 +2101,12 @@ async def edit(self, *, reason=None, **options): slowmode_delay: :class:`int` Specifies the slowmode rate limit for user in this channel, in seconds. The maximum value possible is `21600`. - + .. versionadded:: 2.7 - + nsfw: :class:`bool` To mark the channel as NSFW or not. - + .. versionadded:: 2.7 Returns @@ -2764,29 +2764,24 @@ async def edit(self, *, reason=None, **options): bitrate: :class:`int` The channel's preferred audio bitrate in bits per second. - + .. versionadded:: 2.7 - + user_limit: :class:`int` The channel's limit for number of members that can be in a voice channel. - + .. versionadded:: 2.7 - + slowmode_delay: :class:`int` Specifies the slowmode rate limit for user in this channel, in seconds. The maximum value possible is `21600`. - + .. versionadded:: 2.7 - + nsfw: :class:`bool` To mark the channel as NSFW or not. - - .. versionadded:: 2.7 - Returns - ------- - :class:`StageChannel` - The channel that was just created. + .. versionadded:: 2.7 Returns ------- diff --git a/discord/guild.py b/discord/guild.py index baac523531..e08556456e 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1176,7 +1176,7 @@ async def create_text_channel( default_thread_slowmode_delay: Optional[:class:`int`] The initial slowmode delay to set on newly created threads in this channel. - + .. versionadded:: 2.7 default_auto_archive_duration: :class:`int` @@ -1231,10 +1231,10 @@ async def create_text_channel( if nsfw is not MISSING: options["nsfw"] = nsfw - + if default_thread_slowmode_delay is not MISSING: options["default_thread_slowmode_delay"] = default_thread_slowmode_delay - + if default_auto_archive_duration is not MISSING: options["default_auto_archive_duration"] = default_auto_archive_duration @@ -1303,12 +1303,12 @@ async def create_voice_channel( slowmode_delay: :class:`int` Specifies the slowmode rate limit for user in this channel, in seconds. The maximum value possible is `21600`. - + .. versionadded:: 2.7 - + nsfw: :class:`bool` To mark the channel as NSFW or not. - + .. versionadded:: 2.7 Returns @@ -1346,7 +1346,7 @@ async def create_voice_channel( if nsfw is not MISSING: options["nsfw"] = nsfw - + data = await self._create_channel( name, overwrites=overwrites, @@ -1401,37 +1401,36 @@ async def create_stage_channel( reason: Optional[:class:`str`] The reason for creating this channel. Shows up on the audit log. - bitrate: :class:`int` The channel's preferred audio bitrate in bits per second. - + .. versionadded:: 2.7 - + user_limit: :class:`int` The channel's limit for number of members that can be in a voice channel. - + .. versionadded:: 2.7 - + rtc_region: Optional[:class:`VoiceRegion`] The region for the voice channel's voice communication. A value of ``None`` indicates automatic voice region detection. - + .. versionadded:: 2.7 - + video_quality_mode: :class:`VideoQualityMode` The camera video quality for the voice channel's participants. - + .. versionadded:: 2.7 - + slowmode_delay: :class:`int` Specifies the slowmode rate limit for user in this channel, in seconds. The maximum value possible is `21600`. - + .. versionadded:: 2.7 - + nsfw: :class:`bool` To mark the channel as NSFW or not. - + .. versionadded:: 2.7 Returns @@ -1553,24 +1552,24 @@ async def create_forum_channel( available_tags: List[:class:`ForumTag`] The set of tags that can be used in a forum channel. - + .. versionadded:: 2.7 - + default_sort_order: Optional[:class:`SortOrder`] The default sort order type used to order posts in this channel. - + .. versionadded:: 2.7 - + default_thread_slowmode_delay: Optional[:class:`int`] The initial slowmode delay to set on newly created threads in this channel. - + .. versionadded:: 2.7 default_auto_archive_duration: :class:`int` The default auto archive duration in minutes for threads created in this channel. .. versionadded:: 2.7 - + Returns ------- :class:`ForumChannel` @@ -1609,22 +1608,24 @@ async def create_forum_channel( options = {} if position is not MISSING: options["position"] = position - + if topic is not MISSING: options["topic"] = topic - + if slowmode_delay is not MISSING: options["rate_limit_per_user"] = slowmode_delay - + if nsfw is not MISSING: options["nsfw"] = nsfw - + if available_tags is not MISSING: options["available_tags"] = [tag.to_dict() for tag in available_tags] - + if default_sort_order is not MISSING: - options["default_sort_order"] = default_sort_order.value if default_sort_order else None - + options["default_sort_order"] = ( + default_sort_order.value if default_sort_order else None + ) + if default_thread_slowmode_delay is not MISSING: options["default_thread_slowmode_delay"] = default_thread_slowmode_delay @@ -1700,10 +1701,10 @@ async def create_category( options: dict[str, Any] = {} if position is not MISSING: options["position"] = position - + if nsfw is not MISSING: options["nsfw"] = nsfw - + data = await self._create_channel( name, overwrites=overwrites, From eff4e5284efc9dc68de8dc7dc89e0b8187e48735 Mon Sep 17 00:00:00 2001 From: Lumabots <144063653+Lumabots@users.noreply.github.com> Date: Sat, 29 Mar 2025 17:06:28 +0200 Subject: [PATCH 05/17] Update channel.py Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com> --- discord/channel.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discord/channel.py b/discord/channel.py index f80774eff5..54cb6741a3 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1038,7 +1038,9 @@ def _update(self, guild: Guild, data: ForumChannelPayload) -> None: self.default_sort_order: SortOrder | None = data.get("default_sort_order", None) if self.default_sort_order is not None: self.default_sort_order = try_enum(SortOrder, self.default_sort_order) - + + self.default_reaction_emoji = None + reaction_emoji_ctx: dict = data.get("default_reaction_emoji") if reaction_emoji_ctx is not None: emoji_name = reaction_emoji_ctx.get("emoji_name") From 477407fa225c3c15e78f327345a4a9f4ac07818a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 29 Mar 2025 15:06:53 +0000 Subject: [PATCH 06/17] style(pre-commit): auto fixes from pre-commit.com hooks --- discord/channel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/channel.py b/discord/channel.py index 54cb6741a3..d7545dcf12 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1038,9 +1038,9 @@ def _update(self, guild: Guild, data: ForumChannelPayload) -> None: self.default_sort_order: SortOrder | None = data.get("default_sort_order", None) if self.default_sort_order is not None: self.default_sort_order = try_enum(SortOrder, self.default_sort_order) - + self.default_reaction_emoji = None - + reaction_emoji_ctx: dict = data.get("default_reaction_emoji") if reaction_emoji_ctx is not None: emoji_name = reaction_emoji_ctx.get("emoji_name") From e717f67ae1591d0fa80661aa896bcb2a46d16ca6 Mon Sep 17 00:00:00 2001 From: Lumabots <144063653+Lumabots@users.noreply.github.com> Date: Sat, 29 Mar 2025 18:40:15 +0200 Subject: [PATCH 07/17] Update guild.py Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com> --- discord/guild.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discord/guild.py b/discord/guild.py index e08556456e..cdf68c08cf 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1643,9 +1643,11 @@ async def create_forum_channel( ) elif isinstance(default_reaction_emoji, str): default_reaction_emoji = PartialEmoji.from_str(default_reaction_emoji) + elif default_reaction_emoji is None: + pass else: raise InvalidArgument( - "default_reaction_emoji must be of type: GuildEmoji | int | str" + "default_reaction_emoji must be of type: GuildEmoji | int | str | None" ) options["default_reaction_emoji"] = ( From 13c603721553bd4926fd7aa601be7afd135db338 Mon Sep 17 00:00:00 2001 From: Lumabots <144063653+Lumabots@users.noreply.github.com> Date: Sat, 29 Mar 2025 19:06:29 +0200 Subject: [PATCH 08/17] Update guild.py Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com> --- discord/guild.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discord/guild.py b/discord/guild.py index cdf68c08cf..4f52a64787 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1651,7 +1651,8 @@ async def create_forum_channel( ) options["default_reaction_emoji"] = ( - default_reaction_emoji._to_forum_reaction_payload() + default_reaction_emoji._to_forum_reaction_payload() if default_reaction_emoji + else None ) data = await self._create_channel( From c4b7091fe8d2b5f825197614d7fb4ed331547bcf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 29 Mar 2025 17:06:54 +0000 Subject: [PATCH 09/17] style(pre-commit): auto fixes from pre-commit.com hooks --- discord/guild.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discord/guild.py b/discord/guild.py index 4f52a64787..7f31f3d6f8 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1651,7 +1651,8 @@ async def create_forum_channel( ) options["default_reaction_emoji"] = ( - default_reaction_emoji._to_forum_reaction_payload() if default_reaction_emoji + default_reaction_emoji._to_forum_reaction_payload() + if default_reaction_emoji else None ) From 1d7eb3f5c537793949e2f62ae650e98869fa9806 Mon Sep 17 00:00:00 2001 From: Lumabots <144063653+Lumabots@users.noreply.github.com> Date: Sat, 29 Mar 2025 21:46:14 +0200 Subject: [PATCH 10/17] Update CHANGELOG.md Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com> --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38725e4141..68b5fe2b43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -103,6 +103,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2739](https://github.com/Pycord-Development/pycord/pull/2739)) - Fixed missing `None` type hints in `Select.__init__`. ([#2746])(https://github.com/Pycord-Development/pycord/pull/2746) +- Fixed missing docstrings and parameters for channels, allow creating channels with None as default reaction + ([#2754])(https://github.com/Pycord-Development/pycord/pull/2754) ### Changed From dd0f397c9f80eeb49cddbbd516aae7b441df4c0a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 29 Mar 2025 19:46:39 +0000 Subject: [PATCH 11/17] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68b5fe2b43..ac196d11a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -103,7 +103,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2739](https://github.com/Pycord-Development/pycord/pull/2739)) - Fixed missing `None` type hints in `Select.__init__`. ([#2746])(https://github.com/Pycord-Development/pycord/pull/2746) -- Fixed missing docstrings and parameters for channels, allow creating channels with None as default reaction +- Fixed missing docstrings and parameters for channels, allow creating channels with + None as default reaction ([#2754])(https://github.com/Pycord-Development/pycord/pull/2754) ### Changed From 340cec36487e1f7f6f0c6aaefb015c5ea296b6bc Mon Sep 17 00:00:00 2001 From: Lumabots <144063653+Lumabots@users.noreply.github.com> Date: Mon, 7 Apr 2025 16:33:50 +0300 Subject: [PATCH 12/17] Update CHANGELOG.md Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com> --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac196d11a4..46041da286 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -103,8 +103,7 @@ These changes are available on the `master` branch, but have not yet been releas ([#2739](https://github.com/Pycord-Development/pycord/pull/2739)) - Fixed missing `None` type hints in `Select.__init__`. ([#2746])(https://github.com/Pycord-Development/pycord/pull/2746) -- Fixed missing docstrings and parameters for channels, allow creating channels with - None as default reaction +- Fixed parameters for channels And allow creating channels with None as default reaction ([#2754])(https://github.com/Pycord-Development/pycord/pull/2754) ### Changed From bc2fef94a3ec61274819be827fc73aea935ff965 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 13:34:15 +0000 Subject: [PATCH 13/17] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46041da286..2d159c43c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -103,8 +103,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2739](https://github.com/Pycord-Development/pycord/pull/2739)) - Fixed missing `None` type hints in `Select.__init__`. ([#2746])(https://github.com/Pycord-Development/pycord/pull/2746) -- Fixed parameters for channels And allow creating channels with None as default reaction - ([#2754])(https://github.com/Pycord-Development/pycord/pull/2754) +- Fixed parameters for channels And allow creating channels with None as default + reaction ([#2754])(https://github.com/Pycord-Development/pycord/pull/2754) ### Changed From d8b79ff014ed9bfc732acfdda32c6d35d0520540 Mon Sep 17 00:00:00 2001 From: Lumabots <144063653+Lumabots@users.noreply.github.com> Date: Thu, 10 Apr 2025 11:10:45 +0300 Subject: [PATCH 14/17] Update guild.py Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com> --- discord/guild.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index 7f31f3d6f8..2d2d210882 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1677,7 +1677,6 @@ async def create_category( overwrites: dict[Role | Member, PermissionOverwrite] = MISSING, reason: str | None = None, position: int = MISSING, - nsfw: bool = MISSING, ) -> CategoryChannel: """|coro| @@ -1706,9 +1705,6 @@ async def create_category( if position is not MISSING: options["position"] = position - if nsfw is not MISSING: - options["nsfw"] = nsfw - data = await self._create_channel( name, overwrites=overwrites, From 952aab8390c2ef87462f10f9ce4eb73617e3123e Mon Sep 17 00:00:00 2001 From: Lumabots <144063653+Lumabots@users.noreply.github.com> Date: Thu, 10 Apr 2025 11:13:54 +0300 Subject: [PATCH 15/17] Update channel.py removal of all the nsfw mention which should not exist for category Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com> --- discord/channel.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/discord/channel.py b/discord/channel.py index d7545dcf12..9961aec53e 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -2841,8 +2841,6 @@ class CategoryChannel(discord.abc.GuildChannel, Hashable): position: Optional[:class:`int`] The position in the category list. This is a number that starts at 0. e.g. the top category is position 0. Can be ``None`` if the channel was received in an interaction. - nsfw: :class:`bool` - If the channel is marked as "not safe for work". .. note:: @@ -2886,7 +2884,6 @@ def _update(self, guild: Guild, data: CategoryChannelPayload) -> None: # This data may be missing depending on how this object is being created/updated if not data.pop("_invoke_flag", False): - self.nsfw: bool = data.get("nsfw", False) self.position: int = data.get("position") self.flags: ChannelFlags = ChannelFlags._from_value(data.get("flags", 0)) self._fill_overwrites(data) @@ -2916,7 +2913,6 @@ async def edit( *, name: str = ..., position: int = ..., - nsfw: bool = ..., overwrites: Mapping[Role | Member, PermissionOverwrite] = ..., reason: str | None = ..., ) -> CategoryChannel | None: ... @@ -2944,8 +2940,6 @@ async def edit(self, *, reason=None, **options): The new category's name. position: :class:`int` The new category's position. - nsfw: :class:`bool` - To mark the category as NSFW or not. reason: Optional[:class:`str`] The reason for editing this category. Shows up on the audit log. overwrites: Dict[Union[:class:`Role`, :class:`Member`, :class:`~discord.abc.Snowflake`], :class:`PermissionOverwrite`] From 7dd8a7a98ba16b99ac83c485f0a48f35c76b8812 Mon Sep 17 00:00:00 2001 From: Lumabots <144063653+Lumabots@users.noreply.github.com> Date: Thu, 10 Apr 2025 11:15:05 +0300 Subject: [PATCH 16/17] Update channel.py Signed-off-by: Lumabots <144063653+Lumabots@users.noreply.github.com> --- discord/channel.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/discord/channel.py b/discord/channel.py index 9961aec53e..40b9ab45aa 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -2780,10 +2780,6 @@ async def edit(self, *, reason=None, **options): .. versionadded:: 2.7 - nsfw: :class:`bool` - To mark the channel as NSFW or not. - - .. versionadded:: 2.7 Returns ------- @@ -2844,7 +2840,6 @@ class CategoryChannel(discord.abc.GuildChannel, Hashable): .. note:: - To check if the channel or the guild of that channel are marked as NSFW, consider :meth:`is_nsfw` instead. flags: :class:`ChannelFlags` Extra features of the channel. @@ -2873,7 +2868,7 @@ def __init__( def __repr__(self) -> str: return ( "" + f" id={self.id} name={self.name!r} position={self.position}" ) def _update(self, guild: Guild, data: CategoryChannelPayload) -> None: @@ -2897,10 +2892,6 @@ def type(self) -> ChannelType: """The channel's Discord type.""" return ChannelType.category - def is_nsfw(self) -> bool: - """Checks if the category is NSFW.""" - return self.nsfw - @utils.copy_doc(discord.abc.GuildChannel.clone) async def clone( self, *, name: str | None = None, reason: str | None = None From 0035a73817ee53df1caa197dbe9de550024fd946 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 08:15:32 +0000 Subject: [PATCH 17/17] style(pre-commit): auto fixes from pre-commit.com hooks --- discord/channel.py | 1 - 1 file changed, 1 deletion(-) diff --git a/discord/channel.py b/discord/channel.py index 40b9ab45aa..b95b221582 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -2780,7 +2780,6 @@ async def edit(self, *, reason=None, **options): .. versionadded:: 2.7 - Returns ------- Optional[:class:`.StageChannel`]