Open loretoparisi opened 4 years ago
@loretoparisi did you get to know how to overcome this error ?
@sb39 not yet, I have created a brand new app on the 21, according to slack on the 20th the new app oauth token have been deployed, so it should have work...
I am getting the same error, whats the status on this issue?
Can confirm, same issue here too.. claims are that RTM is not allowed and that the issue can be solved if you make a simple slack app instead of a bot
I would recommend using Slack Official API, its much more flexible and very well documented
Can confirm, same issue here too.. claims are that RTM is not allowed and that the issue can be solved if you make a simple slack app instead of a bot
I can confirm both that it's an existing issue AND that the workarounds suggested are fine. Here's what I said in the README of the app I'm building
MUST create CLASSIC slack app here and not the new style granular permissions app. After that create a legacy app user then install the app to the workspace. Then the Bot Oauthh token will work.
Related docs:
Hello, so what I did was this
chat:write
and app_mentions:read
(this step was required, otherwise I could not install and create the Bot User OAuth Access Token.Then I have set the Bot User OAuth Access Token in the SDK:
self.bot = new SlackBot({
token: self._options.slack.botToken,
name: self._options.slack.botName,
// (boolean, defaults: false) whether to open websocket connection to listen to incoming messages,
// set to true for one time use
disconnect: false
});
and I get that error again:
Error: not_allowed_token_type
at /Users/loretoparisi/Documents/Projects/node_modules/slackbots/index.js:46:33
at Array.<anonymous> (/Users/loretoparisi/Documents/Projects/node_modules/vow/lib/vow.js:773:56)
at callFns (/Users/loretoparisi/Documents/Projects/node_modules/vow/lib/vow.js:24:35)
at processTicksAndRejections (internal/process/task_queues.js:75:11)
So now my guess is that the classic apps are actually not classic
apps anymore. Is there any way to check if the app is actually a classic app?
[UPDATE]
Okay I have found the problem.
I cannot create a classic app anymore, BTW I had a classic old app (2015). I there fore chose the bot
scope (deprecated scope), that is not available anymore to updated scopes apps:
and now it works!
So at least in my Slack, I cannot have not classic apps, but it works with a deprecated app. I would keep it open, until it's not adapted to the new apps. I assume that the deprecation has a deadline, after that this workaround would not work anymore.
Thank you.
A very full and clear explanation of how to setup a classic app on slack for RTM (for this workaround) from elsewhere: https://github.com/slackapi/hubot-slack/issues/584#issuecomment-611808704
@baob thank you. A question, maybe related to this classic app setup:
var params = {
icon_emoji: ':rocket:'
};
self.bot.postMessageToChannel(self._options.slack.botChannel, 'listening...', params);
the emoji does not appear in the slack chat. My fault? Thank you.
the emoji does not appear in the slack chat. My fault?
I suspect this s unrelated to the main topic of this thread. Two thoughts. (1) are you sure that emoji is available on your slack workspace ? (2) I remember seeing that initially but don't remember taking any specific action to cure it. Perhaps a caching issue ?
@baob yes I have the :rocket:
emoji in the workspace. I have also tried to remove the :
// slack bot ready
self.bot.on('start', () => {
var params = {
icon_emoji: 'rocket'
};
self.bot.postMessageToChannel(self._options.slack.botChannel, 'listening...', params);
return resolve(true);
});
I confirm now that the emoji works. The problem happens on slack in Chrome, while on slack mobile I can see emojis. Thanks!
Are you guys ever planning to fix this? A few months later I have the same error after a fresh new project, and creating a new app bot. I was following this tutorial. https://www.freecodecamp.org/news/building-a-slackbot-with-node-js-and-slackbots-js/ "slackbots": "^1.2.0"
Bumping for visibility. Still cannot set fields
Are you guys ever planning to fix this? A few months later I have the same error after a fresh new project, and creating a new app bot. I was following this tutorial. https://www.freecodecamp.org/news/building-a-slackbot-with-node-js-and-slackbots-js/ "slackbots": "^1.2.0"
Any fix for this? I was following the same tutorial
To anyone coming here:
The tutorial on freecodecamp is based on obsolete Slack APIs and a module that's not supporting the recent versions.
I just wasted time on this module and tutorial as well, it should have an "Unsupported" disclamer in top, IMO.
However, I made something work with Slack's own bolt API.
https://blog.logrocket.com/build-a-slackbot-in-node-js-with-slacks-bolt-api/
I have created a brand new bot app (21 feb 2020). I the put my new bot oauth token in the init:
where the bot oauth token starts with
xoxb-
, but I get thenot_allowed_token_type
in the event