While attempting to make an embed for my API call results, I encountered the error "set_thumbnail() takes 1 positional argument but 2 were given" with the following code:
em = Embed(title=data["name"], description=data["text"], url=data["uri"])
em.set_thumbnail("http://www.navipedia.net/images/a/a9/Example.jpg") # There is only 1 argument
em.set_author(name="Example", icon_url=self.bot.user.avatar_url)
await self.bot.send_typing(ctx.message.channel)
await self.bot.send_message(ctx.message.channel, embed=em)
I was able to resolve this myself by editing discord/embeds.py, and changing the arguments of both functions from self, *, url to self, url, then reinstalling it through pip, which results in the expected behaviour of my embed having a thumbnail. Or is there something wrong with my use of set_thumbnail?
self,*,url means it will only accept kwargs.
meaning you have to use:
set_thumbnail(url="url")
not
set_thumbnail(url)
Oh wow, of course it's simple. Thanks for the quick response, that works.
Most helpful comment
self,*,urlmeans it will only accept kwargs.meaning you have to use:
set_thumbnail(url="url")not
set_thumbnail(url)