Hello everyone I have a problem with embed messages in discord js. I have a variable which is storing text ".addField("text", "text", false)" and I want to use this stored text in the embed message
Example
var fields = ".addField("text", "text", false).addField("text", "text", false);
const embedmessage = new Discord.MessageEmbed()
.setTitle("title")
.setDescription("description")
.setColor("#f2320c")
and I want to add this variable named fields to the end of this embed message. How can i do it?
Sorry for my english but I hope it isn't a problem ;/
When it comes to discord embeds, I am going to assume that you would like to add fields to your embed.
Before I give you an example, I will tell you about the inline feature which will contain 2 fields on the same x-axis/line instead of the fields being only under each other, if you set it to false then it would only be under each other as true will make 2-3 fields per line depending on how many you make.
const embedmessage = new Discord.MessageEmbed()
.setTitle("title")
.setDescription("description")
.setColor("#f2320c")
.addField('This is a title', 'description here', true)
The true in the line is whether or not you want it to be inlined; you can always make it false. If you have any questions; feel free to ask me.