2424
2525from __future__ import annotations
2626
27- from typing import TYPE_CHECKING
27+ from typing import TYPE_CHECKING , Literal
2828
2929from twitchio .types_ .responses import (
3030 CheckUserSubscriptionResponseData ,
@@ -53,7 +53,7 @@ class UserSubscription:
5353 The broadcaster being subscribed to.
5454 gift: bool
5555 A Boolean value that determines whether the subscription is a gift subscription. Is ``True`` if the subscription was gifted.
56- tier: int
56+ tier: typing.Literal["1000", "2000", "3000"]
5757 The type of subscription. Possible values are:
5858
5959 - 1000: Tier 1
@@ -78,7 +78,7 @@ def __init__(
7878 data ["broadcaster_id" ], data ["broadcaster_login" ], data ["broadcaster_name" ], http = http
7979 )
8080 self .gift : bool = bool (data ["is_gift" ])
81- self .tier : int = int ( data ["tier" ])
81+ self .tier : Literal [ "1000" , "2000" , "3000" ] = data ["tier" ]
8282 _gifter_id , _gifter_login , _gifter_display_name = (
8383 data .get ("gifter_id" ),
8484 data .get ("gifter_login" ),
@@ -96,7 +96,7 @@ def __repr__(self) -> str:
9696 @property
9797 def rounded_tier (self ) -> int :
9898 """Returns the tier as a single digit. e.g. Tier 1000 = 1."""
99- return round (self .tier / 1000 )
99+ return round (int ( self .tier ) / 1000 )
100100
101101
102102class BroadcasterSubscription (UserSubscription ):
@@ -108,7 +108,7 @@ class BroadcasterSubscription(UserSubscription):
108108 The broadcaster being subscribed to.
109109 gift: bool
110110 A Boolean value that determines whether the subscription is a gift subscription. Is ``True`` if the subscription was gifted.
111- tier: int
111+ tier: typing.Literal["1000", "2000", "3000"]
112112 The type of subscription. Possible values are:
113113
114114 - 1000: Tier 1
0 commit comments