@@ -133,6 +142,13 @@
Inherited from
Contact#id
+
isBlocked
+ unknown
+
Indicates if you have blocked this contact
+
+ - Inherited from
+ - Contact#isBlocked
+
isBusiness
unknown
Indicates if the contact is a business contact
@@ -213,6 +229,15 @@
Methods
+ async
+ block() → Promise containing boolean
+ Blocks this contact from WhatsApp
+
+ - Inherited from
+ - Contact#block
+ - Returns
+
+
async
getChat() → Promise containing Chat
Returns the Chat that corresponds to this Contact.
@@ -232,6 +257,15 @@
Returns
+ async
+ unblock() → Promise containing boolean
+ Unblocks this contact from WhatsApp
+
+ - Inherited from
+ - Contact#unblock
+ - Returns
+
+
@@ -242,7 +276,7 @@
diff --git a/docs/Chat.html b/docs/Chat.html
index 330f1c3..31467e5 100644
--- a/docs/Chat.html
+++ b/docs/Chat.html
@@ -4,7 +4,7 @@
-
whatsapp-web.js 1.10.0 » Class: Chat
+
whatsapp-web.js 1.11.0 » Class: Chat
@@ -15,7 +15,7 @@
@@ -457,7 +457,7 @@
diff --git a/docs/Client.html b/docs/Client.html
index 07128ae..6239487 100644
--- a/docs/Client.html
+++ b/docs/Client.html
@@ -4,7 +4,7 @@
-
whatsapp-web.js 1.10.0 » Class: Client
+
whatsapp-web.js 1.11.0 » Class: Client
@@ -15,7 +15,7 @@
@@ -905,7 +905,7 @@
content
- (string, MessageMedia, or Location)
+ (string, MessageMedia, Location, Contact, or Array of Contact)
|
@@ -1748,7 +1748,7 @@
diff --git a/docs/Client.js.html b/docs/Client.js.html
index 2da8182..4626f21 100644
--- a/docs/Client.js.html
+++ b/docs/Client.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: Client.js
+ whatsapp-web.js 1.11.0 » Source: Client.js
@@ -15,7 +15,7 @@
@@ -451,6 +451,7 @@ class Client extends EventEmitter {
* @typedef {Object} MessageSendOptions
* @property {boolean} [linkPreview=true] - Show links preview
* @property {boolean} [sendAudioAsVoice=false] - Send audio as voice message
+ * @property {boolean} [parseVCards=true] - Automatically parse vCards and send them as contacts
* @property {string} [caption] - Image or video caption
* @property {string} [quotedMessageId] - Id of the message that is being quoted (or replied to)
* @property {Contact[]} [mentions] - Contacts that are being mentioned in the message
@@ -461,7 +462,7 @@ class Client extends EventEmitter {
/**
* Send a message to a specific chatId
* @param {string} chatId
- * @param {string|MessageMedia|Location} content
+ * @param {string|MessageMedia|Location|Contact|Array<Contact>} content
* @param {MessageSendOptions} [options] - Options used when sending the message
*
* @returns {Promise<Message>} Message that was just sent
@@ -472,6 +473,7 @@ class Client extends EventEmitter {
sendAudioAsVoice: options.sendAudioAsVoice,
caption: options.caption,
quotedMessageId: options.quotedMessageId,
+ parseVCards: options.parseVCards === false ? false : true,
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact => contact.id._serialized) : []
};
@@ -487,6 +489,12 @@ class Client extends EventEmitter {
} else if (content instanceof Location) {
internalOptions.location = content;
content = '';
+ } else if(content instanceof Contact) {
+ internalOptions.contactCard = content.id._serialized;
+ content = '';
+ } else if(Array.isArray(content) && content.length > 0 && content[0] instanceof Contact) {
+ internalOptions.contactCardList = content.map(contact => contact.id._serialized);
+ content = '';
}
const newMessage = await this.pupPage.evaluate(async (chatId, message, options, sendSeen) => {
@@ -785,7 +793,7 @@ module.exports = Client;
diff --git a/docs/ClientInfo.html b/docs/ClientInfo.html
index 52d01dc..1076efe 100644
--- a/docs/ClientInfo.html
+++ b/docs/ClientInfo.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Class: ClientInfo
+ whatsapp-web.js 1.11.0 » Class: ClientInfo
@@ -15,7 +15,7 @@
@@ -58,6 +58,11 @@
@@ -90,8 +95,9 @@
me
object
- Current user ID
+ - Deprecated
+ - Use .wid instead
phone
object
@@ -193,6 +199,11 @@
Name configured to be shown in push notifications
+ wid
+ object
+ Current user ID
+
+
Method
@@ -224,7 +235,7 @@
diff --git a/docs/Contact.html b/docs/Contact.html
index 1a2886a..033ae65 100644
--- a/docs/Contact.html
+++ b/docs/Contact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Class: Contact
+ whatsapp-web.js 1.11.0 » Class: Contact
@@ -15,7 +15,7 @@
@@ -42,6 +42,9 @@
id
+ isBlocked
+
+
isBusiness
@@ -67,13 +70,13 @@
isWAContact
+ name
+
+
- - name
- -
-
- number
-
@@ -92,6 +95,9 @@
@@ -124,6 +133,11 @@
ID that represents the contact
+ isBlocked
+ boolean
+ Indicates if you have blocked this contact
+
+
isBusiness
boolean
Indicates if the contact is a business contact
@@ -182,6 +196,15 @@
Methods
+ async
+ block() → Promise containing boolean
+ Blocks this contact from WhatsApp
+
+ - Returns
+ -
+
Promise containing boolean
+
+
async
getChat() → Promise containing Chat
Returns the Chat that corresponds to this Contact.
@@ -201,6 +224,15 @@
Promise containing string
+ async
+ unblock() → Promise containing boolean
+ Unblocks this contact from WhatsApp
+
+ - Returns
+ -
+
Promise containing boolean
+
+
@@ -211,7 +243,7 @@
diff --git a/docs/GroupChat.html b/docs/GroupChat.html
index 0ebf9cb..59e5783 100644
--- a/docs/GroupChat.html
+++ b/docs/GroupChat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Class: GroupChat
+ whatsapp-web.js 1.11.0 » Class: GroupChat
@@ -15,7 +15,7 @@
@@ -854,7 +854,7 @@
diff --git a/docs/GroupNotification.html b/docs/GroupNotification.html
index d0f17a2..b4f345c 100644
--- a/docs/GroupNotification.html
+++ b/docs/GroupNotification.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Class: GroupNotification
+ whatsapp-web.js 1.11.0 » Class: GroupNotification
@@ -15,7 +15,7 @@
@@ -233,7 +233,7 @@
diff --git a/docs/InterfaceController.html b/docs/InterfaceController.html
index 013b46b..71184ff 100644
--- a/docs/InterfaceController.html
+++ b/docs/InterfaceController.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Class: InterfaceController
+ whatsapp-web.js 1.11.0 » Class: InterfaceController
@@ -15,7 +15,7 @@
@@ -187,7 +187,7 @@
diff --git a/docs/Location.html b/docs/Location.html
index 28cbbf3..3019152 100644
--- a/docs/Location.html
+++ b/docs/Location.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Class: Location
+ whatsapp-web.js 1.11.0 » Class: Location
@@ -15,7 +15,7 @@
@@ -149,7 +149,7 @@
diff --git a/docs/Message.html b/docs/Message.html
index ecd7555..7dffecd 100644
--- a/docs/Message.html
+++ b/docs/Message.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Class: Message
+ whatsapp-web.js 1.11.0 » Class: Message
@@ -15,7 +15,7 @@
@@ -73,16 +73,19 @@
- isForwarded
-
- - location
+ - isStatus
-
- - mediaKey
+ - location
-
+ - mediaKey
+ -
+
- mentionedIds
-
@@ -201,6 +204,11 @@
Indicates if the message was forwarded
+ isStatus
+ boolean
+ Indicates if the message is a status update
+
+
Location information contained in the message, if the message is type "location"
@@ -427,7 +435,7 @@
diff --git a/docs/MessageMedia.html b/docs/MessageMedia.html
index 5a47abf..a3d3211 100644
--- a/docs/MessageMedia.html
+++ b/docs/MessageMedia.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Class: MessageMedia
+ whatsapp-web.js 1.11.0 » Class: MessageMedia
@@ -15,7 +15,7 @@
@@ -208,7 +208,7 @@
diff --git a/docs/PrivateChat.html b/docs/PrivateChat.html
index 00ae729..bf60775 100644
--- a/docs/PrivateChat.html
+++ b/docs/PrivateChat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Class: PrivateChat
+ whatsapp-web.js 1.11.0 » Class: PrivateChat
@@ -15,7 +15,7 @@
@@ -497,7 +497,7 @@
diff --git a/docs/PrivateContact.html b/docs/PrivateContact.html
index 238363d..69948ff 100644
--- a/docs/PrivateContact.html
+++ b/docs/PrivateContact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Class: PrivateContact
+ whatsapp-web.js 1.11.0 » Class: PrivateContact
@@ -15,7 +15,7 @@
@@ -42,6 +42,9 @@
- id
-
+ - isBlocked
+ -
+
- isBusiness
-
@@ -67,13 +70,13 @@
- isWAContact
-
+ - name
+ -
+
- - name
- -
-
- number
-
@@ -92,6 +95,9 @@
@@ -126,6 +135,13 @@
- Inherited from
- Contact#id
+ isBlocked
+ unknown
+ Indicates if you have blocked this contact
+
+ - Inherited from
+ - Contact#isBlocked
+
isBusiness
unknown
Indicates if the contact is a business contact
@@ -206,6 +222,15 @@
Methods
+ async
+ block() → Promise containing boolean
+ Blocks this contact from WhatsApp
+
+ - Inherited from
+ - Contact#block
+ - Returns
+
+
async
getChat() → Promise containing Chat
Returns the Chat that corresponds to this Contact.
@@ -225,6 +250,15 @@
- Returns
+ async
+ unblock() → Promise containing boolean
+ Unblocks this contact from WhatsApp
+
+ - Inherited from
+ - Contact#unblock
+ - Returns
+
+
@@ -235,7 +269,7 @@
diff --git a/docs/Util.html b/docs/Util.html
index b000943..7f21196 100644
--- a/docs/Util.html
+++ b/docs/Util.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Class: Util
+ whatsapp-web.js 1.11.0 » Class: Util
@@ -15,7 +15,7 @@
@@ -50,7 +50,7 @@
diff --git a/docs/global.html b/docs/global.html
index f729cb8..37418f6 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Globals
+ whatsapp-web.js 1.11.0 » Globals
@@ -15,7 +15,7 @@
@@ -1071,6 +1071,21 @@
Defaults to false.
|
+
+ |
+ parseVCards
+ |
+
+ boolean
+ |
+
+ Yes
+ |
+
+ Automatically parse vCards and send them as contacts
+ Defaults to true.
+ |
+
|
caption
@@ -1157,7 +1172,7 @@
diff --git a/docs/index.html b/docs/index.html
index 1696490..18f6ce5 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Home
+ whatsapp-web.js 1.11.0 » Home
@@ -15,7 +15,7 @@
@@ -27,7 +27,7 @@
@@ -96,7 +96,7 @@ client.initialize();
|
| Send contact cards |
- pending |
+ ✅ |
| Send location |
@@ -122,6 +122,10 @@ client.initialize();
Modify group info (subject, description) |
✅ |
+
+ | Modify group settings (send messages, edit info) |
+ ✅ |
+
| Add group participants |
✅ |
@@ -142,6 +146,10 @@ client.initialize();
Mute/unmute chats |
✅ |
+
+ | Block/unblock contacts |
+ ✅ |
+
| Get contact info |
✅ |
@@ -217,6 +225,11 @@ client.initialize();
+
+ BusinessContact#block()
+
+
+
BusinessContact#businessProfile
@@ -238,7 +251,7 @@ client.initialize();
- BusinessContact#isBusiness
+ BusinessContact#isBlocked
@@ -246,6 +259,11 @@ client.initialize();
@@ -743,24 +766,20 @@ client.initialize();
-
-
-
+
-
+
@@ -787,6 +815,11 @@ client.initialize();
+
+ Contact#block()
+
+
+
Contact#getChat()
@@ -803,7 +836,7 @@ client.initialize();
- Contact#isBusiness
+ Contact#isBlocked
@@ -811,6 +844,11 @@ client.initialize();
@@ -1523,6 +1566,11 @@ client.initialize();
@@ -2124,7 +2187,7 @@ client.initialize();
diff --git a/docs/structures_Base.js.html b/docs/structures_Base.js.html
index b297db1..fa17afb 100644
--- a/docs/structures_Base.js.html
+++ b/docs/structures_Base.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: structures/Base.js
+ whatsapp-web.js 1.11.0 » Source: structures/Base.js
@@ -15,7 +15,7 @@
@@ -60,7 +60,7 @@ module.exports = Base;
diff --git a/docs/structures_BusinessContact.js.html b/docs/structures_BusinessContact.js.html
index 0a42b2a..2ff1226 100644
--- a/docs/structures_BusinessContact.js.html
+++ b/docs/structures_BusinessContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: structures/BusinessContact.js
+ whatsapp-web.js 1.11.0 » Source: structures/BusinessContact.js
@@ -15,7 +15,7 @@
@@ -59,7 +59,7 @@ module.exports = BusinessContact;
diff --git a/docs/structures_Chat.js.html b/docs/structures_Chat.js.html
index a61453a..a641e73 100644
--- a/docs/structures_Chat.js.html
+++ b/docs/structures_Chat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: structures/Chat.js
+ whatsapp-web.js 1.11.0 » Source: structures/Chat.js
@@ -15,7 +15,7 @@
@@ -272,7 +272,7 @@ module.exports = Chat;
diff --git a/docs/structures_ClientInfo.js.html b/docs/structures_ClientInfo.js.html
index 13a9ad2..1c9e6ca 100644
--- a/docs/structures_ClientInfo.js.html
+++ b/docs/structures_ClientInfo.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: structures/ClientInfo.js
+ whatsapp-web.js 1.11.0 » Source: structures/ClientInfo.js
@@ -15,7 +15,7 @@
@@ -41,7 +41,7 @@ class ClientInfo extends Base {
constructor(client, data) {
super(client);
- if(data) this._patch(data);
+ if (data) this._patch(data);
}
_patch(data) {
@@ -51,11 +51,17 @@ class ClientInfo extends Base {
*/
this.pushname = data.pushname;
+ /**
+ * @type {object}
+ * @deprecated Use .wid instead
+ */
+ this.me = data.wid;
+
/**
* Current user ID
* @type {object}
*/
- this.me = data.me;
+ this.wid = data.wid;
/**
* Information about the phone this client is connected to
@@ -102,7 +108,7 @@ module.exports = ClientInfo;
diff --git a/docs/structures_Contact.js.html b/docs/structures_Contact.js.html
index d297d44..5e7faf6 100644
--- a/docs/structures_Contact.js.html
+++ b/docs/structures_Contact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: structures/Contact.js
+ whatsapp-web.js 1.11.0 » Source: structures/Contact.js
@@ -15,7 +15,7 @@
@@ -126,6 +126,12 @@ class Contact extends Base {
*/
this.isMyContact = data.isMyContact;
+ /**
+ * Indicates if you have blocked this contact
+ * @type {boolean}
+ */
+ this.isBlocked = data.isBlocked;
+
return super._patch(data);
}
@@ -147,6 +153,36 @@ class Contact extends Base {
return await this.client.getChatById(this.id._serialized);
}
+
+ /**
+ * Blocks this contact from WhatsApp
+ * @returns {Promise<boolean>}
+ */
+ async block() {
+ if(this.isGroup) return false;
+
+ await this.client.pupPage.evaluate(async (contactId) => {
+ const contact = window.Store.Contact.get(contactId);
+ await window.Store.BlockContact.blockContact(contact);
+ }, this.id._serialized);
+
+ return true;
+ }
+
+ /**
+ * Unblocks this contact from WhatsApp
+ * @returns {Promise<boolean>}
+ */
+ async unblock() {
+ if(this.isGroup) return false;
+
+ await this.client.pupPage.evaluate(async (contactId) => {
+ const contact = window.Store.Contact.get(contactId);
+ await window.Store.BlockContact.unblockContact(contact);
+ }, this.id._serialized);
+
+ return true;
+ }
}
@@ -160,7 +196,7 @@ module.exports = Contact;
diff --git a/docs/structures_GroupChat.js.html b/docs/structures_GroupChat.js.html
index 8eeaf9e..3edd584 100644
--- a/docs/structures_GroupChat.js.html
+++ b/docs/structures_GroupChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: structures/GroupChat.js
+ whatsapp-web.js 1.11.0 » Source: structures/GroupChat.js
@@ -15,7 +15,7 @@
@@ -221,7 +221,7 @@ module.exports = GroupChat;
diff --git a/docs/structures_GroupNotification.js.html b/docs/structures_GroupNotification.js.html
index 66ac1bb..fc7fe8c 100644
--- a/docs/structures_GroupNotification.js.html
+++ b/docs/structures_GroupNotification.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: structures/GroupNotification.js
+ whatsapp-web.js 1.11.0 » Source: structures/GroupNotification.js
@@ -15,7 +15,7 @@
@@ -143,7 +143,7 @@ module.exports = GroupNotification;
diff --git a/docs/structures_Location.js.html b/docs/structures_Location.js.html
index 7fc4a3c..6bab363 100644
--- a/docs/structures_Location.js.html
+++ b/docs/structures_Location.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: structures/Location.js
+ whatsapp-web.js 1.11.0 » Source: structures/Location.js
@@ -15,7 +15,7 @@
@@ -71,7 +71,7 @@ module.exports = Location;
diff --git a/docs/structures_Message.js.html b/docs/structures_Message.js.html
index ab6cfa9..8a48185 100644
--- a/docs/structures_Message.js.html
+++ b/docs/structures_Message.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: structures/Message.js
+ whatsapp-web.js 1.11.0 » Source: structures/Message.js
@@ -15,7 +15,7 @@
@@ -118,6 +118,12 @@ class Message extends Base {
*/
this.isForwarded = data.isForwarded;
+ /**
+ * Indicates if the message is a status update
+ * @type {boolean}
+ */
+ this.isStatus = data.isStatusV3;
+
/**
* Indicates if the message was a broadcast
* @type {boolean}
@@ -304,7 +310,7 @@ module.exports = Message;
diff --git a/docs/structures_MessageMedia.js.html b/docs/structures_MessageMedia.js.html
index 93e065a..46e34c5 100644
--- a/docs/structures_MessageMedia.js.html
+++ b/docs/structures_MessageMedia.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: structures/MessageMedia.js
+ whatsapp-web.js 1.11.0 » Source: structures/MessageMedia.js
@@ -15,7 +15,7 @@
@@ -86,7 +86,7 @@ module.exports = MessageMedia;
diff --git a/docs/structures_PrivateChat.js.html b/docs/structures_PrivateChat.js.html
index b9dc0d3..d9c54de 100644
--- a/docs/structures_PrivateChat.js.html
+++ b/docs/structures_PrivateChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: structures/PrivateChat.js
+ whatsapp-web.js 1.11.0 » Source: structures/PrivateChat.js
@@ -15,7 +15,7 @@
@@ -51,7 +51,7 @@ module.exports = PrivateChat;
diff --git a/docs/structures_PrivateContact.js.html b/docs/structures_PrivateContact.js.html
index 0b521b6..ccf3be1 100644
--- a/docs/structures_PrivateContact.js.html
+++ b/docs/structures_PrivateContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: structures/PrivateContact.js
+ whatsapp-web.js 1.11.0 » Source: structures/PrivateContact.js
@@ -15,7 +15,7 @@
@@ -51,7 +51,7 @@ module.exports = PrivateContact;
diff --git a/docs/util_Constants.js.html b/docs/util_Constants.js.html
index 03492c5..c1da94f 100644
--- a/docs/util_Constants.js.html
+++ b/docs/util_Constants.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: util/Constants.js
+ whatsapp-web.js 1.11.0 » Source: util/Constants.js
@@ -15,7 +15,7 @@
@@ -173,7 +173,7 @@ exports.MessageAck = {
diff --git a/docs/util_InterfaceController.js.html b/docs/util_InterfaceController.js.html
index 00e3573..4d17ae4 100644
--- a/docs/util_InterfaceController.js.html
+++ b/docs/util_InterfaceController.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: util/InterfaceController.js
+ whatsapp-web.js 1.11.0 » Source: util/InterfaceController.js
@@ -15,7 +15,7 @@
@@ -94,7 +94,7 @@ module.exports = InterfaceController;
diff --git a/docs/util_Util.js.html b/docs/util_Util.js.html
index 8aa3297..174a81a 100644
--- a/docs/util_Util.js.html
+++ b/docs/util_Util.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.10.0 » Source: util/Util.js
+ whatsapp-web.js 1.11.0 » Source: util/Util.js
@@ -15,7 +15,7 @@
@@ -73,7 +73,7 @@ module.exports = Util;
diff --git a/index.d.ts b/index.d.ts
index fbce68f..81824c3 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -4,769 +4,774 @@ import puppeteer = require('puppeteer')
declare namespace WAWebJS {
- export class Client extends EventEmitter {
- constructor(options: ClientOptions)
+ export class Client extends EventEmitter {
+ constructor(options: ClientOptions)
+
+ /** Current connection information */
+ public info: ClientInfo
+
+ /**Accepts an invitation to join a group */
+ acceptInvite(inviteCode: string): Promise
+
+ /**Returns an object with information about the invite code's group */
+ getInviteInfo(inviteCode: string): Promise