From 9550fc4dba398d4e30bcac7432c5e7adb9d5a9ed Mon Sep 17 00:00:00 2001 From: DARSH <129121284+DARSHTRON@users.noreply.github.com> Date: Sun, 11 Jun 2023 17:57:22 +0300 Subject: [PATCH 1/9] feat: Add slowmode_delay attribute to discord.VoiceChannel adds the `slowmode_delay` attribute to the `discord.VoiceChannel` class. Signed-off-by: DARSH <129121284+DARSHTRON@users.noreply.github.com> --- discord/channel.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/discord/channel.py b/discord/channel.py index 9a2e931eba..b0336174db 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1329,6 +1329,7 @@ class VocalGuildChannel(discord.abc.Connectable, discord.abc.GuildChannel, Hasha "user_limit", "_state", "position", + 'slowmode_delay', "_overwrites", "category_id", "rtc_region", @@ -1376,6 +1377,7 @@ def _update( data, "last_message_id" ) self.position: int = data.get("position") + self.slowmode_delay = data.get('rate_limit_per_user', 0) self.bitrate: int = data.get("bitrate") self.user_limit: int = data.get("user_limit") self.flags: ChannelFlags = ChannelFlags._from_value(data.get("flags", 0)) @@ -1481,6 +1483,12 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel): .. versionadded:: 2.0 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. + + slowmode_delay: :class:`int` + The number of seconds a member must wait between sending messages + in this channel. A value of `0` denotes that it is disabled. + Bots and users with :attr:`~Permissions.manage_channels` or + :attr:`~Permissions.manage_messages` bypass slowmode. .. versionadded:: 2.0 flags: :class:`ChannelFlags` @@ -1791,6 +1799,7 @@ async def edit( overwrites: Mapping[Role | Member, PermissionOverwrite] = ..., rtc_region: VoiceRegion | None = ..., video_quality_mode: VideoQualityMode = ..., + slowmode_delay: int = ..., reason: str | None = ..., ) -> VoiceChannel | None: ... From 40bc5d5edb2173458e3f70173e2981a798314d62 Mon Sep 17 00:00:00 2001 From: DARSH <129121284+DARSHTRON@users.noreply.github.com> Date: Sun, 11 Jun 2023 18:02:18 +0300 Subject: [PATCH 2/9] Update CHANGELOG.md Signed-off-by: DARSH <129121284+DARSHTRON@users.noreply.github.com> --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c94cf00022..979b9862b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,7 +62,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2086](https://github.com/Pycord-Development/pycord/pull/2086)) - Added new embedded activities, Gartic Phone and Jamspace. ([#2102](https://github.com/Pycord-Development/pycord/pull/2102)) - +- Added `slowmode_delay` attribute to `discord.VoiceChannel`. + ([#2112](https://github.com/Pycord-Development/pycord/pull/2112)) ### Changed - Suppressed FFMPEG output when recording voice channels. From 8334ec1a158d9ea1bc4dcf8925c3fda2dcab682b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 11 Jun 2023 15:47:53 +0000 Subject: [PATCH 3/9] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 1 + discord/channel.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 979b9862b0..aafa4a2a26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ These changes are available on the `master` branch, but have not yet been releas ([#2102](https://github.com/Pycord-Development/pycord/pull/2102)) - Added `slowmode_delay` attribute to `discord.VoiceChannel`. ([#2112](https://github.com/Pycord-Development/pycord/pull/2112)) + ### Changed - Suppressed FFMPEG output when recording voice channels. diff --git a/discord/channel.py b/discord/channel.py index b0336174db..9330724250 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1329,7 +1329,7 @@ class VocalGuildChannel(discord.abc.Connectable, discord.abc.GuildChannel, Hasha "user_limit", "_state", "position", - 'slowmode_delay', + "slowmode_delay", "_overwrites", "category_id", "rtc_region", @@ -1377,7 +1377,7 @@ def _update( data, "last_message_id" ) self.position: int = data.get("position") - self.slowmode_delay = data.get('rate_limit_per_user', 0) + self.slowmode_delay = data.get("rate_limit_per_user", 0) self.bitrate: int = data.get("bitrate") self.user_limit: int = data.get("user_limit") self.flags: ChannelFlags = ChannelFlags._from_value(data.get("flags", 0)) @@ -1483,7 +1483,7 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel): .. versionadded:: 2.0 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. - + slowmode_delay: :class:`int` The number of seconds a member must wait between sending messages in this channel. A value of `0` denotes that it is disabled. From 7b17c9cadf34829ded4a1bc3070076c52ff15cc6 Mon Sep 17 00:00:00 2001 From: Middledot <78228142+Middledot@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:48:35 -0400 Subject: [PATCH 4/9] Fix duplicate changelog from pull from master Signed-off-by: Middledot <78228142+Middledot@users.noreply.github.com> --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 848fa14122..92c0adfafb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,8 +64,6 @@ These changes are available on the `master` branch, but have not yet been releas ([#2102](https://github.com/Pycord-Development/pycord/pull/2102)) - Added `bridge.Context` as a shortcut to `Union` of subclasses. ([#2106](https://github.com/Pycord-Development/pycord/pull/2106)) -- Added `slowmode_delay` attribute to `discord.VoiceChannel`. - ([#2112](https://github.com/Pycord-Development/pycord/pull/2112)) - Added Annotated forms support for type-hinting slash command options. ([#2124](https://github.com/Pycord-Development/pycord/pull/2124)) - Added `suppress` and `allowed_mentions` parameters to `Webhook` and From 5a1a72daa5a4dc6d13720c7a4fbbb89a9596dd40 Mon Sep 17 00:00:00 2001 From: The Darsh <129121284+its-darsh@users.noreply.github.com> Date: Tue, 26 Sep 2023 07:06:42 +0300 Subject: [PATCH 5/9] added `versionadded` to docstr Signed-off-by: The Darsh <129121284+its-darsh@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 51d931d694..8b3986ff31 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1490,7 +1490,7 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel): Bots and users with :attr:`~Permissions.manage_channels` or :attr:`~Permissions.manage_messages` bypass slowmode. - .. versionadded:: 2.0 + .. versionadded:: 2.5 flags: :class:`ChannelFlags` Extra features of the channel. From 4b7a2a45310736f7519659cf6ff9e9a18460bd4e Mon Sep 17 00:00:00 2001 From: The Darsh <129121284+its-darsh@users.noreply.github.com> Date: Tue, 26 Sep 2023 07:19:04 +0300 Subject: [PATCH 6/9] Update CHANGELOG.md Co-authored-by: plun1331 Signed-off-by: The Darsh <129121284+its-darsh@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92c0adfafb..0034861ea5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,7 +75,7 @@ These changes are available on the `master` branch, but have not yet been releas ([#2206](https://github.com/Pycord-Development/pycord/pull/2206)) - Added function `Guild.delete_auto_moderation_rule`. ([#2153](https://github.com/Pycord-Development/pycord/pull/2153)) -- Added `slowmode_delay` attribute to `discord.VoiceChannel`. +- Added `slowmode_delay` support to `VoiceChannel`. ([#2112](https://github.com/Pycord-Development/pycord/pull/2112)) ### Changed From 3e2191d2b4b082fcdf848a0dd0952b9d53b5f9f7 Mon Sep 17 00:00:00 2001 From: The Darsh <129121284+its-darsh@users.noreply.github.com> Date: Tue, 26 Sep 2023 07:23:53 +0300 Subject: [PATCH 7/9] fix: `VoiceChannel` docstr Signed-off-by: The Darsh <129121284+its-darsh@users.noreply.github.com> --- discord/channel.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discord/channel.py b/discord/channel.py index 8b3986ff31..f16591db48 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1484,12 +1484,13 @@ class VoiceChannel(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.0 slowmode_delay: :class:`int` The number of seconds a member must wait between sending messages in this channel. A value of `0` denotes that it is disabled. Bots and users with :attr:`~Permissions.manage_channels` or :attr:`~Permissions.manage_messages` bypass slowmode. - + .. versionadded:: 2.5 flags: :class:`ChannelFlags` Extra features of the channel. From e48f251121542eaaaa794b7900cb7ebad66106fb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 04:24:29 +0000 Subject: [PATCH 8/9] style(pre-commit): auto fixes from pre-commit.com hooks --- discord/channel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/channel.py b/discord/channel.py index f16591db48..5cd70f52f7 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -1490,7 +1490,7 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel): in this channel. A value of `0` denotes that it is disabled. Bots and users with :attr:`~Permissions.manage_channels` or :attr:`~Permissions.manage_messages` bypass slowmode. - + .. versionadded:: 2.5 flags: :class:`ChannelFlags` Extra features of the channel. From 16bf8a926e085d62dcfa93d9a3ddca24e7ba2a0a Mon Sep 17 00:00:00 2001 From: The Darsh <129121284+its-darsh@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:46:01 +0200 Subject: [PATCH 9/9] fix: VoiceChannel.slowmode_delay Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Signed-off-by: The Darsh <129121284+its-darsh@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0034861ea5..bdcf5c26ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,7 +75,7 @@ These changes are available on the `master` branch, but have not yet been releas ([#2206](https://github.com/Pycord-Development/pycord/pull/2206)) - Added function `Guild.delete_auto_moderation_rule`. ([#2153](https://github.com/Pycord-Development/pycord/pull/2153)) -- Added `slowmode_delay` support to `VoiceChannel`. +- Added `VoiceChannel.slowmode_delay`. ([#2112](https://github.com/Pycord-Development/pycord/pull/2112)) ### Changed