@@ -4818,11 +4818,19 @@ def __repr__(self) -> str:
48184818
48194819
48204820class BaseHypeTrain (BaseEvent ):
4821- __slots__ = ("broadcaster" , "golden_kappa" , "id" , "level" , "started_at" , "top_contributions" , "total" )
4821+ __slots__ = (
4822+ "broadcaster" ,
4823+ "id" ,
4824+ "level" ,
4825+ "shared_train" ,
4826+ "shared_train_participants" ,
4827+ "started_at" ,
4828+ "top_contributions" ,
4829+ "total" ,
4830+ "type" ,
4831+ )
48224832
4823- def __init__ (
4824- self , payload : HypeTrainBeginEvent | HypeTrainProgressEvent | HypeTrainEndEvent , * , http : HTTPClient
4825- ) -> None :
4833+ def __init__ (self , payload : BaseHypeTrainEvent , * , http : HTTPClient ) -> None :
48264834 self .broadcaster : PartialUser = PartialUser (
48274835 payload ["broadcaster_user_id" ], payload ["broadcaster_user_login" ], payload ["broadcaster_user_name" ], http = http
48284836 )
@@ -4833,7 +4841,12 @@ def __init__(
48334841 HypeTrainContribution (c , http = http ) for c in payload ["top_contributions" ]
48344842 ]
48354843 self .started_at : datetime .datetime = parse_timestamp (payload ["started_at" ])
4836- self .golden_kappa : bool = bool (payload ["is_golden_kappa_train" ])
4844+ self .shared_train_participants : list [PartialUser ] = [
4845+ PartialUser (u ["broadcaster_user_id" ], u ["broadcaster_user_login" ], u ["broadcaster_user_name" ], http = http )
4846+ for u in payload ["shared_train_participants" ]
4847+ ]
4848+ self .shared_train : bool = bool (payload ["is_shared_train" ])
4849+ self .type : Literal ["treasure" , "golden_kappa" , "regular" ] = payload ["type" ]
48374850
48384851 def __repr__ (self ) -> str :
48394852 return f"<BaseHypeTrain id={ self .id } broadcaster={ self .broadcaster } started_at={ self .started_at } >"
@@ -4859,34 +4872,49 @@ class HypeTrainBegin(BaseHypeTrain):
48594872 The number of points required to reach the next level.
48604873 top_contributions: list[HypeTrainContribution]
48614874 The contributors with the most points contributed.
4862- last_contribution: HypeTrainContribution
4863- The most recent contribution.
4875+ all_time_high_level: int
4876+ The all-time high level this type of Hype Train has reached for this broadcaster.
4877+ all_time_high_total: int
4878+ The all-time high total this type of Hype Train has reached for this broadcaster.
4879+ shared_train: bool
4880+ Indicates if the Hype Train is shared.
4881+ When True, `shared_train_participants` will contain the list of broadcasters the train is shared with.
4882+ shared_train_participants: list[PartialUser]
4883+ List of broadcasters in the shared Hype Train.
4884+ type: typing.Literal["treasure", "golden_kappa", "regular"]
4885+ The type of the Hype Train. Possible values are:
4886+
4887+ - treasure
4888+ - golden_kappa
4889+ - regular
4890+
48644891 started_at: datetime.datetime
48654892 The datetime of when the hype train started.
48664893 expires_at: datetime.datetime
48674894 The datetime when the hype train expires. The expiration is extended when the hype train reaches a new level.
4868- golden_kappa: bool
4869- Indicates if the hype train is a Golden Kappa Train.
4895+
48704896 """
48714897
48724898 subscription_type = "channel.hype_train.begin"
48734899
48744900 __slots__ = (
4901+ "all_time_high_level" ,
4902+ "all_time_high_total" ,
48754903 "expires_at" ,
48764904 "goal" ,
4877- "last_contribution" ,
48784905 "progress" ,
48794906 )
48804907
48814908 def __init__ (self , payload : HypeTrainBeginEvent , * , http : HTTPClient ) -> None :
48824909 super ().__init__ (payload , http = http )
48834910 self .progress : int = int (payload ["progress" ])
48844911 self .goal : int = int (payload ["goal" ])
4885- self .last_contribution : HypeTrainContribution = HypeTrainContribution (payload ["last_contribution" ], http = http )
48864912 self .expires_at : datetime .datetime = parse_timestamp (payload ["expires_at" ])
4913+ self .all_time_high_level : int = int (payload ["all_time_high_level" ])
4914+ self .all_time_high_total : int = int (payload ["all_time_high_total" ])
48874915
48884916 def __repr__ (self ) -> str :
4889- return f"<HypeTrainBegin id={ self .id } broadcaster={ self .broadcaster } goal={ self .goal } started_at={ self .started_at } >"
4917+ return f"<HypeTrainBegin id={ self .id } broadcaster={ self .broadcaster } goal={ self .goal } started_at={ self .started_at } type= { self . type } >"
48904918
48914919
48924920class HypeTrainProgress (BaseHypeTrain ):
@@ -4909,34 +4937,40 @@ class HypeTrainProgress(BaseHypeTrain):
49094937 The number of points required to reach the next level.
49104938 top_contributions: list[HypeTrainContribution]
49114939 The contributors with the most points contributed.
4912- last_contribution: HypeTrainContribution
4913- The most recent contribution.
49144940 started_at: datetime.datetime
49154941 The datetime of when the hype train started.
49164942 expires_at: datetime.datetime
49174943 The datetime when the hype train expires. The expiration is extended when the hype train reaches a new level.
4918- golden_kappa: bool
4919- Indicates if the hype train is a Golden Kappa Train.
4944+ shared_train: bool
4945+ Indicates if the Hype Train is shared.
4946+ When True, `shared_train_participants` will contain the list of broadcasters the train is shared with.
4947+ shared_train_participants: list[PartialUser]
4948+ List of broadcasters in the shared Hype Train.
4949+ type: typing.Literal["treasure", "golden_kappa", "regular"]
4950+ The type of the Hype Train. Possible values are:
4951+
4952+ - treasure
4953+ - golden_kappa
4954+ - regular
4955+
49204956 """
49214957
49224958 subscription_type = "channel.hype_train.progress"
49234959
49244960 __slots__ = (
49254961 "expires_at" ,
49264962 "goal" ,
4927- "last_contribution" ,
49284963 "progress" ,
49294964 )
49304965
49314966 def __init__ (self , payload : HypeTrainProgressEvent , * , http : HTTPClient ) -> None :
49324967 super ().__init__ (payload , http = http )
49334968 self .progress : int = int (payload ["progress" ])
49344969 self .goal : int = int (payload ["goal" ])
4935- self .last_contribution : HypeTrainContribution = HypeTrainContribution (payload ["last_contribution" ], http = http )
49364970 self .expires_at : datetime .datetime = parse_timestamp (payload ["expires_at" ])
49374971
49384972 def __repr__ (self ) -> str :
4939- return f"<HypeTrainProgress id={ self .id } broadcaster={ self .broadcaster } goal={ self .goal } progress={ self .progress } >"
4973+ return f"<HypeTrainProgress id={ self .id } broadcaster={ self .broadcaster } goal={ self .goal } progress={ self .progress } type= { self . type } >"
49404974
49414975
49424976class HypeTrainEnd (BaseHypeTrain ):
@@ -4961,8 +4995,18 @@ class HypeTrainEnd(BaseHypeTrain):
49614995 The datetime of when the hype train ended.
49624996 cooldown_until: datetime.datetime
49634997 The datetime when the hype train cooldown ends so that the next hype train can start.
4964- golden_kappa: bool
4965- Indicates if the hype train is a Golden Kappa Train.
4998+ shared_train: bool
4999+ Indicates if the Hype Train is shared.
5000+ When True, `shared_train_participants` will contain the list of broadcasters the train is shared with.
5001+ shared_train_participants: list[PartialUser]
5002+ List of broadcasters in the shared Hype Train.
5003+ type: typing.Literal["treasure", "golden_kappa", "regular"]
5004+ The type of the Hype Train. Possible values are:
5005+
5006+ - treasure
5007+ - golden_kappa
5008+ - regular
5009+
49665010 """
49675011
49685012 subscription_type = "channel.hype_train.end"
@@ -4978,7 +5022,7 @@ def __init__(self, payload: HypeTrainEndEvent, *, http: HTTPClient) -> None:
49785022 self .cooldown_until : datetime .datetime = parse_timestamp (payload ["cooldown_ends_at" ])
49795023
49805024 def __repr__ (self ) -> str :
4981- return f"<HypeTrainEnd id={ self .id } broadcaster={ self .broadcaster } total={ self .total } ended_at={ self .ended_at } >"
5025+ return f"<HypeTrainEnd id={ self .id } broadcaster={ self .broadcaster } total={ self .total } ended_at={ self .ended_at } type= { self . type } >"
49825026
49835027
49845028class ShieldModeBegin (BaseEvent ):
0 commit comments