Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(robot, options) {
super(robot);
this.options = options;
// hubot-slack will default to use process.env.HUBOT_SLACK_TOKEN
if (this.options.bot_token) {
this.sbotAdapter = hubotSlack.use(this.robot);
// client for api call
// this.client = this.sbotAdapter.client.web;
} else {
this.robot.logger.warning('No bot token found, slack bot (rtm) not set');
}
// Only when adapter is needed
if (this.sbotAdapter) {
this.sbotAdapter.once('connected', () => {
return this.emit('connected');
});
}
}