@@ -238,6 +238,31 @@ def __init__(self, client: EventSubClient, data: dict):
238238 self .is_gift : bool = data ["is_gift" ]
239239
240240
241+ class ChannelSubscriptionEndData (EventData ):
242+ """
243+ A Subscription End event
244+
245+ Attributes
246+ -----------
247+ user: :class:`twitchio.PartialUser`
248+ The user who subscribed
249+ broadcaster: :class:`twitchio.PartialUser`
250+ The channel that was subscribed to
251+ tier: :class:`int`
252+ The tier of the subscription
253+ is_gift: :class:`bool`
254+ Whether the subscription was a gift or not
255+ """
256+
257+ __slots__ = "user" , "broadcaster" , "tier" , "is_gift"
258+
259+ def __init__ (self , client : EventSubClient , data : dict ):
260+ self .user = _transform_user (client , data , "user" )
261+ self .broadcaster = _transform_user (client , data , "broadcaster_user" )
262+ self .tier = int (data ["tier" ])
263+ self .is_gift : bool = data ["is_gift" ]
264+
265+
241266class ChannelSubscriptionGiftData (EventData ):
242267 """
243268 A Subscription Gift event
@@ -1141,6 +1166,25 @@ def __init__(self, client: EventSubClient, data: dict):
11411166 self .broadcaster = _transform_user (client , data , "broadcaster_user" )
11421167
11431168
1169+ class UserAuthorizationGrantedData (EventData ):
1170+ """
1171+ An Authorization Granted event
1172+
1173+ Attributes
1174+ -----------
1175+ user: :class:`twitchio.PartialUser`
1176+ The user that has granted authorization for your app
1177+ client_id: :class:`str`
1178+ The client id of the app that had its authorization granted
1179+ """
1180+
1181+ __slots__ = "client_id" , "user"
1182+
1183+ def __init__ (self , client : EventSubClient , data : dict ):
1184+ self .user = _transform_user (client , data , "user" )
1185+ self .client_id : str = data ["client_id" ]
1186+
1187+
11441188class UserAuthorizationRevokedData (EventData ):
11451189 """
11461190 An Authorization Revokation event
@@ -1270,6 +1314,7 @@ def __init__(self, client: EventSubClient, data: dict):
12701314 ChannelBanData ,
12711315 ChannelUnbanData ,
12721316 ChannelSubscribeData ,
1317+ ChannelSubscriptionEndData ,
12731318 ChannelSubscriptionGiftData ,
12741319 ChannelSubscriptionMessageData ,
12751320 ChannelCheerData ,
@@ -1290,6 +1335,7 @@ def __init__(self, client: EventSubClient, data: dict):
12901335 PredictionEndData ,
12911336 StreamOnlineData ,
12921337 StreamOfflineData ,
1338+ UserAuthorizationGrantedData ,
12931339 UserAuthorizationRevokedData ,
12941340 UserUpdateData ,
12951341]
@@ -1308,6 +1354,7 @@ class _SubscriptionTypes(metaclass=_SubTypesMeta):
13081354
13091355 follow = "channel.follow" , 1 , ChannelFollowData
13101356 subscription = "channel.subscribe" , 1 , ChannelSubscribeData
1357+ subscription_end = "channel.subscription.end" , 1 , ChannelSubscriptionEndData
13111358 subscription_gift = "channel.subscription.gift" , 1 , ChannelSubscriptionGiftData
13121359 subscription_message = "channel.subscription.message" , 1 , ChannelSubscriptionMessageData
13131360 cheer = "channel.cheer" , 1 , ChannelCheerData
@@ -1352,6 +1399,7 @@ class _SubscriptionTypes(metaclass=_SubTypesMeta):
13521399 stream_start = "stream.online" , 1 , StreamOnlineData
13531400 stream_end = "stream.offline" , 1 , StreamOfflineData
13541401
1402+ user_authorization_grant = "user.authorization.grant" , 1 , UserAuthorizationGrantedData
13551403 user_authorization_revoke = "user.authorization.revoke" , 1 , UserAuthorizationRevokedData
13561404
13571405 user_update = "user.update" , 1 , UserUpdateData
0 commit comments