From d7d3afb433a7b1bb8e3e51b3f447b01b33a85360 Mon Sep 17 00:00:00 2001 From: lukenamop Date: Fri, 4 Oct 2024 15:42:50 -0500 Subject: [PATCH] fix: Send correct data to http.create_test_entitlement() (#2595) * Update guild.py Signed-off-by: lukenamop * Update user.py Signed-off-by: lukenamop * style(pre-commit): auto fixes from pre-commit.com hooks * Update CHANGELOG.md Signed-off-by: lukenamop * Update CHANGELOG.md Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Signed-off-by: lukenamop * Update CHANGELOG.md Signed-off-by: lukenamop * Update CHANGELOG.md Signed-off-by: plun1331 * style(pre-commit): auto fixes from pre-commit.com hooks --------- Signed-off-by: lukenamop Signed-off-by: plun1331 Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Co-authored-by: plun1331 --- CHANGELOG.md | 3 +++ discord/guild.py | 4 +++- discord/user.py | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dba975bd37..fb35d97cce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,9 @@ These changes are available on the `master` branch, but have not yet been releas ([#2584](https://github.com/Pycord-Development/pycord/pull/2584)) - Fixed the `is_owner()` `user` type hint: `User` -> `User | Member`. ([#2593](https://github.com/Pycord-Development/pycord/pull/2593)) +- Fixed `Guild.create_test_entitlement()` and `User.create_test_entitlement()` using the + guild/user ID instead of the application ID. + ([#2595](https://github.com/Pycord-Development/pycord/pull/2595)) ### Changed diff --git a/discord/guild.py b/discord/guild.py index 75fcc7c5c7..881e8f1307 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -4089,7 +4089,9 @@ async def create_test_entitlement(self, sku: Snowflake) -> Entitlement: "owner_id": self.id, "owner_type": EntitlementOwnerType.guild.value, } - data = await self._state.http.create_test_entitlement(self.id, payload) + data = await self._state.http.create_test_entitlement( + self._state.application_id, payload + ) return Entitlement(data=data, state=self._state) def entitlements( diff --git a/discord/user.py b/discord/user.py index d986a018f5..9fa995cf66 100644 --- a/discord/user.py +++ b/discord/user.py @@ -636,7 +636,9 @@ async def create_test_entitlement(self, sku: discord.abc.Snowflake) -> Entitleme "owner_id": self.id, "owner_type": 2, } - data = await self._state.http.create_test_entitlement(self.id, payload) + data = await self._state.http.create_test_entitlement( + self._state.application_id, payload + ) return Entitlement(data=data, state=self._state) def entitlements(