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
parent cca74ec8b9
commit 4beeab9b2c
3 changed files with 49 additions and 0 deletions

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.