PythonistaGuild / TwitchIO

An Async Bot/API wrapper for Twitch made in Python.
https://twitchio.dev
MIT License
785 stars 163 forks source link

command.Context get_user returns an object type of Chatter but says it returns User #447

Closed sernone closed 4 months ago

sernone commented 4 months ago

When executing a command and retrieving the command.Context object i noticed that the get_user function on the Context says it returns a User or PartialUser however it is returning a Chatter class.

image <class 'twitchio.chatter.Chatter'> 'Chatter' object has no attribute 'fetch_followers'

chillymosh commented 4 months ago

This is supposed to return a Chatter / PartialChatter and not PartialUser / User as it uses the IRC Chatter cache.

To fetch the actual User object from a Chatter you can do await Chatter.user()

I'll update the return types.

chillymosh commented 4 months ago

@sernone if you install from git / master branch, instead of pypi, this should be corrected now.

sernone commented 4 months ago

@chillymosh awesome thank you sir , that is what i ended up doing anyway i figured it was just a mistake in the return type

image