How would I go around making a message embedded while also having buttons?

So, I have the code for a message with 5 buttons and it works. I just would like to know how I could embed it to make it look nicer.
const response = await interaction.reply({
content: 'Choose a king.',
components: [buttonRow],
});
const response = await interaction.reply({
content: 'Choose a king.',
components: [buttonRow],
});
this is the part where the message details are given, im not sure whether i should just show the entire file though.
7 Replies
d.js toolkit
d.js toolkit11mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
d.js docs
d.js docs11mo ago
guide Popular Topics: Embeds read more
shay
shayOP11mo ago
like this?
const message = new EmbedBuilder().setTitle('Test');

const response = await interaction.reply({
content: message,
components: [buttonRow],
});
const message = new EmbedBuilder().setTitle('Test');

const response = await interaction.reply({
content: message,
components: [buttonRow],
});
nvm got it
const message = {
color: 0x0099ff,
title: 'Title',
description: 'Description'
};

const response = await interaction.reply({
embeds: [message],
components: [buttonRow],
});
const message = {
color: 0x0099ff,
title: 'Title',
description: 'Description'
};

const response = await interaction.reply({
embeds: [message],
components: [buttonRow],
});
this is the code for anyone else maybe curious
Harnes
Harnes11mo ago
You should use EmbedBuilder
shay
shayOP11mo ago
thats what i tried initially but i didn't know how it would work with this
Harnes
Harnes11mo ago
The same way like this but with builder
shay
shayOP11mo ago
oh i checked the website, i'll try it out see if it works
Want results from more Discord servers?
Add your server