Closed oxydien closed 10 months ago
You can already do that in the JSON code modal. You can paste stuff and edit it
Sorry i noticed that too late :). The reason that i couldn't do it earlier, is because i was pasting the discord raw from already sent message...
You should be able to paste the JSON code of an existing Discord message
So i think that there is error in there with the id... In discord raw message embed the id is string.
Error:
ZodError: [
{
"code": "invalid_type",
"expected": "number",
"received": "string",
"path": [
"embeds",
0,
"id"
],
"message": "Expected number, received string"
},
{
"code": "invalid_type",
"expected": "number",
"received": "string",
"path": [
"embeds",
0,
"color"
],
"message": "Expected number, received string"
}
]
What i pasted from discord:
"embeds": [
{
"id": "embed_17",
"type": "rich",
"rawTitle": "Testing",
"rawDescription": "embed",
"contentScanVersion": 0,
"color": "hsla(198, calc(var(--saturation-factor, 1) * 100%), 50%, 1)",
"fields": []
}
],
Hey, beside the id I'm a bit confused about the rawTitle
and rawDescription
properties. Where did you get this embed JSON from?
According to the Discord docs these properties don't exist and the color
property should be an integer 🤔
Oh sorry, I did not notice this... So I'm using Vencord and there is plugin ViewRaw that I used... But I did not know that the embeds would be different, because everything else looks the same as in the normal message response. So from discord it works:
"embeds": [
{
"type": "rich",
"title": "Testing",
"description": "embed",
"color": 45823,
"content_scan_version": 0
}
]
Sorry that i did not notice this earlier. I think that the raw data from the embed is taken directly from the client and that's why it does not match...
Ah I see. Yeah I don't think I want to support the different format of the client
Have a button in the app that would allow the user to paste JSON, and then import it. Or maybe in the code modal, editing would work.