Skip to content

Commit 2a09512

Browse files
committed
Add golden kappa to hype train events
1 parent 7d5b779 commit 2a09512

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

twitchio/models/eventsub_.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4140,14 +4140,7 @@ def __repr__(self) -> str:
41404140

41414141

41424142
class BaseHypeTrain(BaseEvent):
4143-
__slots__ = (
4144-
"broadcaster",
4145-
"id",
4146-
"level",
4147-
"total",
4148-
"top_contributions",
4149-
"started_at",
4150-
)
4143+
__slots__ = ("broadcaster", "id", "level", "total", "top_contributions", "started_at", "golden_kappa")
41514144

41524145
def __init__(
41534146
self, payload: HypeTrainBeginEvent | HypeTrainProgressEvent | HypeTrainEndEvent, *, http: HTTPClient
@@ -4162,6 +4155,7 @@ def __init__(
41624155
HypeTrainContribution(c, http=http) for c in payload["top_contributions"]
41634156
]
41644157
self.started_at: datetime.datetime = parse_timestamp(payload["started_at"])
4158+
self.golden_kappa: bool = bool(payload["is_golden_kappa_train"])
41654159

41664160
def __repr__(self) -> str:
41674161
return f"<BaseHypeTrain id={self.id} broadcaster={self.broadcaster} started_at={self.started_at}>"
@@ -4193,6 +4187,8 @@ class HypeTrainBegin(BaseHypeTrain):
41934187
The datetime of when the hype train started.
41944188
expires_at: datetime.datetime
41954189
The datetime when the hype train expires. The expiration is extended when the hype train reaches a new level.
4190+
golden_kappa: bool
4191+
Indicates if the hype train is a Golden Kappa Train.
41964192
"""
41974193

41984194
subscription_type = "channel.hype_train.begin"
@@ -4241,6 +4237,8 @@ class HypeTrainProgress(BaseHypeTrain):
42414237
The datetime of when the hype train started.
42424238
expires_at: datetime.datetime
42434239
The datetime when the hype train expires. The expiration is extended when the hype train reaches a new level.
4240+
golden_kappa: bool
4241+
Indicates if the hype train is a Golden Kappa Train.
42444242
"""
42454243

42464244
subscription_type = "channel.hype_train.progress"
@@ -4285,6 +4283,8 @@ class HypeTrainEnd(BaseHypeTrain):
42854283
The datetime of when the hype train ended.
42864284
cooldown_until: datetime.datetime
42874285
The datetime when the hype train cooldown ends so that the next hype train can start.
4286+
golden_kappa: bool
4287+
Indicates if the hype train is a Golden Kappa Train.
42884288
"""
42894289

42904290
subscription_type = "channel.hype_train.end"

twitchio/types_/eventsub.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,7 @@ class HypeTrainBeginEvent(BaseBroadcasterEvent):
11761176
level: int
11771177
started_at: str
11781178
expires_at: str
1179+
is_golden_kappa_train: bool
11791180

11801181

11811182
class HypeTrainProgressEvent(BaseBroadcasterEvent):
@@ -1188,6 +1189,7 @@ class HypeTrainProgressEvent(BaseBroadcasterEvent):
11881189
level: int
11891190
started_at: str
11901191
expires_at: str
1192+
is_golden_kappa_train: bool
11911193

11921194

11931195
class HypeTrainEndEvent(BaseBroadcasterEvent):
@@ -1198,6 +1200,7 @@ class HypeTrainEndEvent(BaseBroadcasterEvent):
11981200
started_at: str
11991201
ended_at: str
12001202
cooldown_ends_at: str
1203+
is_golden_kappa_train: bool
12011204

12021205

12031206
class ShieldModeBeginEvent(BroadcasterModeratorEvent):

0 commit comments

Comments
 (0)