From 9d715735ed7b4660de00133d466a3cc4c2d32ce5 Mon Sep 17 00:00:00 2001 From: Giancarlo Rocha Date: Sun, 11 Jul 2021 21:52:54 -0300 Subject: [PATCH] feat: message forwarding score (#716) --- index.d.ts | 5 +++++ src/structures/Message.js | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/index.d.ts b/index.d.ts index 03c223c..bc89809 100644 --- a/index.d.ts +++ b/index.d.ts @@ -517,6 +517,11 @@ declare namespace WAWebJS { id: MessageId, /** Indicates if the message was forwarded */ isForwarded: boolean, + /** + * Indicates how many times the message was forwarded. + * The maximum value is 127. + */ + forwardingScore: number, /** Indicates if the message was starred */ isStarred: boolean, /** Location information contained in the message, if the message is type "location" */ diff --git a/src/structures/Message.js b/src/structures/Message.js index 2d0b75e..90ac34c 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -94,6 +94,14 @@ class Message extends Base { */ this.isForwarded = data.isForwarded; + /** + * Indicates how many times the message was forwarded. + * + * The maximum value is 127. + * @type {number} + */ + this.forwardingScore = data.forwardingScore || 0; + /** * Indicates if the message is a status update * @type {boolean}