From 295641f7b352b0ca3d1cfb52122bf50ee0b0856b Mon Sep 17 00:00:00 2001 From: David Hohl Date: Thu, 21 Dec 2023 09:52:08 +0100 Subject: [PATCH] docs(Readme): guidelines --- README.md | 60 +++++++++++++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index b99afdc..8d35c9b 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,21 @@ Control your Slack App via Node-Red! Slack Bolt integration. -What you can do with this node? +What you can do with this node-red plugin? - send simple text messages - send complex block messages -- events: You can listen to any [Slack Events](https://api.slack.com/events) -- actions: You can listen to user action and respond via Node-Red -- commands: Create your own commands with your Slack App and listen via Node-Red -- shortcuts: Create your own global or message based shortcuts and develop it with Node-Red +- events: listen to any [Slack Events](https://api.slack.com/events) +- actions: listen to user action and respond via Node-Red +- commands: create your own commands with your Slack App and listen via Node-Red +- shortcuts: create your own global or message based shortcuts and develop it with Node-Red - views: Slack views -- messages: Listing for messages in a channel +- messages: listing for messages in a channel Develop your [Slack app using Bolt](https://slack.dev/bolt-js/tutorial/getting-started) for JavaScript with Node-Red. -``This is an alpha version, no grarranty for productive mode!`` +> [!IMPORTANT] +> This is an alpha version, no grarranty for productive mode! ## Usage @@ -31,13 +32,9 @@ Develop your [Slack app using Bolt](https://slack.dev/bolt-js/tutorial/getting-s > [!TIP] > Don't forget to install the app also into a channel. - > [!NOTE] > Could be that the installation of your slack app takes longer than 60min. - -Follow the Node-RED Slack App Configuration. -
Slack Manifest ```yaml @@ -94,7 +91,6 @@ open your folder via favourite shell
### Node-Red Configuration - After the installation of `@headless-architecture/node-red-contrib-slack-bolt` search in your Node-RED toolbar for `slack` ![Slack Bolt Nodes](https://raw.githubusercontent.com/fishme/node-red-contrib-slack-bolt/main/docs/img/node-red-slackbolt-nodes.png) @@ -154,12 +150,13 @@ Simple Block for choosing a date } ] ``` +
- - [Block Kit Builder](https://app.slack.com/block-kit-builder) - - [Formating Blocks](https://api.slack.com/reference/surfaces/formatting#rich-layouts) +- [Block Kit Builder](https://app.slack.com/block-kit-builder) +- [Formating Blocks](https://api.slack.com/reference/surfaces/formatting#rich-layouts) -**Registry** +#### Registry This node enalbe the following Slack functions. @@ -180,23 +177,20 @@ All listener needs to add once. Therefor create a Infection with:
Connect a function node with the following code. - Magic Slack Code. This will listen for App mention in your channel.
-e.g. Your App name @Node-Red-demo-app +e.g. Your App name @Node-Red-demo-app. -``` -// write in your slack channel -@Node-Red-demo-app What's up? -``` -Slack will answer you with a button and if your press on the button the action will be exected with a short answer back. +Write in your Slack channel: +`@Node-Red-demo-app What's up?` + +Slack will answer you with a button and if your press on the button the action will send an answer back. ![Active Communication](https://raw.githubusercontent.com/fishme/node-red-contrib-slack-bolt/main/docs/img/node-registry-example1.png) ```javascript -// use the object to initialize your handlers. -// if you don't need all, clean it. +// initialize your handlers. msg.SlackBolt = { actions: [], commands: [], @@ -258,12 +252,20 @@ msg.SlackBolt.events.push( ## Node-Red Example copy paste into your -see `/examples/example.json` +see [Examples](https://github.com/fishme/node-red-contrib-slack-bolt/blob/main/examples/example.json) https://flows.nodered.org/flow/368f36cbacfeba00b253086438f9a74d

+## Common Errors + +`Error: An API error occurred: channel_not_found`
+**Solution:** Your Slack App is not installed in the channel. + +`Error: An API error occurred: invalid_auth`
+**Solution:** Token are wrong. + ## Development ### Installation @@ -296,14 +298,6 @@ yarn build [Read Node-RED docs](https://nodered.org/docs/creating-nodes/first-node#testing-your-node-in-node-red) on how to install the node set into your Node-RED runtime. -### Common Errors - -`Error: An API error occurred: channel_not_found`
-**Solution:** Your Slack App is not installed in the channel. - -`Error: An API error occurred: invalid_auth`
-**Solution:** Token are wrong. - ### Contact **Issues:** [https://github.com/fishme/node-red-contrib-slack-bolt/issues](https://github.com/fishme/node-red-contrib-slack-bolt/issues)