Was just trying to build a simple slack bot by following a YouTube link and started getting the error Error: not_allowed_token_type
const bot = new SlackBot({
token: 'xoxb-TOKEN_GENERATED FROM SLACK SITE',
name: 'escalatorbot' // what name should I give here
})
Can somebody tell why I am facing this error
Create a Slack app if you don't already have one, or select an existing app you've created. Click the OAuth & Permissions tab in the left sidebar. Below Bot Token Scopes, select one or more scopes.
Access tokens Access tokens are the keys to the Slack platform. Tokens tie together all the scopes and permissions your app has obtained, allowing it to read, write, and interact. There are multiple types of access token available.
A bot is a nifty way to run code and automate messages and tasks. In Slack, a bot is controlled programmatically via a bot user token that can access one or more of Slack’s APIs.
Create a Slack app if you don't already have one, or select an existing app you've created. Click the OAuth & Permissions tab in the left sidebar. Below Bot Token Scopes, select one or more scopes. Then click Add an OAuth Scope.
From your code snippet, I think you're using Slackbots.js and encountering a known problem resulting from recent changes in the slack api. The issue is logged here: https://github.com/mishk0/slack-bot-api/issues/145
The issue is releated with the new granular permissions app in slack, use the legacy bot on this url: https://api.slack.com/apps?new_classic_app=1 and then in Bots you can add legacy bot user and generate correct token
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With