mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 03:29:14 +00:00
feat: mute/unmute chats (#168)
Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user