Added message duration in seconds (#1230)

Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
This commit is contained in:
YaronD 2022-02-28 04:30:47 +02:00 • committed by GitHub
commit 52c8336236
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

2
index.d.ts vendored
View file

@ -615,6 +615,8 @@ declare namespace WAWebJS {
hasMedia: boolean,
/** Indicates if the message was sent as a reply to another message */
hasQuotedMsg: boolean,
/** Indicates the duration of the message in seconds */
duration: string,
/** ID that represents the message */
id: MessageId,
/** Indicates if the message was forwarded */

View file

@ -134,6 +134,12 @@ class Message extends Base {
*/
this.hasQuotedMsg = data.quotedMsg ? true : false;
/**
* Indicates the duration of the message in seconds
* @type {string}
*/
this.duration = data.duration ? data.duration : undefined;
/**
* Location information contained in the message, if the message is type "location"
* @type {Location}