DaGeyHat.mp3
DaGeyHat.mp3

Reputation: 25

I absolutely cannot get my bot to send a embed message in python

I absolutely cannot find a way to fix this, this is what I tried doing:

@client.command(aliases=['Info','information','Information'])
async def info(ctx):
      embed=discord.Embed(title="Info", description="This menu displays the info about this bot", color=#fff300())
      embed.set_author(name=ctx.author.display_name, icon_url=ctx.author.avatar_url)       
      embed.add_field(name="placeholder", value="another placeholder", inline=False)
      embed.add_field(name="so much placeholder", value="Bit more placeholder", inline=False)
      embed.add_field(name="(placeholder text)", value="(placeholder text)", inline=True)
      embed.add_field(name="way too much placeholder", value="some more placeholder", inline=True)
      embed.add_field(name="more placeholder", value="placeholder", inline=False)
  await ctx.send(embed=embed)

I have even used whatever websites I could, even the latest one and I couldn't find any way to fix the error, I keep getting a syntax error and I can't find anyway to fix it,

Upvotes: 0

Views: 267

Answers (2)

Harukomaze
Harukomaze

Reputation: 462

@client.command()
async def info(ctx):
  embed = discord.Embed(title="Info", description="This menu displays the info about this bot", color=0xa3a3ff)
  embed.set_author(name=ctx.author.display_name, icon_url=ctx.author.avatar_url)       
  embed.add_field(name="placeholder", value="another placeholder", inline=False)
  embed.add_field(name="so much placeholder", value="Bit more placeholder", inline=False)
  embed.add_field(name="(placeholder text)", value="(placeholder text)", inline=True)
  embed.add_field(name="way too much placeholder", value="some more placeholder", inline=True)
  embed.add_field(name="more placeholder", value="placeholder", inline=False)
  await ctx.send(embed=embed)

what I saw were a few indentations (spacing) errors and an error with the color format. Other than that, I see pretty much no errors and it should work, if not, please tell us what error you are exactly facing

enter image description here

Upvotes: 0

Łukasz Kwieciński
Łukasz Kwieciński

Reputation: 15689

The syntax error is when initializing the embed

embed = discord.Embed(..., color=#fff300())

Comments in python start with #, to fix it simply put it in quotes

color="fff300"

Note: This will not work, you need to convert it to an int with base 16 (also it's colour not color):

colour=int("fff300", 16)
# Or as `Nurqm` suggested
colour=0xfff300
embed = discord.Embed(title="Info", description="This menu displays the info about this bot", colour=int("fff300", 16))

Upvotes: 1

Related Questions