ShadowNotFake
ShadowNotFake

Reputation: 114

How to make embed message with role colour

I want to make embed message with the colour of role:

@client.command(passContent=True)
async def role(ctx):
role=discord.utils.find(lambda r: r.id == 804318858873536522, ctx.message.guild.roles)
embed=discord.Embed(title=f'{role}', colour={role.color})
    await ctx.send(embed=embed)

When I am executing the command, I am getting this:

Command raised an exception: TypeError: Expected discord.Colour, int, or Embed.Empty but received set instead.

Upvotes: 0

Views: 257

Answers (1)

Just for fun
Just for fun

Reputation: 4225

Remove {} before and after role.color and it should work, putting {} makes it a set

@client.command()
async def role(ctx):
    role = discord.utils.find(lambda r: r.id == 804318858873536522, ctx.message.guild.roles)
    embed = discord.Embed(title=f'{role}', colour=role.color)
    await ctx.send(embed=embed)

Upvotes: 2

Related Questions