hahn-slack-library
v0.0.17
Published
Block-kit libraray to automate building json blocks for views and messages in slack
Downloads
10
Readme
Slack-library
divider
This function returns a divider block and does not require an input.
divider();
This function call will return the following JSON
{ "type": "divider" }
header
This function returns a header block and requires on argument that is a string.
header("your header here");
The following JSON will be returned
{
"type": "header",
"text": { "type": "plain_text", "text": "your header here", "emoji": true }
}
section
This function returns a section block and requires on argument that is a string.
section("your content here");
The following JSON will be returned
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "your content here",
"emoji": true
}
}
multilineInput
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.
multilineInput({
block_id: "block id here",
action_id: "action id here",
label: "label here",
});
The following JSON will be returned
{
"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
}
}