Search code examples
pythondiscorddiscord.pyembed

Why do my embeds look like code on Discord.py?


I was trying to make a help embed page for my bot that I'm working on. However instead of embedding it shows this gibberish:

As you see it doesn't even reply.

The code that I used:

@client.command
async def help(ctx):
    print("ctx.message.author.avatar_url")
    embed=discord.Embed(title="Commands", description="Help Page", color=0xad1f1f)
    embed.set_author(name=ctx.message.author.name + "#" + ctx.message.author.discriminator, icon_url=ctx.message.author.avatar_url)
    embed.add_field(name=".help", value="Shows this page. Do .help [Page] for more help pages", inline=False)
    embed.add_field(name=".say", value="Says what you input and removes your message. (Administrator Exclusive)", inline=False)
    embed.add_field(name=".avatar", value="Sends your avatar. Or the avatar of anyone mentioned or replied to.", inline=False)
    embed.set_footer(text="Page (1/1)")
    await ctx.message.reply(embed=embed)

I have tried everything. I have googled, made all the variables print in case there is something wrong with avatar_url for example. And I am simply tired of it now. Perhaps it was a syntax error and I am really stupid and I hope that's not the case.


Solution

  • This is the default help command from discord.py. Disable it by adding right after defining your bot:

    eg.:

        client = commands.Bot(command_prefix="$", case_insensitive=True)
        client.remove_command('help')