Search code examples
pythondiscord.pyemoji

Bot doesn't send emoji properly (Python 3.9.2 PyCharm 2021.1)


I was busy making my economy command in the my bot and I wanted to have a custom currency emoji. So I made one and I quickly put it into my code. Then, when I activated the bot, it only sent the emoji name! (No it didn't send the tiny code piece I used to identify the emoji, it just sent :currency_symbol:)

Here is what has happened

I need the emoji actually to show itself like an emoji.

What I did to make the emoji in PyCharm:

<a:currency_symbol:832506821675057173>

Code:

@commands.command(pass_context=True, aliases=['bal'])
    async def balance(self, ctx):
        id = str(ctx.message.author.id)
        embed = discord.Embed(title="CatsyBot Economy", description=f"{ctx.message.author}'s Balance", colour=discord.Colour.blue())
        embed.add_field(name="Bank", value="{} <a:currency_symbol:832506821675057173>".format(amounts[id]))
        if id in amounts:
            await ctx.send(embed=embed)
        else:
            await ctx.send(embed="You do not have an account")

Solution

  • If emoji is not animated, just write: <currency_symbol:832506821675057173> Code:

    @commands.command(pass_context=True, aliases=['bal'])
        async def balance(self, ctx):
            id = str(ctx.message.author.id)
            embed = discord.Embed(title="CatsyBot Economy", description=f"{ctx.message.author}'s Balance", colour=discord.Colour.blue())
            embed.add_field(name="Bank", value="{} <currency_symbol:832506821675057173>".format(amounts[id]))
            if id in amounts:
                await ctx.send(embed=embed)
            else:
                await ctx.send(embed="You do not have an account")