Skip to content

Commit

Permalink
Correct return type of Context.get_user()
Browse files Browse the repository at this point in the history
Correct return type of Context.get_user() to PartialChatter / Chatter
  • Loading branch information
chillymosh committed Apr 22, 2024
1 parent 8a2a839 commit c9921fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
:orphan:

2.9.3
=======
- ext.commands
- Bug fixes
- Fixed return type of :func:`~twitchio.ext.commands.Context.get_user` to PartialChatter / Chatter from PartialUser / User.

2.9.2
=======
- TwitchIO
- Changes:
- :func:`PartialUser.fetch_moderated_channels <twitchio.PartialUser.fetch_moderated_channels>` returns "broadcaster_login" api field instead of "broadcaster_name"
- :func:`~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
- fix: :func:`~twitchio.PartialUser.fetch_moderated_channels` used ``user_`` prefix from payload, now uses ``broadcaster_`` instead


2.9.1
Expand Down
6 changes: 3 additions & 3 deletions twitchio/ext/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ def users(self) -> Optional[Set[Chatter]]: # Alias to chatters
"""Alias to chatters."""
return self.chatters

def get_user(self, name: str) -> Optional[Union[PartialUser, User]]:
def get_user(self, name: str) -> Optional[Union[PartialChatter, Chatter]]:
"""Retrieve a user from the channels user cache.
Parameters
Expand All @@ -585,8 +585,8 @@ def get_user(self, name: str) -> Optional[Union[PartialUser, User]]:
Returns
--------
Union[:class:`twitchio.user.User`, :class:`twitchio.user.PartialUser`]
Could be a :class:`twitchio.user.PartialUser` depending on how the user joined the channel.
Union[:class:`twitchio.Chatter`, :class:`twitchio.PartialChatter`]
Could be a :class:`twitchio.PartialChatter` depending on how the user joined the channel.
Returns None if no user was found.
"""
name = name.lower()
Expand Down

0 comments on commit c9921fc

Please sign in to comment.