Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(resolve => {
userParams.room = this.name;
const user = new Hubot.User(userName, userParams);
this.robot.receive(new Hubot.LeaveMessage(user), resolve);
});
}
return new Promise(resolve => {
userParams.room = this.name;
const user = new Hubot.User(userName, userParams);
this.robot.receive(new Hubot.EnterMessage(user), resolve);
});
}
return new Promise(resolve => {
let textMessage = null;
if ((typeof message === 'object') && message) {
textMessage = message;
} else {
userParams.room = this.name;
const user = new Hubot.User(userName, userParams);
textMessage = new Hubot.TextMessage(user, message);
}
this.messages.push([userName, textMessage.text]);
this.robot.receive(textMessage, resolve);
});
}