HTTP & JSON
jsonClear
$jsonClear[]
$jsonClear empties the JSON document of the current command, as if no $jsonParse or $jsonSet had run; everything previously stored is discarded. It does not put {} back. It takes no argument and returns an empty string.
Syntax
bdfd
$jsonClear[]
Behavior
- After
$jsonClear,$jsonStringifyand$jsonPrettyreturn an empty string, and$jsonExists[...]and$jsonArrayIndex[...]also return an empty string (notfalse/-1) until a new$jsonParseor$jsonSet. A later$jsonSet[b;1]starts a new document:{"b":1}. $jsonClearis not the same as$jsonwith no argument, which only reads the document.$jsonUnsetwith no argument has the same effect as$jsonClear.
Examples
Reset JSON Context
$jsonParse[{"temp":"data"}]
$jsonClear
$title[Clear JSON Context]
$description[JSON document after clearing: `$jsonStringify`]
$color[#5865F2]
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.