HTTP & JSON
inboundPayload
$inboundPayload[]
$inboundPayload reads the JSON body that a caller sent to the bot’s inbound webhook. Use . to go into nested objects and a number to pick an item of an array (user.tags.0). A missing field, or a run that is not an inbound webhook, returns an empty value. Without argument it returns the whole body as JSON, which you can pass to $jsonParse.
Syntax
bdfd
$inboundPayload[(path)]
The same data is available as ((inbound.payload.<key>)) (top-level keys only) and ((inbound.payload.json)). In a JavaScript bot, read webhook.payload.
Parameters
| Parameter | Description |
|---|---|
path |
Optional. The field to read, for example userID or user.name. Array items use their index: items.0.id. Without it, the whole body is returned as JSON. |
Examples
$sendMessage[Received for user $inboundPayload[userID]]
$sendMessage[Hello $inboundPayload[user.name]!]
Try it
Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.