How to make my bot use my custom emoji in any discord server.
@bot.command(pass_context=True)
async def ping(ctx):
msg = "Pong :CustomEmoji: {0.author.mention}".format(ctx.message)
await bot.say(msg)
Example:
If I upload some custom emojis on server 1
and when we use the !ping
command (mentioned above) in server 2
or server 3
or any server where the bot has access to, it should use the custom emoji.
Result Pong with :CustomEmoji:
From https://github.com/Rapptz/discord.py/issues/390:
It's
<:emoji_name:emoji_id>
for custom emojis.You can also find the discord.Emoji instance through Server.emojis and then cast it to str.