diff --git a/docs/Base.html b/docs/Base.html
index 405ceda..f24dffd 100644
--- a/docs/Base.html
+++ b/docs/Base.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: Base
+ whatsapp-web.js 1.19.2 » Class: Base
@@ -15,7 +15,7 @@
diff --git a/docs/BaseAuthStrategy.html b/docs/BaseAuthStrategy.html
index 7e45bbd..734f02d 100644
--- a/docs/BaseAuthStrategy.html
+++ b/docs/BaseAuthStrategy.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: BaseAuthStrategy
+ whatsapp-web.js 1.19.2 » Class: BaseAuthStrategy
@@ -15,7 +15,7 @@
diff --git a/docs/BusinessContact.html b/docs/BusinessContact.html
index a009637..66a9d74 100644
--- a/docs/BusinessContact.html
+++ b/docs/BusinessContact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: BusinessContact
+ whatsapp-web.js 1.19.2 » Class: BusinessContact
@@ -15,7 +15,7 @@
diff --git a/docs/Buttons.html b/docs/Buttons.html
index eda6387..5d57a0e 100644
--- a/docs/Buttons.html
+++ b/docs/Buttons.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: Buttons
+ whatsapp-web.js 1.19.2 » Class: Buttons
@@ -15,7 +15,7 @@
diff --git a/docs/Call.html b/docs/Call.html
index 5bf102c..3c190bf 100644
--- a/docs/Call.html
+++ b/docs/Call.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: Call
+ whatsapp-web.js 1.19.2 » Class: Call
@@ -15,7 +15,7 @@
diff --git a/docs/Chat.html b/docs/Chat.html
index 58d67b0..4cf6276 100644
--- a/docs/Chat.html
+++ b/docs/Chat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: Chat
+ whatsapp-web.js 1.19.2 » Class: Chat
@@ -15,7 +15,7 @@
diff --git a/docs/Client.html b/docs/Client.html
index de09c4a..cd112dd 100644
--- a/docs/Client.html
+++ b/docs/Client.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: Client
+ whatsapp-web.js 1.19.2 » Class: Client
@@ -15,7 +15,7 @@
diff --git a/docs/Client.js.html b/docs/Client.js.html
index e3e7bb4..c5f6c31 100644
--- a/docs/Client.js.html
+++ b/docs/Client.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: Client.js
+ whatsapp-web.js 1.19.2 » Source: Client.js
@@ -15,7 +15,7 @@
@@ -805,7 +805,7 @@ class Client extends EventEmitter {
*/
async getInviteInfo(inviteCode) {
return await this.pupPage.evaluate(inviteCode => {
- return window.Store.InviteInfo.sendQueryGroupInvite(inviteCode);
+ return window.Store.InviteInfo.queryGroupInvite(inviteCode);
}, inviteCode);
}
@@ -815,11 +815,11 @@ class Client extends EventEmitter {
* @returns {Promise<string>} Id of the joined Chat
*/
async acceptInvite(inviteCode) {
- const chatId = await this.pupPage.evaluate(async inviteCode => {
- return await window.Store.Invite.sendJoinGroupViaInvite(inviteCode);
+ const res = await this.pupPage.evaluate(async inviteCode => {
+ return await window.Store.Invite.joinGroupViaInvite(inviteCode);
}, inviteCode);
- return chatId._serialized;
+ return res.gid._serialized;
}
/**
@@ -1126,19 +1126,17 @@ class Client extends EventEmitter {
const createRes = await this.pupPage.evaluate(async (name, participantIds) => {
const participantWIDs = participantIds.map(p => window.Store.WidFactory.createWid(p));
- const id = window.Store.MsgKey.newId();
- const res = await window.Store.GroupUtils.sendCreateGroup(name, participantWIDs, undefined, id);
- return res;
+ return await window.Store.GroupUtils.createGroup(name, participantWIDs, 0);
}, name, participants);
const missingParticipants = createRes.participants.reduce(((missing, c) => {
- const id = Object.keys(c)[0];
- const statusCode = c[id].code;
+ const id = c.wid._serialized;
+ const statusCode = c.error ? c.error.toString() : '200';
if (statusCode != 200) return Object.assign(missing, { [id]: statusCode });
return missing;
}), {});
- return { gid: createRes.gid, missingParticipants };
+ return { gid: createRes.wid, missingParticipants };
}
/**
diff --git a/docs/ClientInfo.html b/docs/ClientInfo.html
index 2653b0c..35c3a48 100644
--- a/docs/ClientInfo.html
+++ b/docs/ClientInfo.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: ClientInfo
+ whatsapp-web.js 1.19.2 » Class: ClientInfo
@@ -15,7 +15,7 @@
diff --git a/docs/Contact.html b/docs/Contact.html
index 3144b3a..7a35f05 100644
--- a/docs/Contact.html
+++ b/docs/Contact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: Contact
+ whatsapp-web.js 1.19.2 » Class: Contact
@@ -15,7 +15,7 @@
diff --git a/docs/GroupChat.html b/docs/GroupChat.html
index 9cabfa2..2f7ed97 100644
--- a/docs/GroupChat.html
+++ b/docs/GroupChat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: GroupChat
+ whatsapp-web.js 1.19.2 » Class: GroupChat
@@ -15,7 +15,7 @@
diff --git a/docs/GroupNotification.html b/docs/GroupNotification.html
index 419bcf9..08fcd34 100644
--- a/docs/GroupNotification.html
+++ b/docs/GroupNotification.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: GroupNotification
+ whatsapp-web.js 1.19.2 » Class: GroupNotification
@@ -15,7 +15,7 @@
diff --git a/docs/InterfaceController.html b/docs/InterfaceController.html
index 2d73cf8..92e11fb 100644
--- a/docs/InterfaceController.html
+++ b/docs/InterfaceController.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: InterfaceController
+ whatsapp-web.js 1.19.2 » Class: InterfaceController
@@ -15,7 +15,7 @@
diff --git a/docs/Label.html b/docs/Label.html
index 578779f..e3e3900 100644
--- a/docs/Label.html
+++ b/docs/Label.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: Label
+ whatsapp-web.js 1.19.2 » Class: Label
@@ -15,7 +15,7 @@
diff --git a/docs/LegacySessionAuth.html b/docs/LegacySessionAuth.html
index 833f2c4..4331e89 100644
--- a/docs/LegacySessionAuth.html
+++ b/docs/LegacySessionAuth.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: LegacySessionAuth
+ whatsapp-web.js 1.19.2 » Class: LegacySessionAuth
@@ -15,7 +15,7 @@
diff --git a/docs/List.html b/docs/List.html
index ead1c22..6d6c2be 100644
--- a/docs/List.html
+++ b/docs/List.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: List
+ whatsapp-web.js 1.19.2 » Class: List
@@ -15,7 +15,7 @@
diff --git a/docs/LocalAuth.html b/docs/LocalAuth.html
index 54cb42a..5b844cc 100644
--- a/docs/LocalAuth.html
+++ b/docs/LocalAuth.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: LocalAuth
+ whatsapp-web.js 1.19.2 » Class: LocalAuth
@@ -15,7 +15,7 @@
diff --git a/docs/Location.html b/docs/Location.html
index fd1926c..f8acb1c 100644
--- a/docs/Location.html
+++ b/docs/Location.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: Location
+ whatsapp-web.js 1.19.2 » Class: Location
@@ -15,7 +15,7 @@
diff --git a/docs/Message.html b/docs/Message.html
index 1782545..fda9225 100644
--- a/docs/Message.html
+++ b/docs/Message.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: Message
+ whatsapp-web.js 1.19.2 » Class: Message
@@ -15,7 +15,7 @@
diff --git a/docs/MessageMedia.html b/docs/MessageMedia.html
index 33359d3..c7c0ba3 100644
--- a/docs/MessageMedia.html
+++ b/docs/MessageMedia.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: MessageMedia
+ whatsapp-web.js 1.19.2 » Class: MessageMedia
@@ -15,7 +15,7 @@
diff --git a/docs/NoAuth.html b/docs/NoAuth.html
index 119126a..90edbd3 100644
--- a/docs/NoAuth.html
+++ b/docs/NoAuth.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: NoAuth
+ whatsapp-web.js 1.19.2 » Class: NoAuth
@@ -15,7 +15,7 @@
diff --git a/docs/Order.html b/docs/Order.html
index ea747c4..0f3c164 100644
--- a/docs/Order.html
+++ b/docs/Order.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: Order
+ whatsapp-web.js 1.19.2 » Class: Order
@@ -15,7 +15,7 @@
diff --git a/docs/PrivateChat.html b/docs/PrivateChat.html
index f38ad1e..46b71c2 100644
--- a/docs/PrivateChat.html
+++ b/docs/PrivateChat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: PrivateChat
+ whatsapp-web.js 1.19.2 » Class: PrivateChat
@@ -15,7 +15,7 @@
diff --git a/docs/PrivateContact.html b/docs/PrivateContact.html
index 3473ea0..5b30b0b 100644
--- a/docs/PrivateContact.html
+++ b/docs/PrivateContact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: PrivateContact
+ whatsapp-web.js 1.19.2 » Class: PrivateContact
@@ -15,7 +15,7 @@
diff --git a/docs/Product.html b/docs/Product.html
index 457f833..aca2fa6 100644
--- a/docs/Product.html
+++ b/docs/Product.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: Product
+ whatsapp-web.js 1.19.2 » Class: Product
@@ -15,7 +15,7 @@
diff --git a/docs/Reaction.html b/docs/Reaction.html
index 0517004..09d99cb 100644
--- a/docs/Reaction.html
+++ b/docs/Reaction.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: Reaction
+ whatsapp-web.js 1.19.2 » Class: Reaction
@@ -15,7 +15,7 @@
diff --git a/docs/RemoteAuth.html b/docs/RemoteAuth.html
index 5f1baa7..6c881ec 100644
--- a/docs/RemoteAuth.html
+++ b/docs/RemoteAuth.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: RemoteAuth
+ whatsapp-web.js 1.19.2 » Class: RemoteAuth
@@ -15,7 +15,7 @@
diff --git a/docs/Util.html b/docs/Util.html
index 5083b76..5600fa0 100644
--- a/docs/Util.html
+++ b/docs/Util.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Class: Util
+ whatsapp-web.js 1.19.2 » Class: Util
@@ -15,7 +15,7 @@
diff --git a/docs/authStrategies_BaseAuthStrategy.js.html b/docs/authStrategies_BaseAuthStrategy.js.html
index 2db9523..386a4d4 100644
--- a/docs/authStrategies_BaseAuthStrategy.js.html
+++ b/docs/authStrategies_BaseAuthStrategy.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: authStrategies/BaseAuthStrategy.js
+ whatsapp-web.js 1.19.2 » Source: authStrategies/BaseAuthStrategy.js
@@ -15,7 +15,7 @@
diff --git a/docs/authStrategies_LegacySessionAuth.js.html b/docs/authStrategies_LegacySessionAuth.js.html
index ed0343d..3cd7411 100644
--- a/docs/authStrategies_LegacySessionAuth.js.html
+++ b/docs/authStrategies_LegacySessionAuth.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: authStrategies/LegacySessionAuth.js
+ whatsapp-web.js 1.19.2 » Source: authStrategies/LegacySessionAuth.js
@@ -15,7 +15,7 @@
diff --git a/docs/authStrategies_LocalAuth.js.html b/docs/authStrategies_LocalAuth.js.html
index 6320366..9fa3e14 100644
--- a/docs/authStrategies_LocalAuth.js.html
+++ b/docs/authStrategies_LocalAuth.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: authStrategies/LocalAuth.js
+ whatsapp-web.js 1.19.2 » Source: authStrategies/LocalAuth.js
@@ -15,7 +15,7 @@
diff --git a/docs/authStrategies_NoAuth.js.html b/docs/authStrategies_NoAuth.js.html
index 1be866f..b953e64 100644
--- a/docs/authStrategies_NoAuth.js.html
+++ b/docs/authStrategies_NoAuth.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: authStrategies/NoAuth.js
+ whatsapp-web.js 1.19.2 » Source: authStrategies/NoAuth.js
@@ -15,7 +15,7 @@
diff --git a/docs/authStrategies_RemoteAuth.js.html b/docs/authStrategies_RemoteAuth.js.html
index f7f48d2..54530aa 100644
--- a/docs/authStrategies_RemoteAuth.js.html
+++ b/docs/authStrategies_RemoteAuth.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: authStrategies/RemoteAuth.js
+ whatsapp-web.js 1.19.2 » Source: authStrategies/RemoteAuth.js
@@ -15,7 +15,7 @@
diff --git a/docs/global.html b/docs/global.html
index f599dc7..db11868 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Globals
+ whatsapp-web.js 1.19.2 » Globals
@@ -15,7 +15,7 @@
diff --git a/docs/index.html b/docs/index.html
index 7b3457e..7ea7f5f 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Home
+ whatsapp-web.js 1.19.2 » Home
@@ -15,7 +15,7 @@
@@ -27,7 +27,7 @@
diff --git a/docs/structures_Base.js.html b/docs/structures_Base.js.html
index 4e70ed7..e9fe853 100644
--- a/docs/structures_Base.js.html
+++ b/docs/structures_Base.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/Base.js
+ whatsapp-web.js 1.19.2 » Source: structures/Base.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_BusinessContact.js.html b/docs/structures_BusinessContact.js.html
index e7600cd..8599931 100644
--- a/docs/structures_BusinessContact.js.html
+++ b/docs/structures_BusinessContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/BusinessContact.js
+ whatsapp-web.js 1.19.2 » Source: structures/BusinessContact.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_Buttons.js.html b/docs/structures_Buttons.js.html
index 3a79b8d..81e9157 100644
--- a/docs/structures_Buttons.js.html
+++ b/docs/structures_Buttons.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/Buttons.js
+ whatsapp-web.js 1.19.2 » Source: structures/Buttons.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_Call.js.html b/docs/structures_Call.js.html
index 2c64c0a..1ada572 100644
--- a/docs/structures_Call.js.html
+++ b/docs/structures_Call.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/Call.js
+ whatsapp-web.js 1.19.2 » Source: structures/Call.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_Chat.js.html b/docs/structures_Chat.js.html
index 0fab4cb..59f32bb 100644
--- a/docs/structures_Chat.js.html
+++ b/docs/structures_Chat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/Chat.js
+ whatsapp-web.js 1.19.2 » Source: structures/Chat.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_ClientInfo.js.html b/docs/structures_ClientInfo.js.html
index 4c205c7..8645f82 100644
--- a/docs/structures_ClientInfo.js.html
+++ b/docs/structures_ClientInfo.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/ClientInfo.js
+ whatsapp-web.js 1.19.2 » Source: structures/ClientInfo.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_Contact.js.html b/docs/structures_Contact.js.html
index 2da1245..b220a2d 100644
--- a/docs/structures_Contact.js.html
+++ b/docs/structures_Contact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/Contact.js
+ whatsapp-web.js 1.19.2 » Source: structures/Contact.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_GroupChat.js.html b/docs/structures_GroupChat.js.html
index 7635f2e..fd3b90c 100644
--- a/docs/structures_GroupChat.js.html
+++ b/docs/structures_GroupChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/GroupChat.js
+ whatsapp-web.js 1.19.2 » Source: structures/GroupChat.js
@@ -15,7 +15,7 @@
@@ -90,10 +90,15 @@ class GroupChat extends Chat {
* @returns {Promise<Object>}
*/
async addParticipants(participantIds) {
- return await this.client.pupPage.evaluate((chatId, participantIds) => {
+ return await this.client.pupPage.evaluate(async (chatId, participantIds) => {
const chatWid = window.Store.WidFactory.createWid(chatId);
- const participantWids = participantIds.map(p => window.Store.WidFactory.createWid(p));
- return window.Store.GroupParticipants.sendAddParticipants(chatWid, participantWids);
+ const chat = await window.Store.Chat.find(chatWid);
+ const participants = await Promise.all(participantIds.map(async p => {
+ const wid = window.Store.WidFactory.createWid(p);
+ return await window.Store.Contact.get(wid);
+ }));
+ await window.Store.GroupParticipants.addParticipants(chat, participants);
+ return { status: 200 };
}, this.id._serialized, participantIds);
}
@@ -103,10 +108,14 @@ class GroupChat extends Chat {
* @returns {Promise<Object>}
*/
async removeParticipants(participantIds) {
- return await this.client.pupPage.evaluate((chatId, participantIds) => {
+ return await this.client.pupPage.evaluate(async (chatId, participantIds) => {
const chatWid = window.Store.WidFactory.createWid(chatId);
- const participantWids = participantIds.map(p => window.Store.WidFactory.createWid(p));
- return window.Store.GroupParticipants.sendRemoveParticipants(chatWid, participantWids);
+ const chat = await window.Store.Chat.find(chatWid);
+ const participants = participantIds.map(p => {
+ return chat.groupMetadata.participants.get(p);
+ }).filter(p => Boolean(p));
+ await window.Store.GroupParticipants.removeParticipants(chat, participants);
+ return { status: 200 };
}, this.id._serialized, participantIds);
}
@@ -116,10 +125,14 @@ class GroupChat extends Chat {
* @returns {Promise<{ status: number }>} Object with status code indicating if the operation was successful
*/
async promoteParticipants(participantIds) {
- return await this.client.pupPage.evaluate((chatId, participantIds) => {
+ return await this.client.pupPage.evaluate(async (chatId, participantIds) => {
const chatWid = window.Store.WidFactory.createWid(chatId);
- const participantWids = participantIds.map(p => window.Store.WidFactory.createWid(p));
- return window.Store.GroupParticipants.sendPromoteParticipants(chatWid, participantWids);
+ const chat = await window.Store.Chat.find(chatWid);
+ const participants = participantIds.map(p => {
+ return chat.groupMetadata.participants.get(p);
+ }).filter(p => Boolean(p));
+ await window.Store.GroupParticipants.promoteParticipants(chat, participants);
+ return { status: 200 };
}, this.id._serialized, participantIds);
}
@@ -129,10 +142,14 @@ class GroupChat extends Chat {
* @returns {Promise<{ status: number }>} Object with status code indicating if the operation was successful
*/
async demoteParticipants(participantIds) {
- return await this.client.pupPage.evaluate((chatId, participantIds) => {
+ return await this.client.pupPage.evaluate(async (chatId, participantIds) => {
const chatWid = window.Store.WidFactory.createWid(chatId);
- const participantWids = participantIds.map(p => window.Store.WidFactory.createWid(p));
- return window.Store.GroupParticipants.sendDemoteParticipants(chatWid, participantWids);
+ const chat = await window.Store.Chat.find(chatWid);
+ const participants = participantIds.map(p => {
+ return chat.groupMetadata.participants.get(p);
+ }).filter(p => Boolean(p));
+ await window.Store.GroupParticipants.demoteParticipants(chat, participants);
+ return { status: 200 };
}, this.id._serialized, participantIds);
}
@@ -145,7 +162,8 @@ class GroupChat extends Chat {
const success = await this.client.pupPage.evaluate(async (chatId, subject) => {
const chatWid = window.Store.WidFactory.createWid(chatId);
try {
- return await window.Store.GroupUtils.sendSetGroupSubject(chatWid, subject);
+ await window.Store.GroupUtils.setGroupSubject(chatWid, subject);
+ return true;
} catch (err) {
if(err.name === 'ServerStatusCodeError') return false;
throw err;
@@ -167,7 +185,8 @@ class GroupChat extends Chat {
const chatWid = window.Store.WidFactory.createWid(chatId);
let descId = window.Store.GroupMetadata.get(chatWid).descId;
try {
- return await window.Store.GroupUtils.sendSetGroupDescription(chatWid, description, window.Store.MsgKey.newId(), descId);
+ await window.Store.GroupUtils.setGroupDescription(chatWid, description, window.Store.MsgKey.newId(), descId);
+ return true;
} catch (err) {
if(err.name === 'ServerStatusCodeError') return false;
throw err;
@@ -188,7 +207,8 @@ class GroupChat extends Chat {
const success = await this.client.pupPage.evaluate(async (chatId, adminsOnly) => {
const chatWid = window.Store.WidFactory.createWid(chatId);
try {
- return await window.Store.GroupUtils.sendSetGroupProperty(chatWid, 'announcement', adminsOnly ? 1 : 0);
+ await window.Store.GroupUtils.setGroupProperty(chatWid, 'announcement', adminsOnly ? 1 : 0);
+ return true;
} catch (err) {
if(err.name === 'ServerStatusCodeError') return false;
throw err;
@@ -210,7 +230,8 @@ class GroupChat extends Chat {
const success = await this.client.pupPage.evaluate(async (chatId, adminsOnly) => {
const chatWid = window.Store.WidFactory.createWid(chatId);
try {
- return await window.Store.GroupUtils.sendSetGroupProperty(chatWid, 'restrict', adminsOnly ? 1 : 0);
+ await window.Store.GroupUtils.setGroupProperty(chatWid, 'restrict', adminsOnly ? 1 : 0);
+ return true;
} catch (err) {
if(err.name === 'ServerStatusCodeError') return false;
throw err;
@@ -228,12 +249,12 @@ class GroupChat extends Chat {
* @returns {Promise<string>} Group's invite code
*/
async getInviteCode() {
- const code = await this.client.pupPage.evaluate(async chatId => {
+ const codeRes = await this.client.pupPage.evaluate(async chatId => {
const chatWid = window.Store.WidFactory.createWid(chatId);
- return window.Store.Invite.sendQueryGroupInviteCode(chatWid);
+ return window.Store.Invite.queryGroupInviteCode(chatWid);
}, this.id._serialized);
- return code;
+ return codeRes.code;
}
/**
@@ -241,12 +262,12 @@ class GroupChat extends Chat {
* @returns {Promise<string>} New invite code
*/
async revokeInvite() {
- const code = await this.client.pupPage.evaluate(chatId => {
+ const codeRes = await this.client.pupPage.evaluate(chatId => {
const chatWid = window.Store.WidFactory.createWid(chatId);
- return window.Store.Invite.sendRevokeGroupInviteCode(chatWid);
+ return window.Store.Invite.resetGroupInviteCode(chatWid);
}, this.id._serialized);
- return code;
+ return codeRes.code;
}
/**
@@ -254,9 +275,10 @@ class GroupChat extends Chat {
* @returns {Promise}
*/
async leave() {
- await this.client.pupPage.evaluate(chatId => {
+ await this.client.pupPage.evaluate(async chatId => {
const chatWid = window.Store.WidFactory.createWid(chatId);
- return window.Store.GroupUtils.sendExitGroup(chatWid);
+ const chat = await window.Store.Chat.find(chatWid);
+ return window.Store.GroupUtils.sendExitGroup(chat);
}, this.id._serialized);
}
diff --git a/docs/structures_GroupNotification.js.html b/docs/structures_GroupNotification.js.html
index 882f1cd..907cdba 100644
--- a/docs/structures_GroupNotification.js.html
+++ b/docs/structures_GroupNotification.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/GroupNotification.js
+ whatsapp-web.js 1.19.2 » Source: structures/GroupNotification.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_Label.js.html b/docs/structures_Label.js.html
index 84fe4a5..9bdcc3f 100644
--- a/docs/structures_Label.js.html
+++ b/docs/structures_Label.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/Label.js
+ whatsapp-web.js 1.19.2 » Source: structures/Label.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_List.js.html b/docs/structures_List.js.html
index 5b90208..c50fa7e 100644
--- a/docs/structures_List.js.html
+++ b/docs/structures_List.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/List.js
+ whatsapp-web.js 1.19.2 » Source: structures/List.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_Location.js.html b/docs/structures_Location.js.html
index 5d66947..2c81b9d 100644
--- a/docs/structures_Location.js.html
+++ b/docs/structures_Location.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/Location.js
+ whatsapp-web.js 1.19.2 » Source: structures/Location.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_Message.js.html b/docs/structures_Message.js.html
index 0c4d051..0d8eb4f 100644
--- a/docs/structures_Message.js.html
+++ b/docs/structures_Message.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/Message.js
+ whatsapp-web.js 1.19.2 » Source: structures/Message.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_MessageMedia.js.html b/docs/structures_MessageMedia.js.html
index 499f7cf..4dc3d5a 100644
--- a/docs/structures_MessageMedia.js.html
+++ b/docs/structures_MessageMedia.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/MessageMedia.js
+ whatsapp-web.js 1.19.2 » Source: structures/MessageMedia.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_Order.js.html b/docs/structures_Order.js.html
index 9ad5d7e..fd44444 100644
--- a/docs/structures_Order.js.html
+++ b/docs/structures_Order.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/Order.js
+ whatsapp-web.js 1.19.2 » Source: structures/Order.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_Payment.js.html b/docs/structures_Payment.js.html
index e934dd1..ef6c307 100644
--- a/docs/structures_Payment.js.html
+++ b/docs/structures_Payment.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/Payment.js
+ whatsapp-web.js 1.19.2 » Source: structures/Payment.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_PrivateChat.js.html b/docs/structures_PrivateChat.js.html
index b7af145..d95fc6e 100644
--- a/docs/structures_PrivateChat.js.html
+++ b/docs/structures_PrivateChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/PrivateChat.js
+ whatsapp-web.js 1.19.2 » Source: structures/PrivateChat.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_PrivateContact.js.html b/docs/structures_PrivateContact.js.html
index 7aec0d9..13abf4a 100644
--- a/docs/structures_PrivateContact.js.html
+++ b/docs/structures_PrivateContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/PrivateContact.js
+ whatsapp-web.js 1.19.2 » Source: structures/PrivateContact.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_Product.js.html b/docs/structures_Product.js.html
index 9e78871..1591885 100644
--- a/docs/structures_Product.js.html
+++ b/docs/structures_Product.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/Product.js
+ whatsapp-web.js 1.19.2 » Source: structures/Product.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_ProductMetadata.js.html b/docs/structures_ProductMetadata.js.html
index ba7f554..ac7fca6 100644
--- a/docs/structures_ProductMetadata.js.html
+++ b/docs/structures_ProductMetadata.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/ProductMetadata.js
+ whatsapp-web.js 1.19.2 » Source: structures/ProductMetadata.js
@@ -15,7 +15,7 @@
diff --git a/docs/structures_Reaction.js.html b/docs/structures_Reaction.js.html
index 6b47024..0eb2f2c 100644
--- a/docs/structures_Reaction.js.html
+++ b/docs/structures_Reaction.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: structures/Reaction.js
+ whatsapp-web.js 1.19.2 » Source: structures/Reaction.js
@@ -15,7 +15,7 @@
diff --git a/docs/util_Constants.js.html b/docs/util_Constants.js.html
index 12a26d5..c5ca2aa 100644
--- a/docs/util_Constants.js.html
+++ b/docs/util_Constants.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: util/Constants.js
+ whatsapp-web.js 1.19.2 » Source: util/Constants.js
@@ -15,7 +15,7 @@
diff --git a/docs/util_InterfaceController.js.html b/docs/util_InterfaceController.js.html
index 02b7dc3..4de61c7 100644
--- a/docs/util_InterfaceController.js.html
+++ b/docs/util_InterfaceController.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: util/InterfaceController.js
+ whatsapp-web.js 1.19.2 » Source: util/InterfaceController.js
@@ -15,7 +15,7 @@
diff --git a/docs/util_Util.js.html b/docs/util_Util.js.html
index 5f19a8f..ca4ad46 100644
--- a/docs/util_Util.js.html
+++ b/docs/util_Util.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.19.1 » Source: util/Util.js
+ whatsapp-web.js 1.19.2 » Source: util/Util.js
@@ -15,7 +15,7 @@
diff --git a/package.json b/package.json
index a396b2d..40d37e3 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "whatsapp-web.js",
- "version": "1.19.1",
+ "version": "1.19.2",
"description": "Library for interacting with the WhatsApp Web API ",
"main": "./index.js",
"typings": "./index.d.ts",