Skip to content

Commit

Permalink
fix: Allow renewal_sku_ids To Handle None (#2709)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Icebluewolf and pre-commit-ci[bot] authored Feb 6, 2025
1 parent 34e00c4 commit 36ba89d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2656](https://github.com/Pycord-Development/pycord/pull/2656))
- Fixed `AttributeError` when trying to consume a consumable entitlement.
([#2564](https://github.com/Pycord-Development/pycord/pull/2564))
- Fixed `Subscription.renewal_sku_ids` not accepting `None` from discord payload.
([#2709](https://github.com/Pycord-Development/pycord/pull/2709))

### Changed

Expand Down
2 changes: 1 addition & 1 deletion discord/monetization.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def __init__(self, *, state: ConnectionState, data: SubscriptionPayload) -> None
self.user_id: int = int(data["user_id"])
self.sku_ids: list[int] = list(map(int, data["sku_ids"]))
self.entitlement_ids: list[int] = list(map(int, data["entitlement_ids"]))
self.renewal_sku_ids: list[int] = list(map(int, data["renewal_sku_ids"]))
self.renewal_sku_ids: list[int] = list(map(int, data["renewal_sku_ids"] or []))
self.current_period_start: datetime = parse_time(data["current_period_start"])
self.current_period_end: datetime = parse_time(data["current_period_end"])
self.status: SubscriptionStatus = try_enum(SubscriptionStatus, data["status"])
Expand Down

0 comments on commit 36ba89d

Please sign in to comment.