@@ -440,15 +440,20 @@ async def fetch_clips(self, ids: List[str]):
440440 data = await self ._http .get_clips (ids = ids )
441441 return [models .Clip (self ._http , d ) for d in data ]
442442
443- async def fetch_channel (self , broadcaster : str ):
443+ async def fetch_channel (self , broadcaster : str , token : Optional [ str ] = None ):
444444 """|coro|
445445
446446 Retrieve channel information from the API.
447447
448+ .. note::
449+ This will be deprecated in 3.0. It's recommended to use :func:`~fetch_channels` instead.
450+
448451 Parameters
449452 -----------
450453 broadcaster: str
451454 The channel name or ID to request from API. Returns empty dict if no channel was found.
455+ token: Optional[:class:`str`]
456+ An optional OAuth token to use instead of the bot OAuth token.
452457
453458 Returns
454459 --------
@@ -459,9 +464,9 @@ async def fetch_channel(self, broadcaster: str):
459464 get_id = await self .fetch_users (names = [broadcaster .lower ()])
460465 if not get_id :
461466 raise IndexError ("Invalid channel name." )
462- broadcaster = get_id [0 ].id
467+ broadcaster = str ( get_id [0 ].id )
463468 try :
464- data = await self ._http .get_channels (broadcaster )
469+ data = await self ._http .get_channels (broadcaster_id = broadcaster , token = token )
465470
466471 from .models import ChannelInfo
467472
@@ -470,6 +475,28 @@ async def fetch_channel(self, broadcaster: str):
470475 except HTTPException :
471476 raise HTTPException ("Incorrect channel ID." )
472477
478+ async def fetch_channels (self , broadcaster_ids : List [int ], token : Optional [str ] = None ):
479+ """|coro|
480+
481+ Retrieve information for up to 100 channels from the API.
482+
483+ Parameters
484+ -----------
485+ broadcaster_ids: List[:class:`int`]
486+ The channel ids to request from API.
487+ token: Optional[:class:`str`]
488+ An optional OAuth token to use instead of the bot OAuth token
489+
490+ Returns
491+ --------
492+ List[:class:`twitchio.ChannelInfo`]
493+ """
494+ from .models import ChannelInfo
495+
496+ data = await self ._http .get_channels_new (broadcaster_ids = broadcaster_ids , token = token )
497+ return [ChannelInfo (self ._http , data = d ) for d in data ]
498+
499+
473500 async def fetch_videos (
474501 self ,
475502 ids : List [int ] = None ,
0 commit comments