I get an error message about my script. I read the documentation and applied it to my script, but it still doesn’t work. I wanted to write a Discord webhook message in Embed using structured mode. I also looked at the other topics and they didn’t answer my question. I hope there is enough data for you to tell what I did wrong.
Error message
{
"embeds": [
"0"
]
}
at null.createError (/opt/ee/node_modules/axios/lib/core/createError.js:16:15)
at null.settle (/opt/ee/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/opt/ee/node_modules/axios/lib/adapters/http.js:236:11)
at IncomingMessage.emit (events.js:412:35)
at null.endReadableNT (internal/streams/readable.js:1334:12)
at process.processTicksAndRejections (internal/process/task_queues.js:82:21)
params
{
"username": "Fall Guys",
"avatar_url": "https://cdn.discordapp.com/avatars/787639153168351284/c48818d37c6b12c06244f1231f4aeaa1.webp?size=80",
"content": "Kleiner Test",
"embeds": [
{
"author": {
"name": "{{steps.trigger.raw_event.author}}",
"url": "",
"icon_url": ""
},
"title": "{{steps.trigger.raw_event.title}}",
"url": "{{steps.trigger.raw_event.permalink}}",
"description": "Daran wird gearbeitet",
"color": 65463,
"fields": [
{
"name": "CENSORED",
"value": "<a:dc_loading:850458386905563206> [Discord Server](CENSORED)",
"inline": true
}
],
"thumbnail": {
"url": "CENSORED"
},
"image": {
"url": "{{steps.trigger.raw_event["rss:enclosure"]["@"].url}}"
},
"footer": {
"text": "Bereitgestellt von CENSORED",
"icon_url": "https://www.pngall.com/wp-content/uploads/2017/05/Copyright-Symbol-Free-PNG-Image.png"
"timestamp": "{{steps.trigger.raw_event.pubdate}}"
}
}
]
}
code
const url = auths.discord_webhook.oauth_uid
let content = params.message
const { embeds, username, avatar_url } = params
if (!content && !embeds) {
throw new Error("This action expects a message OR an embeds param. Please enter one or the other from the params menu above")
}
return await require("@pipedreamhq/platform").axios(this, {
method: "POST",
url,
headers: {
"Content-Type": "application/json"
},
data: {
username,
avatar_url,
content,
embeds
}
})