【发布时间】:2021-10-18 08:11:49
【问题描述】:
我想在一封邮件中发送两个嵌入。 MessageChannel#sendMessageEmbeds(java.util.Collection) 应该可以做到这一点。
另外,我已经像这样嵌入了 JSON file:
{
"author": {
"name": "I use this as title because why not",
"icon_url": "url for icon"
},
"description": "description that goes top of the embed",
"color": 65535,
"fields": [
{
"name": "field name 01",
"value": "field value 01 which *can* ||have|| __some__ markdown stuff",
"inline": false
},
{
"name": "field name 02",
"value": "yes, thie fileds can have more than one filed",
"inline": false
},
{
"name": "field name 03",
"value": "blahblah some texts",
"inline": true
},
],
"thumbnail": {
"url": "url for thumbnail"
},
"footer": {
"text": "footer text because it is cool",
"icon_url": "this would be same as author icon_url but this may vary sometimes"
}
}
问题是,我想不出'如何convert JSON 文件到MessageEmbed 对象'。我在 JDA discord 服务器中询问,在 Google 上搜索了一些提示,但仍然想不出正确的方法。
长话短说,我有用于嵌入的 JSON 文件,我想将 JSON 文件转换为 MessageEmbed 对象,以便将其发送到 Discord 频道。
【问题讨论】:
标签: java json discord-jda