首页 > 解决方案 > 我的 Discord Python 机器人没有发送表情符号

问题描述

我正在尝试制作一个列出各种自定义表情符号及其含义的机器人。我的代码:

await message.channel.send(":up10: means the stock price has gone up more than 10% in the last 24 hours")

这应该显示一个表情符号来代替 :up10: 但它所做的只是打印文字文本。

标签: pythondiscord

解决方案


您需要格式化表情符号字符串以说明 12345 是表情符号的 ID。

如果你想找回你的 emoji ID,请在聊天中发送 :up10: ,你的 discord 客户端会将其更改为:<:up10:12345>

您需要发送他们给您的全部内容:

await message.channel.send("<:up10:12345> is the emoji...")

(注意你的ID会比12345长很多)


推荐阅读