问题
I recently built a simple command to test the format of custom emoji's and animated emoji's
Here is what the command was
@bot.command()
async def say(ctx, *, text):
await ctx.send("<:ono:521148278079881219> You said %s" % text)
But the output message didn't send the custom emoji, instead it messaged
:ono: You said hello(the text i messaged in chat)
Any help will be appreciated.
回答1:
You can use Client.get_emoji to get the Emoji
object, then use that to build your string
@bot.command()
async def say(ctx, *, text):
ono = bot.get_emoji(521148278079881219)
await ctx.send(f"{ono} You said {text}")
来源:https://stackoverflow.com/questions/54085674/custom-emojis-and-animated-emojis-not-working-discord-py-rewrite