Closed V3ntus closed 2 years ago
You don't need both a Client and a Bot. Bot is a subclass of Client.
You haven't logged in...
- You don't need both a Client and a Bot. Bot is a subclass of Client.
There's a reason I was testing it this way. I'm trying to use the method connected_accounts
on the User
object, yet it was either returning None or module has no attribute
but I realize my error now. Looking at the API doc, I should be using fetch_user_profile
which returns type Profile
instead of User
.
But from your response, I altered my code and it's working as desired:
client = commands.Bot(...)
profileobj = await client.fetch_user_profile(member.id)
print(profileobj.connected_accounts) # returns desired output
- You haven't logged in...
I was/am, I just omitted it from my code by mistake
Thank you nonetheless. Facepalm on my part
Ah, that makes more sense. We've all been there lol.
Summary
When running "fetch_user", I get an AttributeError exception
Reproduction Steps
client
as aselfcord.ext.commands.Bot()
selfcordClient
asselfcord.Client()
selfcordClient.fetch_user(id)
AttributeError
exception thrownCode
Expected Results
fetch_user
returns adiscord.User
objectActual Results
System Information
❯ python -m discord -v
Checklist
Additional Information
No response