Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/getting-started/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Changelog
- Fix some typing issues with adapters in :class:`~twitchio.Client`.
- Fixed a bug causing conduit websockets to be treated as eventsub websockets and fail after a reconnect attempt.
- Fixed incorrect documentation in :func:`~twitchio.PartialUser.fetch_moderators`.
- Fix :class:`~models.eventsub_.BaseHypeTrain` now returns empty list for shared_train_participants if not shared_train.


3.1.0
Expand Down
12 changes: 8 additions & 4 deletions twitchio/models/eventsub_.py
Original file line number Diff line number Diff line change
Expand Up @@ -4957,11 +4957,15 @@ def __init__(self, payload: BaseHypeTrainEvent, *, http: HTTPClient) -> None:
HypeTrainContribution(c, http=http) for c in payload["top_contributions"]
]
self.started_at: datetime.datetime = parse_timestamp(payload["started_at"])
self.shared_train_participants: list[PartialUser] = [
PartialUser(u["broadcaster_user_id"], u["broadcaster_user_login"], u["broadcaster_user_name"], http=http)
for u in payload["shared_train_participants"]
]
self.shared_train: bool = bool(payload["is_shared_train"])
self.shared_train_participants: list[PartialUser] = (
[
PartialUser(u["broadcaster_user_id"], u["broadcaster_user_login"], u["broadcaster_user_name"], http=http)
for u in payload["shared_train_participants"]
]
if self.shared_train
else []
)
self.type: Literal["treasure", "golden_kappa", "regular"] = payload["type"]

def __repr__(self) -> str:
Expand Down