question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ERROR] not_allowed_token_type error on new bot app

See original GitHub issue

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);
                });

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:18

github_iconTop GitHub Comments

18reactions
TomKulakovcommented, Oct 29, 2020

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”

6reactions
baobcommented, Apr 8, 2020

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

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:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not allowed token type for Slack connection #964 - GitHub
U am using the "xoxb-" bot token. @robertomano24. I just went through the process myself and got the same error, it took me...
Read more >
Slack not_allowed_token_type error - How to send message ...
You are using the wrong Bearer Token. You should be using the bot token (xoxb). The token you are currently using is for...
Read more >
Access tokens - Slack API
Access tokens are the keys to the Slack platform. Tokens tie together all the scopes and permissions your app has obtained, allowing it...
Read more >
Getting started with HTTP - Slack | Bolt for JavaScript
There are three main token types available to a Slack app: user ( xoxp ), bot ( xoxb ), and app ( xapp...
Read more >
Develop a Slack-bot using Golang - ProgrammingPercy
Go into Settings->Basic Information and scroll down to the chapter called App-Level Tokens and press Generate Tokens and Scope and fill in a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found