Discord.js 嵌入消息多行值 [英] Discord.js Embedded message multiple line value
问题描述
发送嵌入消息的标准方式是:
The standard way of sending an embedded message is:
message.channel.send({embed: {
color: 3447003,
title: "Test:",
fields: [
{ name: "Test 1", value="Test"},
{ name: "Test 2", value: "TEST"},
{ name: "Test 3", value: "TEST"}
]
}
});
我想知道是否有任何方法可以使消息以块的形式出现,例如:
I was wondering if there is any way I could make the messages in block form for example:
Test1: Test2:
test1 test1
test2 test2
test3 test3
test4 test4
我的目标是使其内联,您可以输入多个值/每个标题.首先,我认为
可以解决问题,但它不起作用.我尝试了其他一些方法,例如尝试向其中添加 embed-manager.js,但它也不起作用.
I'm aiming so it goes inline and you can input multiple values/per title. First I thought that
would do the trick but it doesn't work. I tried some other things as trying to add a embed-manager.js to it but it doesn't work aswell.
message.channel.send({embed: {
color: 3447003,
title: "Test:",
fields: [
{ name: "Test 1", value="Test1
Test2
Test3"},
{ name: "Test 2", value: "TEST"},
{ name: "Test 3", value: "TEST"}
]
}
});
我的目标是这样的:示例图片
提前感谢您的帮助.
推荐答案
首先你不能在对象上使用 =
.它总是 :
您可以使用
来制作换行符.
您可以使用 inline: true
使其在一行中最多显示 3 个字段.
First you can't use =
on objects. It's always :
You can use
to make a break line.
You can use inline: true
so it shows up to 3 fields in one line.
message.channel.send({embed: {
color: 3447003,
title: "Test:",
fields: [
{ name: "Test 1", value: "Line1
Line2
Line3", inline: true},
{ name: "Test 2", value: "AlsoLine1
AlsoLine2
AndLine3", inline: true}
]
}
});
这是这段代码的结果:
This is the result of this code:
这篇关于Discord.js 嵌入消息多行值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!