how to fix discord embed showing syntax error
Question:
This is the code for initializing an embed in discord.py
:
@client.command(name="games")
async def games(ctx):
embed = discord.Embed(
title="title"
description="desc"
color= discord.Color.blue()
)
await ctx.send(embed=embed)
But when I try to run it, it says:
I tried every video and even read the documentation but it doesn’t seem to help. According to it my code is fine. Is there something I am missing or anything else?
Thanks
Answers:
This is caused because you are not putting a comma after each argument.
@client.command(name="games")
async def games(ctx):
embed = discord.Embed(
title="title",
description="desc",
color= discord.Color.blue())
await ctx.send(embed=embed)
This should fix it!
This is the code for initializing an embed in discord.py
:
@client.command(name="games")
async def games(ctx):
embed = discord.Embed(
title="title"
description="desc"
color= discord.Color.blue()
)
await ctx.send(embed=embed)
But when I try to run it, it says:
I tried every video and even read the documentation but it doesn’t seem to help. According to it my code is fine. Is there something I am missing or anything else?
Thanks
This is caused because you are not putting a comma after each argument.
@client.command(name="games")
async def games(ctx):
embed = discord.Embed(
title="title",
description="desc",
color= discord.Color.blue())
await ctx.send(embed=embed)
This should fix it!