From 52c8336236d7df476320f57532b4ba37803b4df7 Mon Sep 17 00:00:00 2001 From: YaronD <47784310+Yarondr@users.noreply.github.com> Date: Mon, 28 Feb 2022 04:30:47 +0200 Subject: [PATCH] Added message duration in seconds (#1230) Co-authored-by: Pedro S. Lopez --- index.d.ts | 2 ++ src/structures/Message.js | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/index.d.ts b/index.d.ts index bdd7f54..70e7d99 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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 */ diff --git a/src/structures/Message.js b/src/structures/Message.js index 6a326b9..ea541fa 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -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}