Block-kit libraray to automate building json blocks for views and messages in slack
npm install hahn-slack-libraryThis function returns a divider block and does not require an input.
``ts`
divider();
This function call will return the following JSON
`json`
{ "type": "divider" }
This function returns a header block and requires on argument that is a string.
`ts`
header("your header here");
The following JSON will be returned
`json`
{
"type": "header",
"text": { "type": "plain_text", "text": "your header here", "emoji": true }
}
This function returns a section block and requires on argument that is a string.
`ts`
section("your content here");
The following JSON will be returned
`json`
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "your content here",
"emoji": true
}
}
This function returns a mutli-line input block and requires on argument that is an object with the properties block_id, action_id, and label. All properties of the object are strings.
`ts`
multilineInput({
block_id: "block id here",
action_id: "action id here",
label: "label here",
});
The following JSON will be returned
`json``
{
"type": "input",
"block_id": "block id here",
"element": {
"type": "plain_text_input",
"multiline": true,
"action_id": "action id here"
},
"label": {
"type": "plain_text",
"text": "label here",
"emoji": true
}
}