@@ -1544,6 +1544,53 @@ def __init__(self, client: EventSubClient, data: dict):
15441544 self .viewer_count : int = data ["viewer_count" ]
15451545
15461546
1547+ class ChannelCharityDonationData (EventData ):
1548+ """
1549+ Represents a donation towards a charity campaign.
1550+
1551+ Requires the ``channel:read:charity`` scope.
1552+
1553+ Attributes
1554+ -----------
1555+ id: :class:`str`
1556+ The ID of the event.
1557+ campaign_id: :class:`str`
1558+ The ID of the running charity campaign.
1559+ broadcaster: :class:`~twitchio.PartialUser`
1560+ The broadcaster running the campaign.
1561+ user: :class:`~twitchio.PartialUser`
1562+ The user who donated.
1563+ charity_name: :class:`str`
1564+ The name of the charity.
1565+ charity_description: :class:`str`
1566+ The description of the charity.
1567+ charity_logo: :class:`str`
1568+ The logo of the charity.
1569+ charity_website: :class:`str`
1570+ The websiet of the charity.
1571+ donation_value: :class:`int`
1572+ The amount of money being donated.
1573+ donation_decimal_places: :class:`int`
1574+ The decimal places to put into the :attr`~.donation_amount`.
1575+ donation_currency: :class:`str`
1576+ The currency that was donated (ex. ``USD``, ``GBP``, ``EUR``)
1577+ """
1578+
1579+ __slots__ = ("id" , "campaign_id" , "broadcaster" , "user" , "charity_name" , "charity_description" , "charity_logo" , "charity_website" , "donation_value" , "donation_decimal_places" , "donation_currency" )
1580+
1581+ def __init__ (self , client : EventSubClient , data : dict ):
1582+ self .id : str = data ["id" ]
1583+ self .campaign_id : str = data ["campaign_id" ]
1584+ self .broadcaster : PartialUser = _transform_user (client , data , "broadcaster" )
1585+ self .user : PartialUser = _transform_user (client , data , "user" )
1586+ self .charity_name : str = data ["charity_name" ]
1587+ self .charity_description : str = data ["charity_description" ]
1588+ self .charity_logo : str = data ["charity_logo" ]
1589+ self .charity_website : str = data ["charity_website" ]
1590+ self .donation_value : int = data ["amount" ]["value" ]
1591+ self .donation_currency : str = data ["amount" ]["currency" ]
1592+ self .donation_decimal_places : int = data ["amount" ]["decimal_places" ]
1593+
15471594_DataType = Union [
15481595 ChannelBanData ,
15491596 ChannelUnbanData ,
@@ -1576,6 +1623,7 @@ def __init__(self, client: EventSubClient, data: dict):
15761623 ChannelShieldModeEndData ,
15771624 ChannelShoutoutCreateData ,
15781625 ChannelShoutoutReceiveData ,
1626+ ChannelCharityDonationData
15791627]
15801628
15811629
@@ -1628,6 +1676,8 @@ class _SubscriptionTypes(metaclass=_SubTypesMeta):
16281676 channel_shoutout_create = "channel.shoutout.create" , 1 , ChannelShoutoutCreateData
16291677 channel_shoutout_receive = "channel.shoutout.receive" , 1 , ChannelShoutoutReceiveData
16301678
1679+ channel_charity_donate = "channel.charity_campaign.donate" , 1 , ChannelCharityDonationData
1680+
16311681 hypetrain_begin = "channel.hype_train.begin" , 1 , HypeTrainBeginProgressData
16321682 hypetrain_progress = "channel.hype_train.progress" , 1 , HypeTrainBeginProgressData
16331683 hypetrain_end = "channel.hype_train.end" , 1 , HypeTrainEndData
0 commit comments