@@ -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
@@ -1145,6 +1170,25 @@ def __init__(self, client: EventSubClient, data: dict):
11451170 self .broadcaster = _transform_user (client , data , "broadcaster_user" )
11461171
11471172
1173+ class UserAuthorizationGrantedData (EventData ):
1174+ """
1175+ An Authorization Granted event
1176+
1177+ Attributes
1178+ -----------
1179+ user: :class:`twitchio.PartialUser`
1180+ The user that has granted authorization for your app
1181+ client_id: :class:`str`
1182+ The client id of the app that had its authorization granted
1183+ """
1184+
1185+ __slots__ = "client_id" , "user"
1186+
1187+ def __init__ (self , client : EventSubClient , data : dict ):
1188+ self .user = _transform_user (client , data , "user" )
1189+ self .client_id : str = data ["client_id" ]
1190+
1191+
11481192class UserAuthorizationRevokedData (EventData ):
11491193 """
11501194 An Authorization Revokation event
@@ -1274,6 +1318,7 @@ def __init__(self, client: EventSubClient, data: dict):
12741318 ChannelBanData ,
12751319 ChannelUnbanData ,
12761320 ChannelSubscribeData ,
1321+ ChannelSubscriptionEndData ,
12771322 ChannelSubscriptionGiftData ,
12781323 ChannelSubscriptionMessageData ,
12791324 ChannelCheerData ,
@@ -1294,6 +1339,7 @@ def __init__(self, client: EventSubClient, data: dict):
12941339 PredictionEndData ,
12951340 StreamOnlineData ,
12961341 StreamOfflineData ,
1342+ UserAuthorizationGrantedData ,
12971343 UserAuthorizationRevokedData ,
12981344 UserUpdateData ,
12991345]
@@ -1312,6 +1358,7 @@ class _SubscriptionTypes(metaclass=_SubTypesMeta):
13121358
13131359 follow = "channel.follow" , 1 , ChannelFollowData
13141360 subscription = "channel.subscribe" , 1 , ChannelSubscribeData
1361+ subscription_end = "channel.subscription.end" , 1 , ChannelSubscriptionEndData
13151362 subscription_gift = "channel.subscription.gift" , 1 , ChannelSubscriptionGiftData
13161363 subscription_message = "channel.subscription.message" , 1 , ChannelSubscriptionMessageData
13171364 cheer = "channel.cheer" , 1 , ChannelCheerData
@@ -1356,6 +1403,7 @@ class _SubscriptionTypes(metaclass=_SubTypesMeta):
13561403 stream_start = "stream.online" , 1 , StreamOnlineData
13571404 stream_end = "stream.offline" , 1 , StreamOfflineData
13581405
1406+ user_authorization_grant = "user.authorization.grant" , 1 , UserAuthorizationGrantedData
13591407 user_authorization_revoke = "user.authorization.revoke" , 1 , UserAuthorizationRevokedData
13601408
13611409 user_update = "user.update" , 1 , UserUpdateData
0 commit comments