slack-bot-api
slack-bot-api copied to clipboard
Slack rtm.start() deprecation
Hello all,
Slack recently published a page explaining that they are deprecating rtm.start()
functionality this month, September 2022, in favor of rtm.connect()
.
https://api.slack.com/changelog/2021-10-rtm-start-to-stop
I see that slackbots uses rtm.start
during login()
which is called in the constructor of the Slackbot
class.
https://github.com/mishk0/slack-bot-api/blob/master/index.js#L33
/**
* Starts a Real Time Messaging API session
*/
login() {
this._api('rtm.start').then((data) => {
this.wsUrl = data.url;
this.self = data.self;
this.team = data.team;
this.channels = data.channels;
this.users = data.users;
this.ims = data.ims;
this.groups = data.groups;
this.emit('start');
this.connect();
}).fail((data) => {
this.emit('error', new Error(data.error ? data.error : data));
}).done();
}
If nothing is done by September 20, this login function will likely break, along with any bots that use this library. This call needs to be replaced with rtm.connect
and the data returned will also have to change to reflect the new methods return structure.