Skip to content

Commit

Permalink
Added message duration in seconds (#1230)
Browse files Browse the repository at this point in the history
Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
  • Loading branch information
Yarondr and pedroslopez committed Feb 28, 2022
1 parent 9fe9169 commit 52c8336
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
6 changes: 6 additions & 0 deletions src/structures/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 52c8336

Please sign in to comment.