feat: mute/unmute chats (#168)

Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
This commit is contained in:
Aliyss Snow 2020-05-24 06:10:26 +02:00 • committed by GitHub
commit 4beeab9b2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -112,6 +112,23 @@ class Chat extends Base {
return this.client.unarchiveChat(this.id._serialized);
}
/**
* Mutes this chat until a specified date
* @param {Date} unmuteDate Date at which the Chat will be unmuted
* @returns {Promise<Boolean>} new mute state
*/
async mute(unmuteDate) {
return this.client.muteChat(this.id._serialized, unmuteDate);
}
/**
* Unmutes this chat
* @returns {Promise<Boolean>} new mute state
*/
async unmute() {
return this.client.unmuteChat(this.id._serialized);
}
/**
* Loads chat messages, sorted from earliest to latest.
* @param {Object} searchOptions Options for searching messages. Right now only limit is supported.