auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
this.msg = [{
"title": "Hello!",
"description": "Hi! :grinning:"
}]
An array of embed objects. See https://birdie0.github.io/discord-webhooks-guide/discord_webhook.html
async
(params, auths) => {
}
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: {
content,
embeds,
username,
avatar_url,
}
})