Add isGif to message._patch (#963)

* Update Message.js

Add isGif to the message data

* add typings

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
Co-authored-by: Pedro Lopez <pedroslopez@me.com>
This commit is contained in:
shirser121
2021-12-13 03:57:11 +02:00
committed by GitHub
parent d7a493e68a
commit 46ba9c5e9a
2 changed files with 8 additions and 0 deletions

2
index.d.ts vendored
View File

@@ -525,6 +525,8 @@ declare namespace WAWebJS {
broadcast: boolean,
/** Indicates if the message was a status update */
isStatus: boolean,
/** Indicates if the message is a Gif */
isGif: boolean,
/** ID for the Chat that this message was sent to, except if the message was sent by the current user */
from: string,
/** Indicates if the message was sent by the current user */

View File

@@ -179,6 +179,12 @@ class Message extends Base {
*/
this.token = data.token ? data.token : undefined;
/**
* Indicates whether the message is a Gif
* @type {boolean}
*/
this.isGif = Boolean(data.isGif);
/** Title */
if (data.title) {
this.title = data.title;