Skip to content

Commit d7d3afb

Browse files
lukenamoppre-commit-ci[bot]Dorukyumplun1331
authored
fix: Send correct data to http.create_test_entitlement() (#2595)
* Update guild.py Signed-off-by: lukenamop <[email protected]> * Update user.py Signed-off-by: lukenamop <[email protected]> * style(pre-commit): auto fixes from pre-commit.com hooks * Update CHANGELOG.md Signed-off-by: lukenamop <[email protected]> * Update CHANGELOG.md Co-authored-by: Dorukyum <[email protected]> Signed-off-by: lukenamop <[email protected]> * Update CHANGELOG.md Signed-off-by: lukenamop <[email protected]> * Update CHANGELOG.md Signed-off-by: plun1331 <[email protected]> * style(pre-commit): auto fixes from pre-commit.com hooks --------- Signed-off-by: lukenamop <[email protected]> Signed-off-by: plun1331 <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dorukyum <[email protected]> Co-authored-by: plun1331 <[email protected]>
1 parent f6b914e commit d7d3afb

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ These changes are available on the `master` branch, but have not yet been releas
3535
([#2584](https://github.com/Pycord-Development/pycord/pull/2584))
3636
- Fixed the `is_owner()` `user` type hint: `User` -> `User | Member`.
3737
([#2593](https://github.com/Pycord-Development/pycord/pull/2593))
38+
- Fixed `Guild.create_test_entitlement()` and `User.create_test_entitlement()` using the
39+
guild/user ID instead of the application ID.
40+
([#2595](https://github.com/Pycord-Development/pycord/pull/2595))
3841

3942
### Changed
4043

discord/guild.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4089,7 +4089,9 @@ async def create_test_entitlement(self, sku: Snowflake) -> Entitlement:
40894089
"owner_id": self.id,
40904090
"owner_type": EntitlementOwnerType.guild.value,
40914091
}
4092-
data = await self._state.http.create_test_entitlement(self.id, payload)
4092+
data = await self._state.http.create_test_entitlement(
4093+
self._state.application_id, payload
4094+
)
40934095
return Entitlement(data=data, state=self._state)
40944096

40954097
def entitlements(

discord/user.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,9 @@ async def create_test_entitlement(self, sku: discord.abc.Snowflake) -> Entitleme
636636
"owner_id": self.id,
637637
"owner_type": 2,
638638
}
639-
data = await self._state.http.create_test_entitlement(self.id, payload)
639+
data = await self._state.http.create_test_entitlement(
640+
self._state.application_id, payload
641+
)
640642
return Entitlement(data=data, state=self._state)
641643

642644
def entitlements(

0 commit comments

Comments
 (0)