mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-19 12:09:15 +00:00
Update GroupChat.js
This commit is contained in:
@@ -59,9 +59,13 @@ class GroupChat extends Chat {
|
|||||||
* @returns {Promise<Object>}
|
* @returns {Promise<Object>}
|
||||||
*/
|
*/
|
||||||
async addParticipants(participantIds) {
|
async addParticipants(participantIds) {
|
||||||
return await this.client.pupPage.evaluate((chatId, participantIds) => {
|
let data = [];
|
||||||
return window.Store.Wap.addParticipants(chatId, participantIds);
|
for (let participantId of participantIds){
|
||||||
}, this.id._serialized, participantIds);
|
data.push(await this.client.pupPage.evaluate((chatId, participantIds) => {
|
||||||
|
return window.Store.Wap.addParticipants(chatId, participantIds);
|
||||||
|
}, this.id._serialized, participantIds));
|
||||||
|
}
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -70,9 +74,13 @@ class GroupChat extends Chat {
|
|||||||
* @returns {Promise<Object>}
|
* @returns {Promise<Object>}
|
||||||
*/
|
*/
|
||||||
async removeParticipants(participantIds) {
|
async removeParticipants(participantIds) {
|
||||||
return await this.client.pupPage.evaluate((chatId, participantIds) => {
|
let data = [];
|
||||||
return window.Store.Wap.removeParticipants(chatId, participantIds);
|
for (let participantId of participantIds){
|
||||||
}, this.id._serialized, participantIds);
|
data.push(await this.client.pupPage.evaluate((chatId, participantIds) => {
|
||||||
|
return window.Store.Wap.removeParticipants(chatId, participantIds);
|
||||||
|
}, this.id._serialized, participantIds));
|
||||||
|
}
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,9 +89,13 @@ class GroupChat extends Chat {
|
|||||||
* @returns {Promise<{ status: number }>} Object with status code indicating if the operation was successful
|
* @returns {Promise<{ status: number }>} Object with status code indicating if the operation was successful
|
||||||
*/
|
*/
|
||||||
async promoteParticipants(participantIds) {
|
async promoteParticipants(participantIds) {
|
||||||
return await this.client.pupPage.evaluate((chatId, participantIds) => {
|
let data = [];
|
||||||
return window.Store.Wap.promoteParticipants(chatId, participantIds);
|
for (let participantId of participantIds){
|
||||||
}, this.id._serialized, participantIds);
|
data.push(await this.client.pupPage.evaluate((chatId, participantIds) => {
|
||||||
|
return window.Store.Wap.promoteParticipants(chatId, participantIds);
|
||||||
|
}, this.id._serialized, participantIds));
|
||||||
|
}
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -92,9 +104,13 @@ class GroupChat extends Chat {
|
|||||||
* @returns {Promise<{ status: number }>} Object with status code indicating if the operation was successful
|
* @returns {Promise<{ status: number }>} Object with status code indicating if the operation was successful
|
||||||
*/
|
*/
|
||||||
async demoteParticipants(participantIds) {
|
async demoteParticipants(participantIds) {
|
||||||
return await this.client.pupPage.evaluate((chatId, participantIds) => {
|
let data = [];
|
||||||
return window.Store.Wap.demoteParticipants(chatId, participantIds);
|
for (let participantId of participantIds){
|
||||||
}, this.id._serialized, participantIds);
|
data.push(await this.client.pupPage.evaluate((chatId, participantIds) => {
|
||||||
|
return window.Store.Wap.demoteParticipants(chatId, participantIds);
|
||||||
|
}, this.id._serialized, participantIds));
|
||||||
|
}
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -198,4 +214,4 @@ class GroupChat extends Chat {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = GroupChat;
|
module.exports = GroupChat;
|
||||||
|
|||||||
Reference in New Issue
Block a user