development
yarn
yarn dev
production
yarn
yarn build
yarn start
All details on how to create a Slack bot are explained under the Slack Documentation
. Once you have created a slack app, navigate to your slack app under slash commands
and connect the slash command with the endpoint of the fun-fact app and just follow rest prompted steps.
{
"response_type": "in_channel",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Fun fact. Learn something new everyday!"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*<https://en.wikipedia.org/wiki/Jet_(song)|TIL that the Wings song \"Jet\" was named based on Paul McCartney's Labrador Retriever named Jet.>*\n"
},
"accessory": {
"type": "image",
"image_url": "https://b.thumbs.redditmedia.com/cAmk9wNXEbwZMrCZgM1NhCNbPuWQUhFJ5aDMWusFP-s.jpg",
"alt_text": "Fact thumbnail"
}
},
{
"type": "divider"
}
]
}
{
"response_type": "in_channel",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":crying_cat_face: Something went wrong. Please try again."
}
}
]
}