Skip to content

Commit 9176d47

Browse files
committed
Add vod_offset to Clip model
Add vod_offset to Clip model Update Clip.type docstring
1 parent 50d15d5 commit 9176d47

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

docs/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Master
55
- TwitchIO
66
- Additions
77
- Added :func:`twitchio.PartialUser.create_custom_reward` to allow custom reward creations
8-
- Add duration attribute to :class:`~twitchio.Clip`
8+
- Add ``duration`` and ``vod_offset`` attributes to :class:`~twitchio.Clip`
99
- Added repr for :class:`~twitchio.CustomReward`
1010
- Bug fixes
1111
- Added ``self.registered_callbacks = {}`` to :func:`~twitchio.Client.from_client_credentials`

twitchio/models.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ class Clip:
202202
The url of the clip thumbnail.
203203
duration: :class:`float`
204204
Duration of the Clip in seconds (up to 0.1 precision).
205+
vod_offset: Optional[:class:`int`]
206+
The zero-based offset, in seconds, to where the clip starts in the video (VOD) or stream.
207+
This can be None if the parent no longer exists
205208
"""
206209

207210
__slots__ = (
@@ -218,6 +221,7 @@ class Clip:
218221
"created_at",
219222
"thumbnail_url",
220223
"duration",
224+
"vod_offset",
221225
)
222226

223227
def __init__(self, http: "TwitchHTTP", data: dict):
@@ -234,6 +238,7 @@ def __init__(self, http: "TwitchHTTP", data: dict):
234238
self.created_at = parse_timestamp(data["created_at"])
235239
self.thumbnail_url: str = data["thumbnail_url"]
236240
self.duration: float = data["duration"]
241+
self.vod_offset: Optional[int] = data["vod_offset"]
237242

238243
def __repr__(self):
239244
return f"<Clip id={self.id} broadcaster={self.broadcaster} creator={self.creator}>"
@@ -1458,7 +1463,7 @@ class Goal:
14581463
User of the broadcaster.
14591464
type: :class:`str`
14601465
The type of goal.
1461-
Valid values: follower, subscription and new_subscription.
1466+
Valid values: follower, subscription, subscription_count, new_subscription and new_subscription_count.
14621467
description: :class:`str`
14631468
A description of the goal, if specified.
14641469
current_amount: :class:`int`

0 commit comments

Comments
 (0)