I have an error with my discord bot but when I run the program for the discord bot, it works, but the command with the invalid syntax doesn't work.
@client.command()
@commands.has_permissions(kick_members=True)
async def warn(ctx, member: discord.Member, *, reason):
save_warn(ctx, member)
dm = await bot.fetch_user(member.id)
em=discord.Embed(title="Warning", description=f"Server: {ctx.guild.id}\nReason: {reason}"
await dm.send(embed=em)
With this command, I get the invalid syntax error, can someone help me please?!
The syntax error says:
File "main.py", line 154
await dm.send(embed=em)
^
SyntaxError: invalid syntax
Thanks!