Open si-hb opened 4 years ago
This hasn’t been documented well frankly. Just use a bot token though and you’ll be all set.
Thnx. It seems my post missed this article I was referring to
Escher's article was tremendously helpful, however does not cover scopes. Do I need any?
If you use a bot token it pretty much covers everything as I understand it. What are the first 4 or 5 chars of your token?
If you use a bot token it pretty much covers everything as I understand it. What are the first 4 or 5 chars of your token?
First 5 characters: xoxb-
Ok that’s a bot token. Does something not work for you currently?
Yes, I receive nothing from slack-rtm-in
when posting something to the bot from within Slack.
Can you get the nodered logs and post them here? It should show the bot connecting etc
27 Oct 16:03:26 - [error] [slack-config:Conductor chatbot post] TypeError: Cannot read property 'id' of undefined
at recurse (/data/node_modules/node-red-contrib-slack/slackpost.js:568:50)
at recurse (/data/node_modules/node-red-contrib-slack/slackpost.js:540:17)
at SlackConfig.dressResponseMessage (/data/node_modules/node-red-contrib-slack/slackpost.js:589:11)
at node.clientNode.webClient.apiCall.then.res (/data/node_modules/node-red-contrib-slack/slackpost.js:1306:43)
at process._tickCallback (internal/process/next_tick.js:68:7)
27 Oct 16:06:34 - [error] [slack-config:Conductor chatbot post] TypeError: Cannot read property 'id' of undefined
at recurse (/data/node_modules/node-red-contrib-slack/slackpost.js:568:50)
at recurse (/data/node_modules/node-red-contrib-slack/slackpost.js:540:17)
at SlackConfig.dressResponseMessage (/data/node_modules/node-red-contrib-slack/slackpost.js:589:11)
at node.clientNode.webClient.apiCall.then.res (/data/node_modules/node-red-contrib-slack/slackpost.js:1306:43)
at process._tickCallback (internal/process/next_tick.js:68:7)
Earlier in the logs do you see the bot connecting properly etc?
We have a lot of things connected, and our logs are enormous, so I didn't see this immediately:
[INFO] @slack/client:RTMClient:7 unable to RTM start: An API error occurred: missing_scope
[INFO] @slack/client:RTMClient:3 unable to RTM start: An API error occurred: not_allowed_token_type
@si-hb have you solved this issue? It seems that something has changed in Slack RTM and bots are not allowed anymore using it: https://github.com/slackapi/node-slack-sdk/issues/953#issuecomment-582261621 https://github.com/slackapi/node-slack-sdk/issues/921#issuecomment-633417805
Myzhar, I have not yet solved the problem unfortunately.
Thanks for the links above.
n8n might be a better option for interfacing with external APIs, we're going to try this route.
Interesting. I'll try to document required scopes/legacy app better and see where I get. I haven't looked closely but I believe the n8n integration is strictly the http based stuff (which may fit your needs). It may even be limited to just sending messages in essence but would love to hear more if you go that route.
Thank you for making these nodes available.
I followed this article and I'm able to post messages to a slack bot from a NodeRED, however when I type something into the Slack bot I see nothing from a debug node attached to
slack-rtm-in
.The article does not mention the scopes required to make it work, but adding the
chat:write
scope under Bot Token Scopes appears to be what was required forslack-web-out
to work. What am I missing in order to receive data from Slack viaslack-rtm-in
?Also whenever I post to
slack-web-out
, I always get amsg:error
of "TypeError: Cannot read property 'id' of undefined" fromslack-web-out
, though the post works fine and I see the post in the Bot's Slack channel.