python - 我的 Discord Python 机器人没有发送表情符号
问题描述
我正在尝试制作一个列出各种自定义表情符号及其含义的机器人。我的代码:
await message.channel.send(":up10: means the stock price has gone up more than 10% in the last 24 hours")
这应该显示一个表情符号来代替 :up10: 但它所做的只是打印文字文本。
解决方案
您需要格式化表情符号字符串以说明 12345 是表情符号的 ID。
如果你想找回你的 emoji ID,请在聊天中发送 :up10: ,你的 discord 客户端会将其更改为:<:up10:12345>
您需要发送他们给您的全部内容:
await message.channel.send("<:up10:12345> is the emoji...")
(注意你的ID会比12345长很多)
推荐阅读
- javascript - 如何在chart.js中以k格式显示条形值的千位
- c# - 使用可选字段发布服务属性,但如果它为空或为空,则需要更新
- python - 使 yfinance 错误传播
- c++ - 安装 Shark 机器学习库的问题
- javascript - Node v12: module is not defined when exporting
- azure - CDN 端点规则引擎
- java - 我正在使用 jsp ajax 向 servlet 发送表单数据,但是 ajax 响应在纳秒内消失
- flutter - 我可以使用 Google 表格作为我的移动应用程序的数据源吗
- javascript - 在选择正确的画布时如何执行 addEventListener 函数?
- c - 如何在c中将形式for循环切换为while循环?