Skip to content

Commit 8d3524d

Browse files
committed
Merge branch 'main' into feature/conduits
2 parents 1aa32fd + 2aed308 commit 8d3524d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

twitchio/client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,15 @@ async def set_adapter(self, adapter: BaseAdapter) -> None:
194194
-------
195195
None
196196
"""
197-
if self._adapter:
197+
if self._adapter and self._adapter._running:
198198
await self._adapter.close(False)
199199

200200
self._adapter = adapter
201+
self._adapter.client = self
201202

202-
if self._setup_called:
203+
if self._setup_called and not self._adapter._running:
203204
await self._adapter.run()
204205

205-
self._adapter.client = self
206-
207206
@property
208207
def tokens(self) -> MappingProxyType[str, TokenMappingData]:
209208
"""Property which returns a read-only mapping of the tokens that are managed by the `Client`.

twitchio/user.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ async def fetch_followers(
580580
user: str | int | PartialUser | None = None,
581581
first: int = 20,
582582
max_results: int | None = None,
583+
token_for: str | PartialUser | None = None,
583584
) -> ChannelFollowers:
584585
"""|coro|
585586
@@ -600,6 +601,8 @@ async def fetch_followers(
600601
Min is 1 and Max is 100.
601602
max_results: int | None
602603
Maximum number of total results to return. When this is set to None (default), then everything found is returned.
604+
token_for: str | PartialUser | None
605+
An optional user token, for a moderator, to use instead of the User's token that this method is called on.
603606
604607
605608
Returns
@@ -610,7 +613,7 @@ async def fetch_followers(
610613

611614
return await self._http.get_channel_followers(
612615
broadcaster_id=self.id,
613-
token_for=self.id,
616+
token_for=token_for or self.id,
614617
user_id=user,
615618
first=first,
616619
max_results=max_results,

0 commit comments

Comments
 (0)