From a26117691c4aa0330d59d78ae32d5cf765dadc4d Mon Sep 17 00:00:00 2001 From: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Date: Fri, 18 Aug 2023 14:39:31 +0300 Subject: [PATCH 01/26] feat: add support for custom status (#2206) --- CHANGELOG.md | 2 ++ discord/activity.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2e3ef75f9..45f8d1e2fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,6 +74,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2138](https://github.com/Pycord-Development/pycord/pull/2138)) - Added `wait_finish` parameter to `VoiceClient.play` for awaiting the end of a play. ([#2194](https://github.com/Pycord-Development/pycord/pull/2194)) +- Added support for custom bot status. + ([#2206](https://github.com/Pycord-Development/pycord/pull/2206)) ### Changed diff --git a/discord/activity.py b/discord/activity.py index a00add5cd8..96b20255a8 100644 --- a/discord/activity.py +++ b/discord/activity.py @@ -160,7 +160,7 @@ class Activity(BaseActivity): type: :class:`ActivityType` The type of activity currently being done. state: Optional[:class:`str`] - The user's current state. For example, "In Game". + The user's current party status or text used for a custom status. details: Optional[:class:`str`] The detail of the user's current activity. timestamps: Dict[:class:`str`, :class:`int`] @@ -229,7 +229,6 @@ def __init__(self, **kwargs): self.assets: ActivityAssets = kwargs.pop("assets", {}) self.party: ActivityParty = kwargs.pop("party", {}) self.application_id: int | None = _get_as_snowflake(kwargs, "application_id") - self.name: str | None = kwargs.pop("name", None) self.url: str | None = kwargs.pop("url", None) self.flags: int = kwargs.pop("flags", 0) self.sync_id: str | None = kwargs.pop("sync_id", None) @@ -242,6 +241,9 @@ def __init__(self, **kwargs): if isinstance(activity_type, ActivityType) else try_enum(ActivityType, activity_type) ) + self.name: str | None = kwargs.pop( + "name", "Custom Status" if self.type == ActivityType.custom else None + ) emoji = kwargs.pop("emoji", None) self.emoji: PartialEmoji | None = ( @@ -252,6 +254,7 @@ def __repr__(self) -> str: attrs = ( ("type", self.type), ("name", self.name), + ("state", self.state), ("url", self.url), ("details", self.details), ("application_id", self.application_id), @@ -760,6 +763,8 @@ class CustomActivity(BaseActivity): The custom activity's name. emoji: Optional[:class:`PartialEmoji`] The emoji to pass to the activity, if any. + state: Optional[:class:`str`] + The text used for the custom activity. """ __slots__ = ("name", "emoji", "state") @@ -769,7 +774,7 @@ def __init__( ): super().__init__(**extra) self.name: str | None = name - self.state: str | None = extra.pop("state", None) + self.state: str | None = extra.pop("state", name) if self.name == "Custom Status": self.name = self.state From a3bd2a04fbd7ac0cec5a119cc9b360965aaaab8e Mon Sep 17 00:00:00 2001 From: Marc13 <83296140+llamaair@users.noreply.github.com> Date: Tue, 29 Aug 2023 03:37:00 +0200 Subject: [PATCH 02/26] feat: Add `Guild.delete_auto_moderation_rule` (#2153) * Update guild.py * Update guild.py * style(pre-commit): auto fixes from pre-commit.com hooks * Update CHANGELOG.md * Update discord/guild.py Co-authored-by: JustaSqu1d <89910983+JustaSqu1d@users.noreply.github.com> Signed-off-by: Marc13 <83296140+llamaair@users.noreply.github.com> * Update guild.py * Apply suggestions from code review Signed-off-by: Lala Sabathil * Update discord/guild.py Signed-off-by: Lala Sabathil * Apply suggestions from code review Signed-off-by: Lala Sabathil * Apply suggestions from code review Signed-off-by: Lala Sabathil * Apply suggestions from reviews * Apply suggestions from code review --------- Signed-off-by: Marc13 <83296140+llamaair@users.noreply.github.com> Signed-off-by: Lala Sabathil Signed-off-by: Lala Sabathil Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: JustaSqu1d <89910983+JustaSqu1d@users.noreply.github.com> Co-authored-by: Lala Sabathil Co-authored-by: Lala Sabathil Co-authored-by: plun1331 --- CHANGELOG.md | 2 ++ discord/guild.py | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45f8d1e2fc..d0fca146d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2194](https://github.com/Pycord-Development/pycord/pull/2194)) - Added support for custom bot status. ([#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)) ### Changed diff --git a/discord/guild.py b/discord/guild.py index 2bd77b2dd5..5d74590dca 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -3816,3 +3816,29 @@ async def create_auto_moderation_rule( self.id, payload, reason=reason ) return AutoModRule(state=self._state, data=data) + + async def delete_auto_moderation_rule( + self, + id: int, + *, + reason: str | None = None, + ) -> None: + """ + Deletes an auto moderation rule. + + Parameters + ---------- + id: :class:`int` + The ID of the auto moderation rule. + reason: Optional[:class:`str`] + The reason for deleting the rule. Shows up in the audit log. + + Raises + ------ + HTTPException + Deleting the auto moderation rule failed. + Forbidden + You do not have the Manage Guild permission. + """ + + await self._state.http.delete_auto_moderation_rule(self.id, id, reason=reason) From 402f2bd3fb1bde2cc4b06c6d76188893bda4a9fa Mon Sep 17 00:00:00 2001 From: David Hozic Date: Tue, 29 Aug 2023 14:12:10 +0200 Subject: [PATCH 03/26] fix: DMChannel.recipient and User.dm_channel being None after calling User.create_dm (#2219) * Fix self.recipient * style(pre-commit): auto fixes from pre-commit.com hooks * CHANGELOG --------- Signed-off-by: David Hozic Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- CHANGELOG.md | 2 ++ discord/channel.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0fca146d8..3674d773d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -168,6 +168,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2191](https://github.com/Pycord-Development/pycord/pull/2191)) - Fixed a misplaced payload object inside of the thread creation payload. ([#2192](https://github.com/Pycord-Development/pycord/pull/2192)) +- Fixed `DMChannel.recipient` being None and consequently `User.dm_channel` also being + None. ([#2219](https://github.com/Pycord-Development/pycord/pull/2219)) ## [2.4.1] - 2023-03-20 diff --git a/discord/channel.py b/discord/channel.py index 076b2c704f..6121dd5890 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -2817,7 +2817,7 @@ def __init__( self._state: ConnectionState = state self.recipient: User | None = None if r := data.get("recipients"): - self.recipient: state.store_user(r[0]) + self.recipient = state.store_user(r[0]) self.me: ClientUser = me self.id: int = int(data["id"]) From e3ce532e0340e2b03f796586b4442f03da17b937 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Aug 2023 16:40:46 +0000 Subject: [PATCH 04/26] chore(deps-dev): Update mypy requirement from ~=1.5.0 to ~=1.5.1 (#2214) Updates the requirements on [mypy](https://github.com/python/mypy) to permit the latest version. - [Commits](https://github.com/python/mypy/compare/v1.5.0...v1.5.1) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: plun1331 --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 2e9fac2a7c..bda2b677b0 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -3,7 +3,7 @@ pylint~=2.17.5 pytest~=7.4.0 pytest-asyncio~=0.21.1 # pytest-order~=1.0.1 -mypy~=1.5.0 +mypy~=1.5.1 coverage~=7.2 pre-commit==3.3.3 codespell==2.2.5 From 1d463f67cec84d65a736fde7043c46bf1a49c329 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Aug 2023 16:50:12 +0000 Subject: [PATCH 05/26] chore(deps-dev): Update coverage requirement from ~=7.2 to ~=7.3 (#2211) Updates the requirements on [coverage](https://github.com/nedbat/coveragepy) to permit the latest version. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.2.0...7.3.0) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index bda2b677b0..c6b30154df 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -4,7 +4,7 @@ pytest~=7.4.0 pytest-asyncio~=0.21.1 # pytest-order~=1.0.1 mypy~=1.5.1 -coverage~=7.2 +coverage~=7.3 pre-commit==3.3.3 codespell==2.2.5 bandit==1.7.5 From 225671013386af036ffc6e03818e38f07c91359d Mon Sep 17 00:00:00 2001 From: CarrotManMatt <108596565+CarrotManMatt@users.noreply.github.com> Date: Thu, 31 Aug 2023 22:21:16 +0100 Subject: [PATCH 06/26] docs: Update CHANGELOG.md with merged pull request #2164 (#2220) * Update CHANGELOG.md Signed-off-by: CarrotManMatt <108596565+CarrotManMatt@users.noreply.github.com> * style(pre-commit): auto fixes from pre-commit.com hooks --------- Signed-off-by: CarrotManMatt <108596565+CarrotManMatt@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3674d773d7..ace9e90cf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -164,6 +164,9 @@ These changes are available on the `master` branch, but have not yet been releas `Webhook` class. ([#2156](https://github.com/Pycord-Development/pycord/pull/2156)) - Fixed `ScheduledEvent.creator_id` returning `str` instead of `int`. ([#2162](https://github.com/Pycord-Development/pycord/pull/2162)) +- Fixed type-hinting of `values` argument of `basic_autocomplete` to include typehinting + of `Iterable[OptionChoice]`. + ([#2164](https://github.com/Pycord-Development/pycord/pull/2164)) - Fixed initial message inside of the create thread payload sending legacy beta payload. ([#2191](https://github.com/Pycord-Development/pycord/pull/2191)) - Fixed a misplaced payload object inside of the thread creation payload. From 00b544cfeff615e51a0a555cdc2a92580b555142 Mon Sep 17 00:00:00 2001 From: JustaSqu1d <89910983+JustaSqu1d@users.noreply.github.com> Date: Fri, 1 Sep 2023 18:55:04 -0700 Subject: [PATCH 07/26] docs: fix changelog mistakes (#2222) * docs: fix entry grammar mistakes * style(pre-commit): auto fixes from pre-commit.com hooks * docs: misc fixes * style(pre-commit): auto fixes from pre-commit.com hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- CHANGELOG.md | 116 +++++++++++++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 55 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ace9e90cf0..bd7b286bce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,9 +14,6 @@ These changes are available on the `master` branch, but have not yet been releas - Added possibility to start bot via async context manager. ([#1801](https://github.com/Pycord-Development/pycord/pull/1801)) -- Change default for all `name_localizations` & `description_localizations` attributes - from being `None` to be `MISSING`. - ([#1866](https://github.com/Pycord-Development/pycord/pull/1866)) - Added new parameters (`author`, `footer`, `image`, `thumbnail`) to `discord.Embed`. ([#1996](https://github.com/Pycord-Development/pycord/pull/1996)) - Added new events `on_bridge_command`, `on_bridge_command_completion`, and @@ -28,7 +25,7 @@ These changes are available on the `master` branch, but have not yet been releas ([#1936](https://github.com/Pycord-Development/pycord/pull/1936)) - Added support for one-time event listeners in `@client.listen()`. ([#1957](https://github.com/Pycord-Development/pycord/pull/1957)) -- Added `current_page` argument to Paginator.update(). +- Added `current_page` argument to `Paginator.update()`. ([#1983](https://github.com/Pycord-Development/pycord/pull/1983)) - Added new `application_auto_moderation_rule_create_badge` to `ApplicationFlags`. ([#1992](https://github.com/Pycord-Development/pycord/pull/1992)) @@ -46,11 +43,11 @@ These changes are available on the `master` branch, but have not yet been releas - Added and documented missing `AuditLogAction` enums. ([#2030](https://github.com/Pycord-Development/pycord/pull/2030), [#2171](https://github.com/Pycord-Development/pycord/pull/2171)) -- `AuditLogDiff` now supports AutoMod related models. +- Added AutoMod-related models for `AuditLogDiff` enums. ([#2030](https://github.com/Pycord-Development/pycord/pull/2030)) - Added `Interaction.respond` and `Interaction.edit` as shortcut responses. ([#2026](https://github.com/Pycord-Development/pycord/pull/2026)) -- Added `view.parent` which is set when the view was sent by +- Added `view.parent` which is set when the view is sent by `interaction.response.send_message`. ([#2036](https://github.com/Pycord-Development/pycord/pull/2036)) - Added functions (`bridge.Bot.walk_bridge_commands` & @@ -67,7 +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 `bridge.Context` as a shortcut to `Union` of subclasses. ([#2106](https://github.com/Pycord-Development/pycord/pull/2106)) -- Added Annotated forms support for typehinting slash command options. +- 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 `InteractionResponse` edit methods. @@ -81,26 +78,33 @@ These changes are available on the `master` branch, but have not yet been releas ### Changed -- Suppressed FFMPEG output when recording voice channels. +- Changed default for all `name_localizations` & `description_localizations` attributes + from being `None` to being `MISSING`. + ([#1866](https://github.com/Pycord-Development/pycord/pull/1866)) +- Changed FFMPEG output suppression when recording voice channels. ([#1993](https://github.com/Pycord-Development/pycord/pull/1993)) - Changed file-upload size limit from 8 MB to 25 MB accordingly. ([#2014](https://github.com/Pycord-Development/pycord/pull/2014)) -- `Interaction.channel` is received from the gateway, so it can now be `DMChannel` and - `GroupChannel`. ([#2025](https://github.com/Pycord-Development/pycord/pull/2025)) -- `DMChannel.recipients` can now be `None`. +- Changed the behavior of retrieving bans to accurately reflect the API. + ([#1922](https://github.com/Pycord-Development/pycord/pull/1922)) +- Changed `Interaction.channel` to be received from the gateway, allowing it to be + `DMChannel` or `GroupChannel`. ([#2025](https://github.com/Pycord-Development/pycord/pull/2025)) -- Store `view.message` on receiving Interaction for a component. - ([#2036](https://github.com/Pycord-Development/pycord/pull/2036)) -- Attributes shared between ext and slash commands are now dynamically fetched on bridge - commands. ([#1867](https://github.com/Pycord-Development/pycord/pull/1867)) -- Embed attribues like author, footer, etc now return `None` when not set, and return - their respective classes when set. +- Changed `DMChannel.recipients` to potentially be `None`. + ([#2025](https://github.com/Pycord-Development/pycord/pull/2025)) +- Changed the behavior to store `view.message` when receiving an Interaction for a + component. ([#2036](https://github.com/Pycord-Development/pycord/pull/2036)) +- Changed the fetching of attributes shared between text-based and Slash Commands in + Bridge Commands to be dynamic. + ([#1867](https://github.com/Pycord-Development/pycord/pull/1867)) +- Changed `discord.Embed` attributes (such as author, footer, etc.) now return `None` + when not set, and return their respective classes when set. ([#2063](https://github.com/Pycord-Development/pycord/pull/2063)) -- `default_avatar` behavior changes depending on the user's username migration status. +- Changed `default_avatar` behavior depending on the user's username migration status. ([#2087](https://github.com/Pycord-Development/pycord/pull/2087)) -- Typehinted `command_prefix` and `help_command` arguments properly. +- Changed type-hinted `command_prefix` and `help_command` arguments properly. ([#2099](https://github.com/Pycord-Development/pycord/pull/2099)) -- Replace `orjson` support with `msgspec` support. +- Changed the support from `orjson` to `msgspec` in the codebase. ([#2170](https://github.com/Pycord-Development/pycord/pull/2170)) ### Removed @@ -127,29 +131,30 @@ These changes are available on the `master` branch, but have not yet been releas ([#1994](https://github.com/Pycord-Development/pycord/pull/1994)) - Fixed scheduled events breaking when changing the location from external to a channel. ([#1998](https://github.com/Pycord-Development/pycord/pull/1998)) -- Fixed boolean converter breaking for bridge commands. Fix bridge command Options not - working. ([#1999](https://github.com/Pycord-Development/pycord/pull/1999)) +- Fixed boolean converter breaking for Bridge Commands. + ([#1999](https://github.com/Pycord-Development/pycord/pull/1999)) +- Fixed Bridge Command Options not working. + ([#1999](https://github.com/Pycord-Development/pycord/pull/1999)) - Fixed `TypeError` being raised when passing `name` argument to bridge groups. ([#2000](https://github.com/Pycord-Development/pycord/pull/2000)) -- Fixed `TypeError` in AutoModRule. +- Fixed `TypeError` in `AutoModRule`. ([#2029](https://github.com/Pycord-Development/pycord/pull/2029)) -- Reflecting the api for gettings bans correctly. - ([#1922](https://github.com/Pycord-Development/pycord/pull/1922)) -- Restored functionality for overriding default `on_application_command_error` via - listeners. ([#2044](https://github.com/Pycord-Development/pycord/pull/2044)) -- Fixed unloading of cogs having bridge commands. +- Fixed the functionality to override the default `on_application_command_error` + behavior using listeners. + ([#2044](https://github.com/Pycord-Development/pycord/pull/2044)) +- Fixed unloading of cogs having Bridge Commands. ([#2048](https://github.com/Pycord-Development/pycord/pull/2048)) -- Fixed the Slash command syncronization method `indiviual`. +- Fixed the Slash Command synchronization method `individual`. ([#1925](https://github.com/Pycord-Development/pycord/pull/1925)) - Fixed an issue that occurred when `webhooks_update` event payload channel ID was `None`. ([#2078](https://github.com/Pycord-Development/pycord/pull/2078)) -- Fixed major TypeError when an AuditLogEntry has no user. +- Fixed major `TypeError` when an `AuditLogEntry` has no user. ([#2079](https://github.com/Pycord-Development/pycord/pull/2079)) - Fixed `HTTPException` when trying to create a forum thread with files. ([#2075](https://github.com/Pycord-Development/pycord/pull/2075)) - Fixed `before_invoke` not being run for `SlashCommandGroup`. ([#2091](https://github.com/Pycord-Development/pycord/pull/2091)) -- Fixed `AttributeError` when accessing a `Select`'s values when it hasn't been +- Fixed `AttributeError` when accessing a `Select` object's values when it hasn't been interacted with. ([#2104](https://github.com/Pycord-Development/pycord/pull/2104)) - Fixed `before_invoke` being run twice for slash subcommands. ([#2139](https://github.com/Pycord-Development/pycord/pull/2139)) @@ -157,22 +162,22 @@ These changes are available on the `master` branch, but have not yet been releas ([#2145](https://github.com/Pycord-Development/pycord/pull/2145)) - Fixed `Thread.applied_tags` not being updated. ([#2146](https://github.com/Pycord-Development/pycord/pull/2146)) -- Fixed type-hinting of `author` property of `ApplicationContext` to include typehinting - of `User` or `Member`. +- Fixed type-hinting of `author` property of `ApplicationContext` to include + type-hinting of `User` or `Member`. ([#2148](https://github.com/Pycord-Development/pycord/pull/2148)) -- Fixed missing `delete_after` parameter in overload type-hinting for `send` method in - `Webhook` class. ([#2156](https://github.com/Pycord-Development/pycord/pull/2156)) +- Fixed missing `delete_after` parameter in overload type-hinting for `Webhook.send()`. + ([#2156](https://github.com/Pycord-Development/pycord/pull/2156)) - Fixed `ScheduledEvent.creator_id` returning `str` instead of `int`. ([#2162](https://github.com/Pycord-Development/pycord/pull/2162)) -- Fixed type-hinting of `values` argument of `basic_autocomplete` to include typehinting - of `Iterable[OptionChoice]`. +- Fixed type-hinting of `values` argument of `basic_autocomplete` to include + type-hinting of `Iterable[OptionChoice]`. ([#2164](https://github.com/Pycord-Development/pycord/pull/2164)) - Fixed initial message inside of the create thread payload sending legacy beta payload. ([#2191](https://github.com/Pycord-Development/pycord/pull/2191)) - Fixed a misplaced payload object inside of the thread creation payload. ([#2192](https://github.com/Pycord-Development/pycord/pull/2192)) -- Fixed `DMChannel.recipient` being None and consequently `User.dm_channel` also being - None. ([#2219](https://github.com/Pycord-Development/pycord/pull/2219)) +- Fixed `DMChannel.recipient` being `None` and consequently `User.dm_channel` also being + `None`. ([#2219](https://github.com/Pycord-Development/pycord/pull/2219)) ## [2.4.1] - 2023-03-20 @@ -186,10 +191,11 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed the type-hinting of `SlashCommandGroup.walk_commands()` to reflect actual behavior. ([#1838](https://github.com/Pycord-Development/pycord/pull/1838)) -- Fixed the voice ip discovery due to the recent +- Fixed the voice IP discovery due to the recent [announced change](https://discord.com/channels/613425648685547541/697138785317814292/1080623873629884486). ([#1955](https://github.com/Pycord-Development/pycord/pull/1955)) -- Fixed `reason` being passed to wrong method in `guild.create_auto_moderation_rule`. +- Fixed `reason` being passed to the wrong method in + `guild.create_auto_moderation_rule`. ([#1960](https://github.com/Pycord-Development/pycord/pull/1960)) ## [2.4.0] - 2023-02-10 @@ -316,7 +322,7 @@ These changes are available on the `master` branch, but have not yet been releas ### Fixed -- Fixed `parent` attribute of second level subcommands being set to the base level +- Fixed `parent` attribute of second-level subcommands being set to the base level command instead of the direct parent. ([#1673](https://github.com/Pycord-Development/pycord/pull/1673)) @@ -344,7 +350,7 @@ These changes are available on the `master` branch, but have not yet been releas ([#1613](https://github.com/Pycord-Development/pycord/pull/1613)) - `suppress` kwarg to `Messageable.send()`. ([#1587](https://github.com/Pycord-Development/pycord/pull/1587)) -- `proxy` and `proxy_auth` params to many Webhook related methods. +- `proxy` and `proxy_auth` params to many Webhook-related methods. ([#1655](https://github.com/Pycord-Development/pycord/pull/1655)) - `delete_message_seconds` parameter in ban methods. ([#1557](https://github.com/Pycord-Development/pycord/pull/1557)) @@ -474,7 +480,7 @@ These changes are available on the `master` branch, but have not yet been releas `description`. ([#1546](https://github.com/Pycord-Development/pycord/pull/1546)) - Fix threads created with a base message being set to the wrong `message_reference`. ([#1551](https://github.com/Pycord-Development/pycord/pull/1551)) -- Avoid unnecessary call to `sync_commands` during runtime. +- Avoid unnecessary calls to `sync_commands` during runtime. ([#1563](https://github.com/Pycord-Development/pycord/pull/1563)) - Fix bug in `Modal.on_timeout()` by using `custom_id` to create timeout task. ([#1562](https://github.com/Pycord-Development/pycord/pull/1562)) @@ -569,7 +575,7 @@ These changes are available on the `master` branch, but have not yet been releas ([#1386](https://github.com/Pycord-Development/pycord/pull/1386)) - Fix `remove_application_command` not always removing commands. ([#1391](https://github.com/Pycord-Development/pycord/pull/1391)) -- Fix busy-loop in `DecodeManager` when decode queue is empty, causing 100% CPU +- Fix busy-loop in `DecodeManager` when the decode queue is empty, causing 100% CPU consumption. ([#1395](https://github.com/Pycord-Development/pycord/pull/1395)) - Fix incorrect activities and permissions on `Interaction` and `Option` objects. ([#1365](https://github.com/Pycord-Development/pycord/pull/1365)) @@ -589,7 +595,7 @@ These changes are available on the `master` branch, but have not yet been releas ([#1453](https://github.com/Pycord-Development/pycord/pull/1453)) - Update `thread.members` on `thread.fetch_members`. ([#1464](https://github.com/Pycord-Development/pycord/pull/1464)) -- Fix error when discord doesn't send the `app_permissions` data in `Interaction`. +- Fix the error when Discord doesn't send the `app_permissions` data in `Interaction`. ([#1467](https://github.com/Pycord-Development/pycord/pull/1467)) - Fix AttributeError when voice client `play()` function isn't completed yet. ([#1360](https://github.com/Pycord-Development/pycord/pull/1360)) @@ -611,10 +617,10 @@ These changes are available on the `master` branch, but have not yet been releas ([#1181](https://github.com/Pycord-Development/pycord/pull/1181)) - Option names and descriptions are now validated locally. ([#1271](https://github.com/Pycord-Development/pycord/pull/1271)) -- Component field limits are now enforced at library-level +- Component field limits are now enforced at the library level ([#1065](https://github.com/Pycord-Development/pycord/pull/1065) & [#1289](https://github.com/Pycord-Development/pycord/pull/1289)) -- Support providing option channel types as list. +- Support providing option channel types as a list. ([#1000](https://github.com/Pycord-Development/pycord/pull/1000)) - New `Guild.jump_url` property. ([#1282](https://github.com/Pycord-Development/pycord/pull/1282)) @@ -650,7 +656,7 @@ These changes are available on the `master` branch, but have not yet been releas - Removed implicit defer call in `View`. ([#1260](https://github.com/Pycord-Development/pycord/pull/1260)) -- `Option` class and usage was rewritten. +- `Option` class and usage were rewritten. ([#1251](https://github.com/Pycord-Development/pycord/pull/1251)) - `description` argument of `PageGroup` is now optional. ([#1330](https://github.com/Pycord-Development/pycord/pull/1330)) @@ -665,7 +671,7 @@ These changes are available on the `master` branch, but have not yet been releas ([#1256](https://github.com/Pycord-Development/pycord/pull/1256)) - Fix channel parsing in slash command invocations. ([#1257](https://github.com/Pycord-Development/pycord/pull/1257)) -- Make channel `position` attribute optional. +- Make the channel `position` attribute optional. ([#1257](https://github.com/Pycord-Development/pycord/pull/1257)) - Fix `PaginatorMenu` to use interaction routes for updates. ([#1267](https://github.com/Pycord-Development/pycord/pull/1267)) @@ -677,17 +683,17 @@ These changes are available on the `master` branch, but have not yet been releas ([#1262](https://github.com/Pycord-Development/pycord/pull/1262)) - Fix interaction response race condition. ([#1039](https://github.com/Pycord-Development/pycord/pull/1039)) -- Remove voice client when bot disconnects. +- Remove voice client when the bot disconnects. ([#1273](https://github.com/Pycord-Development/pycord/pull/1273)) -- Fix conversion exception in ext.bridge. +- Fix conversion exception in `ext.bridge`. ([#1250](https://github.com/Pycord-Development/pycord/pull/1250)) -- Context.me return ClientUser when guilds intent is absent. +- `Context.me` returns ClientUser when guilds intent is absent. ([#1286](https://github.com/Pycord-Development/pycord/pull/1286)) -- Updated `Message.edit` type hinting overload and removed resulting redundant +- Updated `Message.edit` type-hinting overload and removed resulting redundant overloads. ([#1299](https://github.com/Pycord-Development/pycord/pull/1299)) - Improved validation regex for command names & options. ([#1309](https://github.com/Pycord-Development/pycord/pull/1309)) -- Correct `Guild.fetch_members()` type hints. +- Correct `Guild.fetch_members()` type-hints. ([#1323](https://github.com/Pycord-Development/pycord/pull/1323)) - Multiple fixes and enhancements for `PageGroup` handling. ([#1350](https://github.com/Pycord-Development/pycord/pull/1350)) From a1ec80f05ba3db415827c17816f3c40151fd1b9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 22:37:34 +0000 Subject: [PATCH 08/26] ci(deps): Bump actions/checkout from 3 to 4 (#2226) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check.yml | 4 ++-- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/lint.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- .github/workflows/todo.yml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d64c44f2a5..ed9651b025 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -9,7 +9,7 @@ jobs: codespell: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "3.11" @@ -25,7 +25,7 @@ jobs: bandit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "3.11" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 63eb6a6ff7..65da74cfb0 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -41,7 +41,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index eebcd0b41e..35cb6d490d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,7 +9,7 @@ jobs: pylint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "3.11" @@ -31,7 +31,7 @@ jobs: mypy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "3.11" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9ad535184a..9a2b03aa55 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -48,7 +48,7 @@ jobs: docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/.github/workflows/todo.yml b/.github/workflows/todo.yml index fec76a1f57..508f34218f 100644 --- a/.github/workflows/todo.yml +++ b/.github/workflows/todo.yml @@ -4,7 +4,7 @@ jobs: todo: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run tdg-github-action uses: ribtoks/tdg-github-action@v0.4.7-beta with: From 0bb308995aefd28443bdb9d7caeb8f233dd6b807 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 22:53:31 +0000 Subject: [PATCH 09/26] chore(deps-dev): update pytest requirement from ~=7.4.0 to ~=7.4.1 (#2227) Updates the requirements on [pytest](https://github.com/pytest-dev/pytest) to permit the latest version. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.4.0...7.4.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index c6b30154df..3b1ecce5cf 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,6 +1,6 @@ -r _.txt pylint~=2.17.5 -pytest~=7.4.0 +pytest~=7.4.1 pytest-asyncio~=0.21.1 # pytest-order~=1.0.1 mypy~=1.5.1 From d16887423e832c8be53eb8342b06ef18f3c36bf6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 23:03:56 +0000 Subject: [PATCH 10/26] chore(deps-dev): bump pre-commit from 3.3.3 to 3.4.0 (#2228) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.3.3 to 3.4.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.3.3...v3.4.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 3b1ecce5cf..c2c659bab9 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -5,7 +5,7 @@ pytest-asyncio~=0.21.1 # pytest-order~=1.0.1 mypy~=1.5.1 coverage~=7.3 -pre-commit==3.3.3 +pre-commit==3.4.0 codespell==2.2.5 bandit==1.7.5 flake8==6.1.0 From b4b109c380f9bf179bb999ada5d30f01421a3e73 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 18:17:38 -0500 Subject: [PATCH 11/26] chore(pre-commit): pre-commit autoupdate (#2202) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/autoflake: v2.2.0 → v2.2.1](https://github.com/PyCQA/autoflake/compare/v2.2.0...v2.2.1) - [github.com/asottile/pyupgrade: v3.9.0 → v3.10.1](https://github.com/asottile/pyupgrade/compare/v3.9.0...v3.10.1) - [github.com/pre-commit/mirrors-prettier: v3.0.0 → v3.0.3](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.0...v3.0.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 43519b50cd..49982509b9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: trailing-whitespace - id: end-of-file-fixer - repo: https://github.com/PyCQA/autoflake - rev: v2.2.0 + rev: v2.2.1 hooks: - id: autoflake # args: @@ -19,7 +19,7 @@ repos: # - --remove-duplicate-keys # - --remove-unused-variables - repo: https://github.com/asottile/pyupgrade - rev: v3.9.0 + rev: v3.10.1 hooks: - id: pyupgrade args: [--py38-plus] @@ -77,7 +77,7 @@ repos: # - id: mypy - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0 + rev: v3.0.3 hooks: - id: prettier args: [--prose-wrap=always, --print-width=88] From 046d38c914e902645265d42c38539be0f76a117c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 20:15:35 +0000 Subject: [PATCH 12/26] chore(pre-commit): pre-commit autoupdate (#2230) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 49982509b9..30756e9fc2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 23.9.1 hooks: - id: black args: [--safe, --quiet] From 7de45826999adb8133e047580ba18a3e2be3af2e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 23:47:13 +0000 Subject: [PATCH 13/26] chore(pre-commit): pre-commit autoupdate (#2231) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.10.1 → v3.11.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.11.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 30756e9fc2..6b971a064a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: # - --remove-duplicate-keys # - --remove-unused-variables - repo: https://github.com/asottile/pyupgrade - rev: v3.10.1 + rev: v3.11.0 hooks: - id: pyupgrade args: [--py38-plus] From b09fc463a22b9f4c13aabc6918dce303be2d5741 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Sep 2023 17:04:48 +0000 Subject: [PATCH 14/26] chore(deps-dev): update pytest requirement from ~=7.4.1 to ~=7.4.2 (#2229) Updates the requirements on [pytest](https://github.com/pytest-dev/pytest) to permit the latest version. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.4.1...7.4.2) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Middledot <78228142+Middledot@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index c2c659bab9..4ab5bc5694 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,6 +1,6 @@ -r _.txt pylint~=2.17.5 -pytest~=7.4.1 +pytest~=7.4.2 pytest-asyncio~=0.21.1 # pytest-order~=1.0.1 mypy~=1.5.1 From a745944113917403bc766836c7e581be299760c0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 22:42:41 +0000 Subject: [PATCH 15/26] chore(pre-commit): pre-commit autoupdate (#2232) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.11.0 → v3.13.0](https://github.com/asottile/pyupgrade/compare/v3.11.0...v3.13.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6b971a064a..ed38b0797c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: # - --remove-duplicate-keys # - --remove-unused-variables - repo: https://github.com/asottile/pyupgrade - rev: v3.11.0 + rev: v3.13.0 hooks: - id: pyupgrade args: [--py38-plus] From 0f2685c708880e87067d721b66a36b1c45114436 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 23:36:47 +0000 Subject: [PATCH 16/26] chore(deps): update msgspec requirement from ~=0.18.0 to ~=0.18.4 (#2239) Updates the requirements on [msgspec](https://github.com/jcrist/msgspec) to permit the latest version. - [Release notes](https://github.com/jcrist/msgspec/releases) - [Commits](https://github.com/jcrist/msgspec/compare/0.18.0...0.18.4) --- updated-dependencies: - dependency-name: msgspec dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/speed.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/speed.txt b/requirements/speed.txt index 32c37acb7a..5664d336cf 100644 --- a/requirements/speed.txt +++ b/requirements/speed.txt @@ -1,2 +1,2 @@ -msgspec~=0.18.0 +msgspec~=0.18.4 aiohttp[speedups] From 4e4d111f72e96ed1b9955b4dd4c5e13b549f658e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:23:45 +0000 Subject: [PATCH 17/26] chore(deps-dev): bump codespell from 2.2.5 to 2.2.6 (#2235) Bumps [codespell](https://github.com/codespell-project/codespell) from 2.2.5 to 2.2.6. - [Release notes](https://github.com/codespell-project/codespell/releases) - [Commits](https://github.com/codespell-project/codespell/compare/v2.2.5...v2.2.6) --- updated-dependencies: - dependency-name: codespell dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 4ab5bc5694..7eed9847a3 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -6,6 +6,6 @@ pytest-asyncio~=0.21.1 mypy~=1.5.1 coverage~=7.3 pre-commit==3.4.0 -codespell==2.2.5 +codespell==2.2.6 bandit==1.7.5 flake8==6.1.0 From 927f8cefb0a5ba8ed5f2c7ccad3f734852bef62e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Oct 2023 20:59:42 +0000 Subject: [PATCH 18/26] chore(deps-dev): bump pre-commit from 3.4.0 to 3.5.0 (#2244) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.4.0 to 3.5.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.4.0...v3.5.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 7eed9847a3..c2bdeb8682 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -5,7 +5,7 @@ pytest-asyncio~=0.21.1 # pytest-order~=1.0.1 mypy~=1.5.1 coverage~=7.3 -pre-commit==3.4.0 +pre-commit==3.5.0 codespell==2.2.6 bandit==1.7.5 flake8==6.1.0 From 6888b902b60066ade8724e47f68c6236f2fef1f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:40:01 +0000 Subject: [PATCH 19/26] chore(deps-dev): update pytest requirement from ~=7.4.2 to ~=7.4.3 (#2249) Updates the requirements on [pytest](https://github.com/pytest-dev/pytest) to permit the latest version. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.4.2...7.4.3) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index c2bdeb8682..1831a6fd24 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,6 +1,6 @@ -r _.txt pylint~=2.17.5 -pytest~=7.4.2 +pytest~=7.4.3 pytest-asyncio~=0.21.1 # pytest-order~=1.0.1 mypy~=1.5.1 From bbb1e3260da349febb58d2c88376f6125566815b Mon Sep 17 00:00:00 2001 From: Marc13 <83296140+llamaair@users.noreply.github.com> Date: Mon, 30 Oct 2023 18:38:17 +0100 Subject: [PATCH 20/26] fix: `_bytes_to_base64_data` not defined (#2185) * fix: _bytes_to_base64_data isn't defined * Add changelog entry --------- Signed-off-by: Middledot <78228142+Middledot@users.noreply.github.com> Co-authored-by: Middledot <78228142+Middledot@users.noreply.github.com> --- CHANGELOG.md | 2 ++ discord/guild.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd7b286bce..41f9e96c11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -169,6 +169,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2156](https://github.com/Pycord-Development/pycord/pull/2156)) - Fixed `ScheduledEvent.creator_id` returning `str` instead of `int`. ([#2162](https://github.com/Pycord-Development/pycord/pull/2162)) +- Fixed `_bytes_to_base64_data` not defined. + ([#2185](https://github.com/Pycord-Development/pycord/pull/2185)) - Fixed type-hinting of `values` argument of `basic_autocomplete` to include type-hinting of `Iterable[OptionChoice]`. ([#2164](https://github.com/Pycord-Development/pycord/pull/2164)) diff --git a/discord/guild.py b/discord/guild.py index 5d74590dca..2f449beb60 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -2908,7 +2908,7 @@ async def create_role( if icon is None: fields["icon"] = None else: - fields["icon"] = _bytes_to_base64_data(icon) + fields["icon"] = utils._bytes_to_base64_data(icon) fields["unicode_emoji"] = None if unicode_emoji is not MISSING: From 9e4b3fff915a947628d0c1410dc2e188a6d98afb Mon Sep 17 00:00:00 2001 From: UK <41271523+NeloBlivion@users.noreply.github.com> Date: Mon, 30 Oct 2023 17:43:54 +0000 Subject: [PATCH 21/26] feat: Add properties for burst reactions (#1947) * Support for burst reactions * Complete implementation * style(pre-commit): auto fixes from pre-commit.com hooks * fix slots * docs fixes * style(pre-commit): auto fixes from pre-commit.com hooks * correction * return type --------- Signed-off-by: UK <41271523+NeloBlivion@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Lala Sabathil --- discord/enums.py | 8 ++++ discord/http.py | 3 ++ discord/iterators.py | 10 ++++- discord/raw_models.py | 33 +++++++++++++- discord/reaction.py | 85 ++++++++++++++++++++++++++++++++++--- discord/types/message.py | 6 +++ discord/types/raw_models.py | 6 +++ docs/api/enums.rst | 14 ++++++ docs/api/models.rst | 3 ++ 9 files changed, 158 insertions(+), 10 deletions(-) diff --git a/discord/enums.py b/discord/enums.py index f4b44623b0..f2bb6d3452 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -67,6 +67,7 @@ "AutoModActionType", "AutoModKeywordPresetType", "ApplicationRoleConnectionMetadataType", + "ReactionType", ) @@ -944,6 +945,13 @@ class ApplicationRoleConnectionMetadataType(Enum): boolean_not_equal = 8 +class ReactionType(Enum): + """The reaction type""" + + normal = 0 + burst = 1 + + T = TypeVar("T") diff --git a/discord/http.py b/discord/http.py index 9eb7837d13..40d9ebd928 100644 --- a/discord/http.py +++ b/discord/http.py @@ -757,6 +757,7 @@ def get_reaction_users( emoji: str, limit: int, after: Snowflake | None = None, + type: int | None = None, ) -> Response[list[user.User]]: r = Route( "GET", @@ -771,6 +772,8 @@ def get_reaction_users( } if after: params["after"] = after + if type: + params["type"] = type return self.request(r, params=params) def clear_reactions( diff --git a/discord/iterators.py b/discord/iterators.py index 78edb7570d..b171d70ed6 100644 --- a/discord/iterators.py +++ b/discord/iterators.py @@ -182,10 +182,11 @@ async def next(self) -> T: class ReactionIterator(_AsyncIterator[Union["User", "Member"]]): - def __init__(self, message, emoji, limit=100, after=None): + def __init__(self, message, emoji, limit=100, after=None, type=None): self.message = message self.limit = limit self.after = after + self.type = type state = message._state self.getter = state.http.get_reaction_users self.state = state @@ -212,7 +213,12 @@ async def fill_users(self): after = self.after.id if self.after else None data: list[PartialUserPayload] = await self.getter( - self.channel_id, self.message.id, self.emoji, retrieve, after=after + self.channel_id, + self.message.id, + self.emoji, + retrieve, + after=after, + type=self.type, ) if data: diff --git a/discord/raw_models.py b/discord/raw_models.py index 1cd88ea0c2..39eab47443 100644 --- a/discord/raw_models.py +++ b/discord/raw_models.py @@ -29,7 +29,7 @@ from typing import TYPE_CHECKING from .automod import AutoModAction, AutoModTriggerType -from .enums import AuditLogAction, ChannelType, try_enum +from .enums import AuditLogAction, ChannelType, ReactionType, try_enum from .types.user import User if TYPE_CHECKING: @@ -214,6 +214,15 @@ class RawReactionActionEvent(_RawReprMixin): ``REACTION_REMOVE`` for reaction removal. .. versionadded:: 1.3 + burst: :class:`bool` + Whether this reaction is a burst (super) reaction. + burst_colours: Optional[:class:`list`] + A list of hex codes this reaction can be. Only available if `event_type` is `REACTION_ADD` + and this emoji has super reactions available. + burst_colors: Optional[:class:`list`] + Alias for :attr:`burst_colours`. + type: :class:`ReactionType` + The type of reaction added. data: :class:`dict` The raw data sent by the `gateway `_. @@ -226,6 +235,10 @@ class RawReactionActionEvent(_RawReprMixin): "channel_id", "guild_id", "emoji", + "burst", + "burst_colours", + "burst_colors", + "type", "event_type", "member", "data", @@ -240,6 +253,10 @@ def __init__( self.emoji: PartialEmoji = emoji self.event_type: str = event_type self.member: Member | None = None + self.burst: bool = data.get("burst") + self.burst_colours: list = data.get("burst_colors", []) + self.burst_colors: list = self.burst_colours + self.type: ReactionType = try_enum(data.get("type", 0)) try: self.guild_id: int | None = int(data["guild_id"]) @@ -293,18 +310,30 @@ class RawReactionClearEmojiEvent(_RawReprMixin): The guild ID where the reactions got cleared. emoji: :class:`PartialEmoji` The custom or unicode emoji being removed. + burst: :class:`bool` + Whether this reaction was a burst (super) reaction. + burst_colours: :class:`list` + The available HEX codes of the removed super reaction. + burst_colors: Optional[:class:`list`] + Alias for :attr:`burst_colours`. + type: :class:`ReactionType` + The type of reaction removed. data: :class:`dict` The raw data sent by the `gateway `_. .. versionadded:: 2.5 """ - __slots__ = ("message_id", "channel_id", "guild_id", "emoji", "data") + __slots__ = ("message_id", "channel_id", "guild_id", "emoji", "burst", "data") def __init__(self, data: ReactionClearEmojiEvent, emoji: PartialEmoji) -> None: self.emoji: PartialEmoji = emoji self.message_id: int = int(data["message_id"]) self.channel_id: int = int(data["channel_id"]) + self.burst: bool = data.get("burst") + self.burst_colours: list = data.get("burst_colors", []) + self.burst_colors: list = self.burst_colours + self.type: ReactionType = try_enum(data.get("type", 0)) try: self.guild_id: int | None = int(data["guild_id"]) diff --git a/discord/reaction.py b/discord/reaction.py index ea1bcbded9..426b5474ef 100644 --- a/discord/reaction.py +++ b/discord/reaction.py @@ -27,9 +27,11 @@ from typing import TYPE_CHECKING, Any +from .colour import Colour +from .enums import ReactionType from .iterators import ReactionIterator -__all__ = ("Reaction",) +__all__ = ("Reaction", "ReactionCountDetails") if TYPE_CHECKING: from .abc import Snowflake @@ -37,6 +39,7 @@ from .message import Message from .partial_emoji import PartialEmoji from .types.message import Reaction as ReactionPayload + from .types.message import ReactionCountDetails as ReactionCountDetailsPayload class Reaction: @@ -70,14 +73,27 @@ class Reaction: emoji: Union[:class:`Emoji`, :class:`PartialEmoji`, :class:`str`] The reaction emoji. May be a custom emoji, or a unicode emoji. count: :class:`int` - Number of times this reaction was made + The combined total of normal and super reactions for this emoji. me: :class:`bool` - If the user sent this reaction. + If the user sent this as a normal reaction. + me_burst: :class:`bool` + If the user sent this as a super reaction. message: :class:`Message` Message this reaction is for. + burst: :class:`bool` + Whether this reaction is a burst (super) reaction. """ - __slots__ = ("message", "count", "emoji", "me") + __slots__ = ( + "message", + "count", + "emoji", + "me", + "burst", + "me_burst", + "_count_details", + "_burst_colours", + ) def __init__( self, @@ -91,7 +107,35 @@ def __init__( emoji or message._state.get_reaction_emoji(data["emoji"]) ) self.count: int = data.get("count", 1) + self._count_details: ReactionCountDetailsPayload = data.get("count_details", {}) self.me: bool = data.get("me") + self.burst: bool = data.get("burst") + self.me_burst: bool = data.get("me_burst") + self._burst_colours: list[Colour] = data.get("burst_colors", []) + + @property + def burst_colours(self) -> list[Colour]: + """Returns a list possible :class:`Colour` this super reaction can be. + + There is an alias for this named :attr:`burst_colors`. + """ + + # We recieve a list of #FFFFFF, so omit the # and convert to base 16 + return [Colour(int(c[1:], 16)) for c in self._burst_colours] + + @property + def burst_colors(self) -> list[Colour]: + """Returns a list possible :class:`Colour` this super reaction can be. + + There is an alias for this named :attr:`burst_colours`. + """ + + return self.burst_colours + + @property + def count_details(self): + """Returns :class:`ReactionCountDetails` for the individual counts of normal and super reactions made.""" + return ReactionCountDetails(self._count_details) # TODO: typeguard def is_custom_emoji(self) -> bool: @@ -166,7 +210,11 @@ async def clear(self) -> None: await self.message.clear_reaction(self.emoji) def users( - self, *, limit: int | None = None, after: Snowflake | None = None + self, + *, + limit: int | None = None, + after: Snowflake | None = None, + type: ReactionType | None = None, ) -> ReactionIterator: """Returns an :class:`AsyncIterator` representing the users that have reacted to the message. @@ -181,6 +229,8 @@ def users( reacted to the message. after: Optional[:class:`abc.Snowflake`] For pagination, reactions are sorted by member. + type: Optional[:class:`ReactionType`] + The type of reaction to get users for. Defaults to `normal`. Yields ------ @@ -210,6 +260,10 @@ def users( # users is now a list of User... winner = random.choice(users) await channel.send(f'{winner} has won the raffle.') + + Getting super reactors: :: + + users = await reaction.users(type=ReactionType.burst).flatten() """ if not isinstance(self.emoji, str): @@ -220,4 +274,23 @@ def users( if limit is None: limit = self.count - return ReactionIterator(self.message, emoji, limit, after) + if isinstance(type, ReactionType): + type = type.value + + return ReactionIterator(self.message, emoji, limit, after, type) + + +class ReactionCountDetails: + """Represents a breakdown of the normal and burst reaction counts for the emoji. + + Attributes + ---------- + normal: :class:`int` + The number of normal reactions for this emoji. + burst: :class:`bool` + The number of super reactions for this emoji. + """ + + def __init__(self, data: ReactionCountDetailsPayload): + self.normal = data.get("normal", 0) + self.burst = data.get("burst", 0) diff --git a/discord/types/message.py b/discord/types/message.py index b141531e9a..93e99ba7ab 100644 --- a/discord/types/message.py +++ b/discord/types/message.py @@ -54,6 +54,12 @@ class Reaction(TypedDict): count: int me: bool emoji: PartialEmoji + burst: bool + + +class ReactionCountDetails(TypedDict): + normal: int + burst: int class Attachment(TypedDict): diff --git a/discord/types/raw_models.py b/discord/types/raw_models.py index 453e75cf17..44ac45363d 100644 --- a/discord/types/raw_models.py +++ b/discord/types/raw_models.py @@ -62,6 +62,9 @@ class ReactionActionEvent(_ReactionEventOptional): channel_id: Snowflake message_id: Snowflake emoji: PartialEmoji + burst: bool + burst_colors: list + type: int class ReactionClearEvent(_ReactionEventOptional): @@ -73,6 +76,9 @@ class ReactionClearEmojiEvent(_ReactionEventOptional): channel_id: int message_id: int emoji: PartialEmoji + burst: bool + burst_colors: list + type: int class IntegrationDeleteEvent(TypedDict): diff --git a/docs/api/enums.rst b/docs/api/enums.rst index e2620ed8e5..45317a37ce 100644 --- a/docs/api/enums.rst +++ b/docs/api/enums.rst @@ -2292,3 +2292,17 @@ of :class:`enum.Enum`. .. attribute:: slurs Represents the slurs keyword preset rule. + +.. class:: ReactionType + + Represents a Reaction's type. + + .. versionadded:: 2.5 + + .. attribute:: normal + + Represents a normal reaction. + + .. attribute:: burst + + Represents a super reaction. diff --git a/docs/api/models.rst b/docs/api/models.rst index 909853a769..4d11fed63e 100644 --- a/docs/api/models.rst +++ b/docs/api/models.rst @@ -98,6 +98,9 @@ Messages .. automethod:: users :async-for: +.. autoclass:: ReactionCountDetails() + :members: + Guild ----- From 73e71737c1c06fd964a6fa7b1439982f454c6fb4 Mon Sep 17 00:00:00 2001 From: UK <41271523+NeloBlivion@users.noreply.github.com> Date: Wed, 8 Nov 2023 20:44:04 +0000 Subject: [PATCH 22/26] fix: TypeErrors raised from Reaction events (#2255) fix try_enum --- discord/raw_models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/raw_models.py b/discord/raw_models.py index 39eab47443..79c8091d98 100644 --- a/discord/raw_models.py +++ b/discord/raw_models.py @@ -256,7 +256,7 @@ def __init__( self.burst: bool = data.get("burst") self.burst_colours: list = data.get("burst_colors", []) self.burst_colors: list = self.burst_colours - self.type: ReactionType = try_enum(data.get("type", 0)) + self.type: ReactionType = try_enum(ReactionType, data.get("type", 0)) try: self.guild_id: int | None = int(data["guild_id"]) @@ -333,7 +333,7 @@ def __init__(self, data: ReactionClearEmojiEvent, emoji: PartialEmoji) -> None: self.burst: bool = data.get("burst") self.burst_colours: list = data.get("burst_colors", []) self.burst_colors: list = self.burst_colours - self.type: ReactionType = try_enum(data.get("type", 0)) + self.type: ReactionType = try_enum(ReactionType, data.get("type", 0)) try: self.guild_id: int | None = int(data["guild_id"]) From 80efff04865c888a93b06b505366477b31d1c871 Mon Sep 17 00:00:00 2001 From: FrederikTheDane <13228251+FrederikTheDane@users.noreply.github.com> Date: Tue, 21 Nov 2023 18:18:50 +0100 Subject: [PATCH 23/26] fix: ffmpeg terminated prematurely (#2240) --- CHANGELOG.md | 2 ++ discord/player.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41f9e96c11..acc9ecc98e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -180,6 +180,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2192](https://github.com/Pycord-Development/pycord/pull/2192)) - Fixed `DMChannel.recipient` being `None` and consequently `User.dm_channel` also being `None`. ([#2219](https://github.com/Pycord-Development/pycord/pull/2219)) +- Fixed ffmpeg being terminated prematurely when piping audio stream. + ([#2240](https://github.com/Pycord-Development/pycord/pull/2240)) ## [2.4.1] - 2023-03-20 diff --git a/discord/player.py b/discord/player.py index 87b0f5718a..0b4dc417c3 100644 --- a/discord/player.py +++ b/discord/player.py @@ -227,7 +227,7 @@ def _pipe_writer(self, source: io.BufferedIOBase) -> None: # arbitrarily large read size data = source.read(8192) if not data: - self._process.terminate() + self._stdin.close() return try: self._stdin.write(data) From 31a9692997e1ffc3af34bbaed548f88c27722b20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 26 Nov 2023 14:54:54 +0000 Subject: [PATCH 24/26] chore(deps-dev): update mypy requirement from ~=1.5.1 to ~=1.7.1 (#2268) Updates the requirements on [mypy](https://github.com/python/mypy) to permit the latest version. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.5.1...v1.7.1) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 1831a6fd24..525873d774 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -3,7 +3,7 @@ pylint~=2.17.5 pytest~=7.4.3 pytest-asyncio~=0.21.1 # pytest-order~=1.0.1 -mypy~=1.5.1 +mypy~=1.7.1 coverage~=7.3 pre-commit==3.5.0 codespell==2.2.6 From cbcf3ce99f17e242faa447d4e73bddf712e327e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 26 Nov 2023 09:06:22 -0600 Subject: [PATCH 25/26] chore(deps): update aiohttp requirement from <3.9.0,>=3.6.0 to >=3.6.0,<3.10.0 (#2266) chore(deps): update aiohttp requirement Updates the requirements on [aiohttp](https://github.com/aio-libs/aiohttp) to permit the latest version. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/aiohttp/compare/v3.6.0...v3.9.0) --- updated-dependencies: - dependency-name: aiohttp dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/_.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/_.txt b/requirements/_.txt index 26e696d0f2..2488d446e6 100644 --- a/requirements/_.txt +++ b/requirements/_.txt @@ -1,2 +1,2 @@ -aiohttp>=3.6.0,<3.9.0 +aiohttp>=3.6.0,<3.10.0 typing_extensions>=4,<5; python_version < "3.11" From f6ac77805beac9a6e162478247016f6f0eb32878 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 26 Nov 2023 15:19:55 +0000 Subject: [PATCH 26/26] chore(deps): bump sphinxext-opengraph from 0.8.2 to 0.9.0 (#2250) Bumps [sphinxext-opengraph](https://github.com/wpilibsuite/sphinxext-opengraph) from 0.8.2 to 0.9.0. - [Release notes](https://github.com/wpilibsuite/sphinxext-opengraph/releases) - [Commits](https://github.com/wpilibsuite/sphinxext-opengraph/compare/v0.8.2...v0.9.0) --- updated-dependencies: - dependency-name: sphinxext-opengraph dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/docs.txt b/requirements/docs.txt index 453c4fcf7b..2c8cb6ede3 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -2,7 +2,7 @@ sphinx==5.3.0 sphinxcontrib_trio==1.1.2 sphinxcontrib-websupport==1.2.4 myst-parser==1.0.0 -sphinxext-opengraph==0.8.2 +sphinxext-opengraph==0.9.0 sphinx-copybutton==0.5.2 furo@ git+https://github.com/pradyunsg/furo@193643f sphinx-autodoc-typehints==1.23.0