Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence on slack-rtm-in, error on slack-web-out #39

Open
si-hb opened this issue Oct 23, 2020 · 13 comments
Open

Silence on slack-rtm-in, error on slack-web-out #39

si-hb opened this issue Oct 23, 2020 · 13 comments

Comments

@si-hb
Copy link

si-hb commented Oct 23, 2020

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 for slack-web-out to work. What am I missing in order to receive data from Slack via slack-rtm-in?

Also whenever I post to slack-web-out, I always get a msg:error of "TypeError: Cannot read property 'id' of undefined" from slack-web-out, though the post works fine and I see the post in the Bot's Slack channel.

@travisghansen
Copy link
Owner

This hasn’t been documented well frankly. Just use a bot token though and you’ll be all set.

@si-hb
Copy link
Author

si-hb commented Oct 23, 2020

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?

@travisghansen
Copy link
Owner

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?

@si-hb
Copy link
Author

si-hb commented Oct 25, 2020

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-

@travisghansen
Copy link
Owner

Ok that’s a bot token. Does something not work for you currently?

@si-hb
Copy link
Author

si-hb commented Oct 27, 2020

Yes, I receive nothing from slack-rtm-in when posting something to the bot from within Slack.

@travisghansen
Copy link
Owner

Can you get the nodered logs and post them here? It should show the bot connecting etc

@si-hb
Copy link
Author

si-hb commented Oct 27, 2020

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)

@travisghansen
Copy link
Owner

Earlier in the logs do you see the bot connecting properly etc?

@si-hb
Copy link
Author

si-hb commented Oct 28, 2020

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

@Myzhar
Copy link

Myzhar commented Oct 30, 2020

@si-hb have you solved this issue?
It seems that something has changed in Slack RTM and bots are not allowed anymore using it:
slackapi/node-slack-sdk#953 (comment)
slackapi/node-slack-sdk#921 (comment)

@si-hb
Copy link
Author

si-hb commented Oct 30, 2020

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.

@travisghansen
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants