mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 11:39:14 +00:00
fix: remove unreliable return values for new mute state
This commit is contained in:
@@ -536,28 +536,25 @@ class Client extends EventEmitter {
|
||||
}
|
||||
|
||||
/**
|
||||
* Mutes the Chat until a specified date and returns the new mute state
|
||||
* Mutes the Chat until a specified date
|
||||
* @param {string} chatId ID of the chat that will be muted
|
||||
* @param {Date} unmuteDate Date when the chat will be unmuted
|
||||
* @returns {Promise<Boolean>} new mute state
|
||||
*/
|
||||
async muteChat(chatId, unmuteDate) {
|
||||
return await this.pupPage.evaluate(async (chatId, timestamp) => {
|
||||
await this.pupPage.evaluate(async (chatId, timestamp) => {
|
||||
let chat = await window.Store.Chat.get(chatId);
|
||||
await chat.mute.mute(timestamp, !0);
|
||||
}, chatId, unmuteDate.getTime() / 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unmutes the Chat and returns the new mute state
|
||||
* Unmutes the Chat
|
||||
* @param {string} chatId ID of the chat that will be unmuted
|
||||
* @returns {Promise<Boolean>} new mute state
|
||||
*/
|
||||
async unmuteChat(chatId) {
|
||||
return await this.pupPage.evaluate(async chatId => {
|
||||
await this.pupPage.evaluate(async chatId => {
|
||||
let chat = await window.Store.Chat.get(chatId);
|
||||
await window.Store.Cmd.muteChat(chat, false);
|
||||
return chat.mute.isMuted;
|
||||
}, chatId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user