@@ -91,7 +91,11 @@ def __init__(
9191
9292 @classmethod
9393 def from_client_credentials (
94- cls , client_id : str , client_secret : str , * , loop : asyncio .AbstractEventLoop = None
94+ cls ,
95+ client_id : str ,
96+ client_secret : str ,
97+ * ,
98+ loop : asyncio .AbstractEventLoop = None ,
9599 ) -> "Client" :
96100 """
97101 creates a client application token from your client credentials.
@@ -121,7 +125,7 @@ def from_client_credentials(
121125 self .loop = loop or asyncio .get_event_loop ()
122126 self ._http = TwitchHTTP (self , client_id = client_id , client_secret = client_secret )
123127 self ._connection = WSConnection (
124- client = self , loop = self .loop , initial_channels = None , heartbeat = self . _heartbeat
128+ client = self , loop = self .loop , initial_channels = None
125129 ) # The only reason we're even creating this is to avoid attribute errors
126130 self ._events = {}
127131 self ._waiting = []
@@ -480,6 +484,46 @@ async def fetch_tags(self, ids: List[str] = None):
480484 data = await self ._http .get_stream_tags (ids )
481485 return [models .Tag (x ) for x in data ]
482486
487+ async def fetch_streams (
488+ self ,
489+ user_ids : List [int ] = None ,
490+ game_ids : List [int ] = None ,
491+ user_logins : List [str ] = None ,
492+ languages : List [str ] = None ,
493+ token : str = None ,
494+ ):
495+ """|coro|
496+ Fetches live streams from the helix API
497+
498+ Parameters
499+ -----------
500+ user_ids: Optional[List[:class:`int`]]
501+ user ids of people whose streams to fetch
502+ game_ids: Optional[List[:class:`int`]]
503+ game ids of streams to fetch
504+ user_logins: Optional[List[:class:`str`]]
505+ user login names of people whose streams to fetch
506+ languages: Optional[List:class:`str]]
507+ language for the stream(s). ISO 639-1 or two letter code for supported stream language
508+ token: Optional[:class:`str`]
509+ An optional OAuth token to use instead of the bot OAuth token
510+
511+ Returns
512+ --------
513+ List[:class:`twitchio.Stream`]
514+ """
515+ from .models import Stream
516+
517+ assert user_ids or game_ids or user_logins
518+ data = await self ._http .get_streams (
519+ game_ids = game_ids ,
520+ user_ids = user_ids ,
521+ user_logins = user_logins ,
522+ languages = languages ,
523+ token = token ,
524+ )
525+ return [Stream (self ._http , x ) for x in data ]
526+
483527 async def search_categories (self , query : str ):
484528 """|coro|
485529 Searches twitches categories
0 commit comments