Hello,
I tried to my best effort to set an avatar with the edit_profile function. But i am just unable to get things rolling... My current guess is that i don't call it in the right position.
My try is:
@client.event
async def on_message(message):
if message.content.startswith('!wat'):
fp = open('avatar_256.jpg', 'rb')
l = {
"avatar": fp.read()
}
await client.edit_profile(None, l)
The error i get is:
Traceback (most recent call last):
File "\client.py", line 267, in _run_event
yield from getattr(self, event)(_args, *_kwargs)
File "/bot.py", line 31, in on_message
await client.edit_profile(None, l)
TypeError: edit_profile() takes from 1 to 2 positional arguments but 3 were given
But i just don't understand why it says it was to many arguments. I set two, password and my list, which are required - and self was assigned automatically. This are exactly three arguments which are intended for this function.
I bet it's a plain stupid mistake. Any help is appreciated. :)
with open('some_image.jpg', 'rb') as f:
await client.edit_profile(avatar=f.read())
does the image has to be .png?
Please don't necro bump issues, no the image does not have to be a png.
You can also think about joining the discord server for questions like this.
Most helpful comment