slackbotapi
slackbotapi copied to clipboard
Constructor does asynchronous tasks
The constructor performs asynchronous request to the Slack rtm.start method. The getChannel method of this module relies on the information gathered from this request and may fail when called right after construction.
What is the desired behavior here? Asynchronous behavior in constructor is undesired in my opinion. Perhaps there needs to be a .init() or .connect() method that covers the asynchronous behavior of the constructor? This is breaking change though.
The methods relying on the data from the constructor could also throw an error when the data is still undefined. This could be retried at some point in the future.