diff --git a/index.d.ts b/index.d.ts index 81824c3..ce4c1ad 100644 --- a/index.d.ts +++ b/index.d.ts @@ -465,6 +465,8 @@ declare namespace WAWebJS { isForwarded: boolean, /** Location information contained in the message, if the message is type "location" */ location: Location, + /** List of vCards contained in the message */ + vCards: string[], /** MediaKey that represents the sticker 'ID' */ mediaKey?: string, /** Indicates the mentions in the message body. */ diff --git a/src/structures/Message.js b/src/structures/Message.js index 4eaaba2..5e259a0 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -117,6 +117,12 @@ class Message extends Base { */ this.location = data.type === MessageTypes.LOCATION ? new Location(data.lat, data.lng, data.loc) : undefined; + /** + * List of vCards contained in the message. + * @type {Array} + */ + this.vCards = data.type === MessageTypes.CONTACT_CARD_MULTI ? data.vcardList.map((c) => c.vcard) : data.type === MessageTypes.CONTACT_CARD ? [data.body] : []; + /** * Indicates the mentions in the message body. * @type {Array}