feat: Get corresponding Chat from Contact object and vice versa

close #269
This commit is contained in:
Pedro Lopez
2020-08-17 23:31:19 -04:00
parent 34aa136bf9
commit 7180beda2e
3 changed files with 26 additions and 0 deletions

View File

@@ -186,6 +186,14 @@ class Chat extends Base {
return true;
}, this.id._serialized);
}
/**
* Returns the Contact that corresponds to this Chat.
* @returns {Promise<Contact>}
*/
async getContact() {
return await this.client.getContactById(this.id._serialized);
}
}
module.exports = Chat;