File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ Changelog
1111- twitchio
1212 - Additions
1313 - Added - :func: `~twitchio.PartialUser.fetch_hype_train_status `
14+ - Added - :func: `~twitchio.PartialUser.fetch_stream `
1415
1516
16173.1.0
Original file line number Diff line number Diff line change @@ -3477,6 +3477,16 @@ async def delete_custom_reward(
34773477 """
34783478 await self ._http .delete_custom_reward (broadcaster_id = self .id , reward_id = id , token_for = self .id )
34793479
3480+ async def fetch_stream (self ) -> Stream | None :
3481+ """|coro|
3482+
3483+ Fetches the current stream for this broadcaster / user. If the broadcaster is not streaming then it will return `None`.
3484+
3485+ Returns
3486+ -------
3487+ Stream | None
3488+ """
3489+ return await anext (self ._http .get_streams (user_ids = [self .id ], max_results = 1 ), None )
34803490
34813491class User (PartialUser ):
34823492 """Represents a User.
You can’t perform that action at this time.
0 commit comments