Skip to content

Commit ff2ad34

Browse files
authored
Add support for multiple subscription tier SKUs
1 parent 743ef27 commit ff2ad34

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

discord/subscription.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ class Subscription(Hashable):
6363
canceled_at: Optional[:class:`datetime.datetime`]
6464
When the subscription was canceled.
6565
This is only available for subscriptions with a :attr:`status` of :attr:`SubscriptionStatus.inactive`.
66+
renewal_sku_ids: List[:class:`int`]
67+
The IDs of the SKUs that the user is going to be subscribed to when renewing.
6668
"""
6769

6870
__slots__ = (
@@ -75,6 +77,7 @@ class Subscription(Hashable):
7577
'current_period_end',
7678
'status',
7779
'canceled_at',
80+
'renewal_sku_ids',
7881
)
7982

8083
def __init__(self, *, state: ConnectionState, data: SubscriptionPayload):
@@ -88,6 +91,7 @@ def __init__(self, *, state: ConnectionState, data: SubscriptionPayload):
8891
self.current_period_end: datetime.datetime = utils.parse_time(data['current_period_end'])
8992
self.status: SubscriptionStatus = try_enum(SubscriptionStatus, data['status'])
9093
self.canceled_at: Optional[datetime.datetime] = utils.parse_time(data['canceled_at'])
94+
self.renewal_sku_ids: List[int] = list(map(int, data['renewal_sku_ids'] or []))
9195

9296
def __repr__(self) -> str:
9397
return f'<Subscription id={self.id} user_id={self.user_id} status={self.status!r}>'

discord/types/subscription.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ class Subscription(TypedDict):
4040
current_period_end: str
4141
status: SubscriptionStatus
4242
canceled_at: Optional[str]
43+
renewal_sku_ids: Optional[List[Snowflake]]

0 commit comments

Comments
 (0)