Skip to content

Commit

Permalink
fix: Send correct data to http.create_test_entitlement() (#2595)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
4 people authored Oct 4, 2024
1 parent f6b914e commit d7d3afb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion discord/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d7d3afb

Please sign in to comment.