feat: Send and receive location

This commit is contained in:
Pedro Lopez
2020-02-08 00:46:08 -04:00
parent 4b1768450f
commit 7b229a39a4
8 changed files with 66 additions and 3 deletions

View File

@@ -2,6 +2,8 @@
const Base = require('./Base');
const MessageMedia = require('./MessageMedia');
const Location = require('./Location');
const { MessageTypes } = require('../util/Constants');
/**
* Represents a Message on WhatsApp
@@ -90,6 +92,12 @@ class Message extends Base {
*/
this.hasQuotedMsg = data.quotedMsg ? true : false;
/**
* Location information contained in the message, if the message is type "location"
* @type {Location}
*/
this.location = data.type === MessageTypes.LOCATION ? new Location(data.lat, data.lng, data.loc) : undefined;
/**
* Indicates the mentions in the message body.
* @type {Array<string>}