Fix TypeError
when setting Embed.thumbnail
and Embed.image
property
#41
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "2.0"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixed
TypeError: image() takes 1 positional argument but 2 were given
Checklist
You are just supposed to do
url=
But i did? My code is literally
e.set_image(url=avatar.with_size(1024).url)
Could you show the code? From where you define
e
?I think that's unrelated but here is the full code
Could I see the full traceback as well? In the original error you mentioned (
TypeError: image() takes 1 positional argument but 2 were given
),image()
seems to be the culprit, not set_image?Yea it is
image()
that's what i changed in this PR,set_image
is justself.image = new_url
that runsimage()
which is a setter forimage
property, and that setter'surl
param being keyword only breaks it...Oh. I failed to look properly at what the code was, my bad, sorry!
It has been brought to my attention that both image.setter and thumbnail.setter actually do not work if you later want to remove them. Changing to
Looks good. There's only a stray
return
in the thumbnail.setter which can be removed. Also may need a.. versionchanged:: 2.0
to add that image/thumbnail can now be set this way?Like this?
I'm not good at wording and stuff so...
Thanks