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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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/34] 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`] From 757ef9cc509df44b92565b4f9bef547c3304a3ca Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Thu, 1 May 2025 19:45:00 +0300 Subject: [PATCH 18/34] fix typo Co-authored-by: plun1331 Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> --- discord/channel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/channel.py b/discord/channel.py index b95b221582..371274f2ea 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -2049,7 +2049,7 @@ async def edit( rtc_region: VoiceRegion | None = ..., video_quality_mode: VideoQualityMode = ..., slowmode_delay: int = ..., - nsfw: int = ..., + nsfw: bool = ..., reason: str | None = ..., ) -> VoiceChannel | None: ... From cab128e2df04ba4195b908528ff877ce3ba4e828 Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Thu, 1 May 2025 19:45:33 +0300 Subject: [PATCH 19/34] Update discord/channel.py Co-authored-by: plun1331 Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> --- discord/channel.py | 1 - 1 file changed, 1 deletion(-) diff --git a/discord/channel.py b/discord/channel.py index 371274f2ea..bf16b5b75c 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -2104,7 +2104,6 @@ async def edit(self, *, reason=None, **options): 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. From 19a83f39b2fdce6e3eae47e4b75ddf5fdc1ff0e0 Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Thu, 1 May 2025 19:45:40 +0300 Subject: [PATCH 20/34] Update discord/channel.py Co-authored-by: plun1331 Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> --- discord/channel.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/discord/channel.py b/discord/channel.py index bf16b5b75c..588b6354a7 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -2273,8 +2273,6 @@ class StageChannel(discord.abc.Messageable, VocalGuildChannel): 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. From 913cf877fe5827c13bba039f4f1e5779944327cc Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Thu, 1 May 2025 19:45:53 +0300 Subject: [PATCH 21/34] Update discord/channel.py Co-authored-by: plun1331 Signed-off-by: Lumouille <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 588b6354a7..4b9dec509f 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -2764,19 +2764,13 @@ 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 - Returns ------- Optional[:class:`.StageChannel`] From 121ae58b169d8cef925d2f565e775146da1984a0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 16:45:58 +0000 Subject: [PATCH 22/34] 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 4b9dec509f..440856e8ae 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -2104,7 +2104,6 @@ async def edit(self, *, reason=None, **options): Specifies the slowmode rate limit for user in this channel, in seconds. The maximum value possible is `21600`. - nsfw: :class:`bool` To mark the channel as NSFW or not. From 966b528be86068a247a134e33e734cc07dbd3a2f Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Fri, 9 May 2025 22:06:22 +0300 Subject: [PATCH 23/34] feat(channel): deprecate is_nsfw method in CategoryChannel --- discord/channel.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/discord/channel.py b/discord/channel.py index 440856e8ae..f6a665d072 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -3067,6 +3067,12 @@ async def create_forum_channel(self, name: str, **options: Any) -> ForumChannel: """ return await self.guild.create_forum_channel(name, category=self, **options) + @utils.deprecated(since=2.7, removed=3.0) + def is_nsfw(self) -> bool: + return False + + # TODO: Remove in 3.0 + DMC = TypeVar("DMC", bound="DMChannel") From 691a27c9d304d7a5970921b5d996fbc4024a640f Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Fri, 9 May 2025 22:09:37 +0300 Subject: [PATCH 24/34] fix(channel): correct deprecated decorator arguments in CategoryChannel --- discord/channel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/channel.py b/discord/channel.py index f6a665d072..8fd5b16a54 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -3067,7 +3067,7 @@ async def create_forum_channel(self, name: str, **options: Any) -> ForumChannel: """ return await self.guild.create_forum_channel(name, category=self, **options) - @utils.deprecated(since=2.7, removed=3.0) + @utils.deprecated(since="2.7", removed="3.0") def is_nsfw(self) -> bool: return False From ca6a4bf71544ae177a0738b089868783f04e1b2d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 19:36:32 +0000 Subject: [PATCH 25/34] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb6868b297..4a383537f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -106,8 +106,7 @@ These changes are available on the `master` branch, but have not yet been releas - 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) + reaction ([#2754])(https://github.com/Pycord-Development/pycord/pull/2754) - Updated `valid_locales` to support `in` and `es-419`. ([#2767](https://github.com/Pycord-Development/pycord/pull/2767)) - Fixed `Webhook.edit` not working with `attachments=[]`. From c391c30b4013cccbd7075a63e298040142acfaeb Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Wed, 18 Jun 2025 09:51:16 +0300 Subject: [PATCH 26/34] fix: improve clarity of NSFW parameter documentation and slowmode for continiuty --- discord/channel.py | 19 +++++++++---------- discord/guild.py | 16 ++++++++-------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/discord/channel.py b/discord/channel.py index 9cfb22bf12..ce68b6f129 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -812,7 +812,7 @@ async def edit(self, *, reason=None, **options): position: :class:`int` The new channel's position. nsfw: :class:`bool` - To mark the channel as NSFW or not. + Whether the channel is marked as NSFW. sync_permissions: :class:`bool` Whether to sync permissions with the channel's new or pre-existing category. Defaults to ``False``. @@ -1115,7 +1115,7 @@ async def edit(self, *, reason=None, **options): position: :class:`int` The new channel's position. nsfw: :class:`bool` - To mark the channel as NSFW or not. + Whether the channel is marked as NSFW. sync_permissions: :class:`bool` Whether to sync permissions with the channel's new or pre-existing category. Defaults to ``False``. @@ -1478,7 +1478,7 @@ async def edit(self, *, reason=None, **options): position: :class:`int` The new channel's position. nsfw: :class:`bool` - To mark the channel as NSFW or not. + Whether the channel is marked as NSFW. sync_permissions: :class:`bool` Whether to sync permissions with the channel's new or pre-existing category. Defaults to ``False``. @@ -1728,7 +1728,7 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel): .. versionadded:: 2.0 nsfw: :class:`bool` - To mark the channel as NSFW or not. + Whether the channel is marked as NSFW. .. versionadded:: 2.7 """ @@ -2102,10 +2102,10 @@ 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`. + A value of `0` disables slowmode. The maximum value possible is `21600`. nsfw: :class:`bool` - To mark the channel as NSFW or not. + Whether the channel is marked as NSFW. .. versionadded:: 2.7 @@ -2273,7 +2273,7 @@ class StageChannel(discord.abc.Messageable, VocalGuildChannel): The maximum value possible is `21600`. nsfw: :class:`bool` - To mark the channel as NSFW or not. + Whether the channel is marked as NSFW. .. versionadded:: 2.7 """ @@ -2768,7 +2768,7 @@ 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`. + A value of `0` disables slowmode. The maximum value possible is `21600`. Returns ------- @@ -2856,8 +2856,7 @@ def __init__( def __repr__(self) -> str: return ( - " None: diff --git a/discord/guild.py b/discord/guild.py index ef633acd74..4bf8a1d054 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1168,9 +1168,9 @@ async def create_text_channel( The new channel's topic. slowmode_delay: :class:`int` Specifies the slowmode rate limit for user in this channel, in seconds. - The maximum value possible is `21600`. + A value of `0` disables slowmode. The maximum value possible is `21600`. nsfw: :class:`bool` - To mark the channel as NSFW or not. + Whether the channel is marked as NSFW. reason: Optional[:class:`str`] The reason for creating this channel. Shows up on the audit log. @@ -1302,12 +1302,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`. + A value of `0` disables slowmode. The maximum value possible is `21600`. .. versionadded:: 2.7 nsfw: :class:`bool` - To mark the channel as NSFW or not. + Whether the channel is marked as NSFW. .. versionadded:: 2.7 @@ -1424,12 +1424,12 @@ async def create_stage_channel( slowmode_delay: :class:`int` Specifies the slowmode rate limit for user in this channel, in seconds. - The maximum value possible is `21600`. + A value of `0` disables slowmode. The maximum value possible is `21600`. .. versionadded:: 2.7 nsfw: :class:`bool` - To mark the channel as NSFW or not. + Whether the channel is marked as NSFW. .. versionadded:: 2.7 @@ -1538,9 +1538,9 @@ async def create_forum_channel( The new channel's topic. slowmode_delay: :class:`int` Specifies the slowmode rate limit for user in this channel, in seconds. - The maximum value possible is `21600`. + A value of `0` disables slowmode. The maximum value possible is `21600`. nsfw: :class:`bool` - To mark the channel as NSFW or not. + Whether the channel is marked as NSFW. reason: Optional[:class:`str`] The reason for creating this channel. Shows up on the audit log. default_reaction_emoji: Optional[:class:`GuildEmoji` | :class:`int` | :class:`str`] From d401df9100d2b3823dbe406f02f9514deef9b779 Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Wed, 18 Jun 2025 13:40:49 +0300 Subject: [PATCH 27/34] fix: improve clarity of NSFW parameter documentation --- discord/channel.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discord/channel.py b/discord/channel.py index ce68b6f129..240add1c72 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -2864,6 +2864,7 @@ def _update(self, guild: Guild, data: CategoryChannelPayload) -> None: self.guild: Guild = guild self.name: str = data["name"] self.category_id: int | None = utils._get_as_snowflake(data, "parent_id") + self.nsfw = False # This data may be missing depending on how this object is being created/updated if not data.pop("_invoke_flag", False): @@ -2884,7 +2885,7 @@ def type(self) -> ChannelType: async def clone( self, *, name: str | None = None, reason: str | None = None ) -> CategoryChannel: - return await self._clone_impl({"nsfw": self.nsfw}, name=name, reason=reason) + return await self._clone_impl({}, name=name, reason=reason) @overload async def edit( From 62879fb4f16fbfad7deb00017bb625e0c4c668c0 Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Thu, 19 Jun 2025 12:30:07 +0300 Subject: [PATCH 28/34] fix: add missing parameters to channel creation methods and deprecate unsupported nsfw for categories --- CHANGELOG.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecfdafbf9a..a7741b5083 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -108,8 +108,15 @@ These changes are available on the `master` branch, but have not yet been releas - 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) - ([#2746](https://github.com/Pycord-Development/pycord/pull/2746)) +- Added missing parameters to `create_text_channel`: `default_thread_slowmode_delay` and + `default_auto_archive_duration`. +- Added missing parameters to `create_voice_channel`: `slowmode_delay` and `nsfw`. +- Added missing parameters to `create_stage_channel`: `bitrate`, `user_limit`, + `rtc_region`, `video_quality_mode`, `slowmode_delay`, and `nsfw`. +- Added missing parameters to `create_forum_channel`: `available_tags`, + `default_sort_order`, `default_thread_slowmode_delay`, and + `default_auto_archive_duration`. Also allow `default_reaction_emoji` to be `None`. + ([#2772])(https://github.com/Pycord-Development/pycord/pull/2772) - Fixed `TypeError` when using `Flag` with Python 3.11+. ([#2759](https://github.com/Pycord-Development/pycord/pull/2759)) - Fixed `TypeError` when specifying `thread_name` in `Webhook.send`. @@ -150,6 +157,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2501](https://github.com/Pycord-Development/pycord/pull/2501)) - Deprecated `Interaction.cached_channel` in favor of `Interaction.channel`. ([#2658](https://github.com/Pycord-Development/pycord/pull/2658)) +- Deprecated `nsfw` for categories, as it was never supported. + ([#2772])(https://github.com/Pycord-Development/pycord/pull/2772) ### Removed From 469a4e255622547438e7e691a67fe195d05dc741 Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Fri, 20 Jun 2025 09:02:33 +0300 Subject: [PATCH 29/34] Update CHANGELOG.md Co-authored-by: JustaSqu1d <89910983+JustaSqu1d@users.noreply.github.com> Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7741b5083..78062d37c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -157,7 +157,7 @@ These changes are available on the `master` branch, but have not yet been releas ([#2501](https://github.com/Pycord-Development/pycord/pull/2501)) - Deprecated `Interaction.cached_channel` in favor of `Interaction.channel`. ([#2658](https://github.com/Pycord-Development/pycord/pull/2658)) -- Deprecated `nsfw` for categories, as it was never supported. +- Deprecated `is_nsfw` for categories since it was never supported by the API. ([#2772])(https://github.com/Pycord-Development/pycord/pull/2772) ### Removed From f0878b0d4c3ea6310777d7f2f416ce7bdf662400 Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Fri, 20 Jun 2025 09:07:14 +0300 Subject: [PATCH 30/34] fix: add missing parameters for channel creation and allow default_reaction_emoji to be None --- CHANGELOG.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78062d37c5..7b53e919be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2714](https://github.com/Pycord-Development/pycord/pull/2714)) - Added the ability to pass a `datetime.time` object to `format_dt`. ([#2747](https://github.com/Pycord-Development/pycord/pull/2747)) +- Added various missing channel parameters and allow `default_reaction_emoji` to be + `None`. ([#2772])(https://github.com/Pycord-Development/pycord/pull/2772) - Added `discord.Interaction.created_at`. ([#2801](https://github.com/Pycord-Development/pycord/pull/2801)) @@ -107,16 +109,6 @@ 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 -- Added missing parameters to `create_text_channel`: `default_thread_slowmode_delay` and - `default_auto_archive_duration`. -- Added missing parameters to `create_voice_channel`: `slowmode_delay` and `nsfw`. -- Added missing parameters to `create_stage_channel`: `bitrate`, `user_limit`, - `rtc_region`, `video_quality_mode`, `slowmode_delay`, and `nsfw`. -- Added missing parameters to `create_forum_channel`: `available_tags`, - `default_sort_order`, `default_thread_slowmode_delay`, and - `default_auto_archive_duration`. Also allow `default_reaction_emoji` to be `None`. - ([#2772])(https://github.com/Pycord-Development/pycord/pull/2772) - Fixed `TypeError` when using `Flag` with Python 3.11+. ([#2759](https://github.com/Pycord-Development/pycord/pull/2759)) - Fixed `TypeError` when specifying `thread_name` in `Webhook.send`. From 4b7ca075ca7f8c5fe0dfda8bc7c3f6577f307c59 Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Fri, 20 Jun 2025 19:09:03 +0300 Subject: [PATCH 31/34] Update CHANGELOG.md Co-authored-by: JustaSqu1d <89910983+JustaSqu1d@users.noreply.github.com> Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b04e2e1b12..f2b0559e6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -152,7 +152,7 @@ These changes are available on the `master` branch, but have not yet been releas - Deprecated `Interaction.cached_channel` in favor of `Interaction.channel`. ([#2658](https://github.com/Pycord-Development/pycord/pull/2658)) - Deprecated `is_nsfw` for categories since it was never supported by the API. - ([#2772])(https://github.com/Pycord-Development/pycord/pull/2772) + ([#2772](https://github.com/Pycord-Development/pycord/pull/2772)) ### Removed From 4d35fee3cb6183ff26ec451e7c0714dbf07d9b1a Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Fri, 20 Jun 2025 19:14:57 +0300 Subject: [PATCH 32/34] Update CHANGELOG.md Co-authored-by: JustaSqu1d <89910983+JustaSqu1d@users.noreply.github.com> Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2b0559e6a..422c9162c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -108,7 +108,7 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed `ForumChannel.edit` allowing `default_reaction_emoji` to be `None`. ([#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) + ([#2746](https://github.com/Pycord-Development/pycord/pull/2746)) - Fixed `TypeError` when using `Flag` with Python 3.11+. ([#2759](https://github.com/Pycord-Development/pycord/pull/2759)) - Fixed `TypeError` when specifying `thread_name` in `Webhook.send`. From d1f16028efc74e3da3a61ed8cbd1143849df1ed4 Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Fri, 20 Jun 2025 19:15:11 +0300 Subject: [PATCH 33/34] Update CHANGELOG.md Co-authored-by: JustaSqu1d <89910983+JustaSqu1d@users.noreply.github.com> Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 422c9162c3..de7e038ad1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,7 +56,7 @@ These changes are available on the `master` branch, but have not yet been releas - Added the ability to pass a `datetime.time` object to `format_dt`. ([#2747](https://github.com/Pycord-Development/pycord/pull/2747)) - Added various missing channel parameters and allow `default_reaction_emoji` to be - `None`. ([#2772])(https://github.com/Pycord-Development/pycord/pull/2772) + `None`. ([#2772](https://github.com/Pycord-Development/pycord/pull/2772)) - Added `discord.Interaction.created_at`. ([#2801](https://github.com/Pycord-Development/pycord/pull/2801)) From 797068003841d4ed234ba39aa5459cf8715eb64e Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Fri, 20 Jun 2025 19:17:03 +0300 Subject: [PATCH 34/34] added reference --- discord/channel.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/discord/channel.py b/discord/channel.py index 240add1c72..10beeca59e 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -3067,7 +3067,11 @@ async def create_forum_channel(self, name: str, **options: Any) -> ForumChannel: """ return await self.guild.create_forum_channel(name, category=self, **options) - @utils.deprecated(since="2.7", removed="3.0") + @utils.deprecated( + since="2.7", + removed="3.0", + reference="Category NSFW was never supported by the API.", + ) def is_nsfw(self) -> bool: return False