Skip to content

Commit 36ba89d

Browse files
fix: Allow renewal_sku_ids To Handle None (#2709)
* fix: Allow renewal_sku_ids To Handle None * chore: Changelog * 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>
1 parent 34e00c4 commit 36ba89d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ These changes are available on the `master` branch, but have not yet been releas
9393
([#2656](https://github.com/Pycord-Development/pycord/pull/2656))
9494
- Fixed `AttributeError` when trying to consume a consumable entitlement.
9595
([#2564](https://github.com/Pycord-Development/pycord/pull/2564))
96+
- Fixed `Subscription.renewal_sku_ids` not accepting `None` from discord payload.
97+
([#2709](https://github.com/Pycord-Development/pycord/pull/2709))
9698

9799
### Changed
98100

discord/monetization.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def __init__(self, *, state: ConnectionState, data: SubscriptionPayload) -> None
327327
self.user_id: int = int(data["user_id"])
328328
self.sku_ids: list[int] = list(map(int, data["sku_ids"]))
329329
self.entitlement_ids: list[int] = list(map(int, data["entitlement_ids"]))
330-
self.renewal_sku_ids: list[int] = list(map(int, data["renewal_sku_ids"]))
330+
self.renewal_sku_ids: list[int] = list(map(int, data["renewal_sku_ids"] or []))
331331
self.current_period_start: datetime = parse_time(data["current_period_start"])
332332
self.current_period_end: datetime = parse_time(data["current_period_end"])
333333
self.status: SubscriptionStatus = try_enum(SubscriptionStatus, data["status"])

0 commit comments

Comments
 (0)