#that still doesn t look a JSON
1 messages · Page 1 of 1 (latest)
sure
logs fields again outside of try/catch clause and after u set the var fields
also show the full err
"{name: \"Website\", value: \"pwnkerom\"}"
lol
that would explain it
why are these \ in there
did u put them in? cus it looks like u do
I assume discord puts em in
ye. What u inputting the option is also not even a valid stringified obj
it shud look {"name": "value", "value": "value"} is a valid JSON.stringified obj
which u can parse properly.
looks like it its just an issue with how discord formats it somehow
going back to my original code and pasting this works fine { "name": "🤔", "value": "some of these properties have certain limits..." }
maybe it needs the line breaks
if (interaction.options.get("fields")) {
try {
var fields = JSON.parse(interaction.options.getString("fields"));
} catch (error) {
await webhook.delete();
return await interaction.editReply({
content: "Json parse error! Please try again.",
});
}
embed.addFields(fields)
}```