Describe your issue here.
I have been trying to get the RTM API to work, but because of some error I am unable to complete a connection to slack servers.
x in one of the [ ])x in each of the [ ])Filling out the following details about bugs will help us solve your issue sooner.
Select all that apply:
@slack/web-api@slack/events-api@slack/interactive-messages@slack/rtm-api@slack/webhookspackage version: v5.0.3
node version: v12.10.0
OS version(s): MacOS v10.15.3
What you expected to happen
Connection to Slack RTM API to be able to realtime message with bot.
What actually happened
DEBUG] WebClient:1 initialized
[DEBUG] RTMClient:1 transitioning to state: disconnected
[DEBUG] RTMClient:1 pausing outgoing event queue
[DEBUG] RTMClient:1 initialized
[DEBUG] RTMClient:1 start()
[DEBUG] RTMClient:1 transitioning to state: connecting
[DEBUG] RTMClient:1 transitioning to state: connecting:authenticating
[DEBUG] WebClient:1 apiCall('rtm.connect') start
[DEBUG] WebClient:1 will perform http request
[DEBUG] WebClient:1 http response received
[INFO] RTMClient:1 unable to RTM start: An API error occurred: not_allowed_token_type
[DEBUG] RTMClient:1 transitioning to state: connecting:reconnecting
Logs, screenshots, screencast, sample project, funny gif, etc.
**All scopes have been added on slack app dashboard.
const { RTMClient, LogLevel } = require('@slack/rtm-api');
const token = "xoxb-************-************-************************"
const rtm = new RTMClient(token,{
dataStore: false,
useRtmConnect: true,
logLevel: LogLevel.DEBUG,
// agent: proxy
});
rtm.on('message', (event) => {
console.log(event);
});
(async () => {
await rtm.start();
})();
As mentioned in the document: https://slack.dev/node-slack-sdk/rtm-api
Note: RTM isn鈥檛 available for modern scoped apps anymore. We recommend using the Events API and Web API instead. If you need to use RTM (possibly due to corporate firewall limitations), you can do so by creating a legacy scoped app. If you have an existing RTM app, do not update its scopes as it will be updated to a modern scoped app and stop working with RTM.
You need to create a classic Slack app for using RTM API. You can create a classic app from the following URL:
https://api.slack.com/apps?new_classic_app=1
Alright, thank you for the quick response! I will look into the Event API.
Happy to hear that 馃憤 For Events API, please consider using Bolt! Bolt enables you to build an endpoint that receives events from Slack more easily. Can we close this issue now?
Yes, and thank you for the recommendation.