Discord.py: Embed set_image() and set_thumbnail() "takes 1 positional argument but 2 were given"

Created on 13 Jul 2017  路  2Comments  路  Source: Rapptz/discord.py

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?

question

Most helpful comment

self,*,url means it will only accept kwargs.

meaning you have to use:

set_thumbnail(url="url")
not
set_thumbnail(url)

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pappabewar picture pappabewar  路  26Comments

Yuvira picture Yuvira  路  18Comments

xomien picture xomien  路  17Comments

Chicchi73930 picture Chicchi73930  路  17Comments

marcoshuck picture marcoshuck  路  16Comments