问题
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:
回答1:
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.
来源:https://stackoverflow.com/questions/51982806/python-bot-use-custom-emoji