Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_wxRoom(chatId) {
return wechaty.Room.findAll().then((rooms) => {
return rooms.find((room) => {
return room.alias(this.wechaty.self()) === '#' + -chatId;
});
}).then((room) => {
if (room) {
return room;
}
if (this._buffers.room[-chatId]) {
// data in the buffer may be out of date
return this._buffers.room[-chatId];
}
return new errors.TelegramError('room not found');
});
}