1
votes

I have been trying to send custom emojis with my bot, but instead of showing the emoji it just says "None". I tried other ways but none worked.. I am a beginner so sorry if it's a dumb mistake.

The code:

@client.command()
async def sendemoji(ctx):
    emoji = client.get_emoji(802812170672275467)
    await ctx.send(f'{emoji}')
2

2 Answers

0
votes

For example, if the emoji is called xyz, you do '<:xyz:id>'

If xyz is an animated emoji, you do '<a:xyz:id>'

Also, make sure that the bot is in the server where this emoji is from. I hope this is helpful

0
votes

Custom emotes are represented internally in the following format: <:name:id> Where the name is the name of the custom emote, and the ID is the id of the custom emote.

You can quickly obtain the <:name:id> format by putting a backslash in front of the custom emoji when you put it in your client. Example: :python3: would give you the <:name:id> format.

Animated emojis are the same as above but have an a before the name- ie: <a:name:id>

Example:

await ctx.send('Python 3 emoji: <:python3:232720527448342530> !')