Skip to content

Commit

Permalink
Fix dictionary keys used in PartialUser.fetch_moderated_channels() (#443
Browse files Browse the repository at this point in the history
)

* 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 <iamtomahawkx@gmail.com>
  • Loading branch information
styles784 and IAmTomahawkx committed Mar 24, 2024
1 parent cac4353 commit 8a2a839
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
:orphan:

2.9.2
=======
- TwitchIO
- Changes:
- :func:`PartialUser.fetch_moderated_channels <twitchio.PartialUser.fetch_moderated_channels>` returns "broadcaster_login" api field instead of "broadcaster_name"

- Bug fixes
- fix: :func:`PartialUser.fetch_moderated_channels <twitchio.PartialUser.fetch_moderated_channels>` used "user_" prefix from payload, now uses "broadcaster_" instead


2.9.1
=======
- ext.eventsub
Expand Down
2 changes: 1 addition & 1 deletion twitchio/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ async def fetch_moderated_channels(self, token: str) -> List[PartialUser]:
List[:class:`twitchio.PartialUser`]
"""
data = await self._http.get_moderated_channels(token, str(self.id))
return [PartialUser(self._http, d["user_id"], d["user_name"]) for d in data]
return [PartialUser(self._http, d["broadcaster_id"], d["broadcaster_login"]) for d in data]

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

0 comments on commit 8a2a839

Please sign in to comment.