Message to embed

I am trying to make a command that takes raw json as a message and converts it into an embed. I'm not sure how to get the parsed json object as an embed. If anyone could help that would be amazing.
const message = interaction.options.getString('json', true)

const json = JSON.parse(message)
const message = interaction.options.getString('json', true)

const json = JSON.parse(message)
3 Replies
d.js toolkit
d.js toolkit4mo 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
souji
souji4mo ago
provided message is your object, json will be the object in question embeds can be supplied to TextChannel#send through the embeds: [...] key
Jerimiah
JerimiahOP4mo ago
Let's say user runs the command providing:
{
description: 'example'
}
{
description: 'example'
}
Want results from more Discord servers?
Add your server