Skip to content

Commit 8a2a839

Browse files
Fix dictionary keys used in PartialUser.fetch_moderated_channels() (#443)
* refactor eventsubws subscription error handling to not error on reconnect * potential fix for bug with headers not getting set after token updates * Revert "refactor eventsubws subscription error handling to not error on reconnect" This reverts commit bdb21b0. * formatting * changelog entry for both prs * add more changelogs * refactor eventsubws subscription error handling to not error on reconnect (#439) * refactor eventsubws subscription error handling to not error on reconnect * Why do we still support 3.7 * formatting * Add new API routes (#441) * Add new API routes * add docs * Add user emote endpoint * work around bad frame disconnect * run black * Fix dictionary keys used in PartialUser.fetch_moderated_channels() - use "broadcaster_" prefix to match the data returned by the API * actually restart on bad frame * Update changelog.rst * * change "broadcaster_name" to "broadcaster_login" in PartialUser.fetch_moderated_channels * update changelog * commit suggestions * commit suggestions * Apply suggestions from code review --------- Co-authored-by: IAmTomahawkx <[email protected]>
1 parent cac4353 commit 8a2a839

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

docs/changelog.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
:orphan:
22

3+
2.9.2
4+
=======
5+
- TwitchIO
6+
- Changes:
7+
- :func:`PartialUser.fetch_moderated_channels <twitchio.PartialUser.fetch_moderated_channels>` returns "broadcaster_login" api field instead of "broadcaster_name"
8+
9+
- Bug fixes
10+
- fix: :func:`PartialUser.fetch_moderated_channels <twitchio.PartialUser.fetch_moderated_channels>` used "user_" prefix from payload, now uses "broadcaster_" instead
11+
12+
313
2.9.1
414
=======
515
- ext.eventsub

twitchio/user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ async def fetch_moderated_channels(self, token: str) -> List[PartialUser]:
462462
List[:class:`twitchio.PartialUser`]
463463
"""
464464
data = await self._http.get_moderated_channels(token, str(self.id))
465-
return [PartialUser(self._http, d["user_id"], d["user_name"]) for d in data]
465+
return [PartialUser(self._http, d["broadcaster_id"], d["broadcaster_login"]) for d in data]
466466

467467
async def fetch_moderators(self, token: str, userids: List[int] = None):
468468
"""|coro|

0 commit comments

Comments
 (0)