slack-bot-api: [ERROR] not_allowed_token_type error on new bot app
I have created a brand new bot app (21 feb 2020). I the put my new bot oauth token in the init:
// Slack bot
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
});
where the bot oauth token starts with xoxb-, but I get the not_allowed_token_type in the event
// slack bot error
self.bot.on('error', (error) => {
error = error || new Error('slack connection error');
self.logger.error("Channel slack connection error", error.toString());
return reject(error);
});
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 18
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”
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
Creating the slack app
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:
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
same issue: https://github.com/mishk0/slack-bot-api/issues/145
@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…
[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
botscope (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.
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