From b1bb259da3e9beb21ea4418336f443382ffcf8ed Mon Sep 17 00:00:00 2001 From: BenyFilho <168232825+BenyFilho@users.noreply.github.com> Date: Sat, 20 Jun 2026 13:08:57 -0300 Subject: [PATCH 1/6] add @all to mention --- index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 13051ee264c..c9d2fbc376e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1566,8 +1566,8 @@ declare namespace WAWebJS { caption?: string; /** Id of the message that is being quoted (or replied to) */ quotedMessageId?: string; - /** User IDs to mention in the message */ - mentions?: string[]; + /** User IDs to mention in the message or string @all to mention everybody */ + mentions?: string[] | string; /** An array of object that handle group mentions */ groupMentions?: { /** The name of a group to mention (can be custom) */ From 473325fc6dac218326d6eeedb88505b214eb8f83 Mon Sep 17 00:00:00 2001 From: BenyFilho <168232825+BenyFilho@users.noreply.github.com> Date: Sat, 20 Jun 2026 13:13:18 -0300 Subject: [PATCH 2/6] add @all to mention --- src/Client.js | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/Client.js b/src/Client.js index 525c4031ae9..2a19a291471 100644 --- a/src/Client.js +++ b/src/Client.js @@ -1433,22 +1433,29 @@ class Client extends EventEmitter { } if (options.mentions) { - !Array.isArray(options.mentions) && - (options.mentions = [options.mentions]); if ( - options.mentions.some( - (possiblyContact) => possiblyContact instanceof Contact, - ) + options.mentions !== '@all' && + !Array.isArray(options.mentions) ) { - console.warn( - 'Mentions with an array of Contact are now deprecated. See more at https://github.com/wwebjssapp-web.js/pull/2166.', - ); - options.mentions = options.mentions.map( - (a) => a.id._serialized, - ); + options.mentions = [options.mentions]; } - } + if (Array.isArray(options.mentions)) { + if ( + options.mentions.some( + (possiblyContact) => possiblyContact instanceof Contact, + ) + ) { + console.warn( + 'Mentions with an array of Contact are now deprecated. See more at https://github.com/wwebjssapp-web.js/pull/2166.', + ); + options.mentions = options.mentions.map( + (a) => a.id._serialized, + ); + } + } + } + options.groupMentions && !Array.isArray(options.groupMentions) && (options.groupMentions = [options.groupMentions]); From d4f2779ee27cc315ea497d2dd08324d0adb2e69a Mon Sep 17 00:00:00 2001 From: BenyFilho <168232825+BenyFilho@users.noreply.github.com> Date: Sat, 20 Jun 2026 13:16:05 -0300 Subject: [PATCH 3/6] add @all to mention --- src/util/Injected/Utils.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/util/Injected/Utils.js b/src/util/Injected/Utils.js index 540078a9d07..f43e5e7e8e3 100644 --- a/src/util/Injected/Utils.js +++ b/src/util/Injected/Utils.js @@ -203,11 +203,22 @@ exports.LoadUtils = () => { delete options.quotedMessageId; } + let mentionAll = {}; if (options.mentionedJidList) { - options.mentionedJidList = options.mentionedJidList.map((id) => - window.require('WAWebWidFactory').createWid(id), - ); - options.mentionedJidList = options.mentionedJidList.filter(Boolean); + if (options.mentionedJidList === '@all') { + mentionAll = { nonJidMentions: 1 }; + } else if (Array.isArray(options.mentionedJidList)) { + if (options.mentionedJidList.includes('@all')) { + options.mentionedJidList = options.mentionedJidList.filter( + (id) => id !== '@all', + ); + } + options.mentionedJidList = options.mentionedJidList.map((id) => + window.require('WAWebWidFactory').createWid(id), + ); + options.mentionedJidList = + options.mentionedJidList.filter(Boolean); + } } if (options.groupMentions) { @@ -480,6 +491,7 @@ exports.LoadUtils = () => { ...buttonOptions, ...listOptions, ...botOptions, + ...mentionAll, ...extraOptions, }; From 55a7dd09d0e6c102ac4fb5b3c6fa4eee6b45a3ab Mon Sep 17 00:00:00 2001 From: BenyFilho <168232825+BenyFilho@users.noreply.github.com> Date: Sat, 20 Jun 2026 13:19:47 -0300 Subject: [PATCH 4/6] add @all to mention --- src/Client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.js b/src/Client.js index 2a19a291471..0fa3678f5d6 100644 --- a/src/Client.js +++ b/src/Client.js @@ -1455,7 +1455,7 @@ class Client extends EventEmitter { } } } - + options.groupMentions && !Array.isArray(options.groupMentions) && (options.groupMentions = [options.groupMentions]); From f5071adddbe65fcf67f51cf84e954949ba90448d Mon Sep 17 00:00:00 2001 From: BenyFilho <168232825+BenyFilho@users.noreply.github.com> Date: Sat, 27 Jun 2026 12:50:15 -0300 Subject: [PATCH 5/6] Fixing error recent changes --- src/util/Injected/Utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/Injected/Utils.js b/src/util/Injected/Utils.js index 344ffc049cc..885b923e782 100644 --- a/src/util/Injected/Utils.js +++ b/src/util/Injected/Utils.js @@ -207,6 +207,7 @@ exports.LoadUtils = () => { if (options.mentionedJidList) { if (options.mentionedJidList === '@all') { mentionAll = { nonJidMentions: 1 }; + options.mentionedJidList = []; } else if (Array.isArray(options.mentionedJidList)) { if (options.mentionedJidList.includes('@all')) { options.mentionedJidList = options.mentionedJidList.filter( From 05765952aac1f9258568d8c48576750c8fe787ec Mon Sep 17 00:00:00 2001 From: BenyFilho <168232825+BenyFilho@users.noreply.github.com> Date: Thu, 9 Jul 2026 10:46:52 -0300 Subject: [PATCH 6/6] Fixing the link --- src/Client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.js b/src/Client.js index ee11eccc578..c9c1c1e8dd4 100644 --- a/src/Client.js +++ b/src/Client.js @@ -1506,7 +1506,7 @@ class Client extends EventEmitter { ) ) { console.warn( - 'Mentions with an array of Contact are now deprecated. See more at https://github.com/wwebjssapp-web.js/pull/2166.', + 'Mentions with an array of Contact are now deprecated. See more at https://github.com/wwebjs/whatsapp-web.js/pull/2166.', ); options.mentions = options.mentions.map( (a) => a.id._serialized,