diff --git a/index.d.ts b/index.d.ts index 156a3db..0a11f90 100644 --- a/index.d.ts +++ b/index.d.ts @@ -349,7 +349,7 @@ declare namespace WAWebJS { reply: (content: MessageContent, options?: MessageSendOptions) => Promise, } - + /** whatsapp web url */ export const WhatsWebURL: string @@ -545,7 +545,10 @@ declare namespace WAWebJS { /** Message type */ type: MessageTypes, /** Links included in the message. */ - links: string[], + links: Array<{ + link: string, + isSuspicious: boolean + }>, /** Order ID */ orderId: string, /** title */ diff --git a/src/structures/Message.js b/src/structures/Message.js index 90ac34c..d5c1e4f 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -200,7 +200,8 @@ class Message extends Base { /** * Links included in the message. - * @type {Array} + * @type {Array<{link: string, isSuspicious: boolean}>} + * */ this.links = data.links; diff --git a/src/util/Injected.js b/src/util/Injected.js index fa310b1..c5150ba 100644 --- a/src/util/Injected.js +++ b/src/util/Injected.js @@ -264,8 +264,7 @@ exports.LoadUtils = () => { const msg = message.serialize(); msg.isStatusV3 = message.isStatusV3; - msg.links = (message.getLinks()).map(link => link.href); - + msg.links = (message.getLinks()).map(link => ({ link: link.href, isSuspicious: link.suspiciousCharacters?.size ? true : false})); if (msg.buttons) { msg.buttons = msg.buttons.serialize(); } @@ -275,6 +274,7 @@ exports.LoadUtils = () => { return msg; }; + window.WWebJS.getChatModel = async chat => { let res = chat.serialize(); res.isGroup = chat.isGroup;