chore(): generate docs

This commit is contained in:
WWebJS Bot 2025-08-08 21:39:18 +00:00
commit 30b3f5e82e
77 changed files with 1732 additions and 368 deletions

View file

@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.11">
<meta charset="utf-8">
<title>whatsapp-web.js 1.31.1-alpha.0 &raquo; Source: structures/GroupChat.js</title>
<title>whatsapp-web.js 1.32.0 &raquo; Source: structures/GroupChat.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>31.<wbr>1-alpha.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>32.<wbr>0</a>
</div>
</div>
</nav>
@ -113,7 +113,7 @@ class GroupChat extends Chat {
!Array.isArray(participantIds) &amp;amp;&amp;amp; (participantIds &#x3D; [participantIds]);
const groupWid &#x3D; window.Store.WidFactory.createWid(groupId);
const group &#x3D; await window.Store.Chat.find(groupWid);
const group &#x3D; window.Store.Chat.get(groupWid) || (await window.Store.Chat.find(groupWid));
const participantWids &#x3D; participantIds.map((p) &#x3D;&gt; window.Store.WidFactory.createWid(p));
const errorCodes &#x3D; {
@ -130,8 +130,8 @@ class GroupChat extends Chat {
};
await window.Store.GroupQueryAndUpdate({ id: groupId });
const groupMetadata &#x3D; group.groupMetadata;
const groupParticipants &#x3D; groupMetadata?.participants;
let groupParticipants &#x3D; group.groupMetadata?.participants.serialize();
if (!groupParticipants) {
return errorCodes.isGroupEmpty;
@ -141,6 +141,10 @@ class GroupChat extends Chat {
return errorCodes.iAmNotAdmin;
}
groupParticipants.map(({ id }) &#x3D;&gt; {
return id.server &#x3D;&#x3D;&#x3D; &#x27;lid&#x27; ? window.Store.LidUtils.getPhoneNumber(id) : id;
});
const _getSleepTime &#x3D; (sleep) &#x3D;&gt; {
if (!Array.isArray(sleep) || sleep.length &#x3D;&#x3D;&#x3D; 2 &amp;amp;&amp;amp; sleep[0] &#x3D;&#x3D;&#x3D; sleep[1]) {
return sleep;
@ -152,16 +156,17 @@ class GroupChat extends Chat {
return Math.floor(Math.random() * (sleep[1] - sleep[0] + 1)) + sleep[0];
};
for (const pWid of participantWids) {
for (let pWid of participantWids) {
const pId &#x3D; pWid._serialized;
pWid &#x3D; pWid.server &#x3D;&#x3D;&#x3D; &#x27;lid&#x27; ? window.Store.LidUtils.getPhoneNumber(pWid) : pWid;
participantData[pId] &#x3D; {
code: undefined,
message: undefined,
isInviteV4Sent: false
};
if (groupParticipants.some(p &#x3D;&gt; p.id._serialized &#x3D;&#x3D;&#x3D; pId)) {
if (groupParticipants.some(p &#x3D;&gt; p._serialized &#x3D;&#x3D;&#x3D; pId)) {
participantData[pId].code &#x3D; 409;
participantData[pId].message &#x3D; errorCodes[409];
continue;
@ -174,7 +179,7 @@ class GroupChat extends Chat {
}
const rpcResult &#x3D;
await window.WWebJS.getAddParticipantsRpcResult(groupMetadata, groupWid, pWid);
await window.WWebJS.getAddParticipantsRpcResult(groupWid, pWid);
const { code: rpcResultCode } &#x3D; rpcResult;
participantData[pId].code &#x3D; rpcResultCode;
@ -186,7 +191,7 @@ class GroupChat extends Chat {
window.Store.Contact.gadd(pWid, { silent: true });
if (rpcResult.name &#x3D;&#x3D;&#x3D; &#x27;ParticipantRequestCodeCanBeSent&#x27; &amp;amp;&amp;amp;
(userChat &#x3D; await window.Store.Chat.find(pWid))) {
(userChat &#x3D; window.Store.Chat.get(pWid) || (await window.Store.Chat.find(pWid)))) {
const groupName &#x3D; group.formattedTitle || group.name;
const res &#x3D; await window.Store.GroupInviteV4.sendGroupInviteMessage(
userChat,
@ -197,9 +202,7 @@ class GroupChat extends Chat {
comment,
await window.WWebJS.getProfilePicThumbToBase64(groupWid)
);
isInviteV4Sent &#x3D; window.compareWwebVersions(window.Debug.VERSION, &#x27;&amp;lt;&#x27;, &#x27;2.2335.6&#x27;)
? res &#x3D;&#x3D;&#x3D; &#x27;OK&#x27;
: res.messageSendResult &#x3D;&#x3D;&#x3D; &#x27;OK&#x27;;
isInviteV4Sent &#x3D; res.messageSendResult &#x3D;&#x3D;&#x3D; &#x27;OK&#x27;;
}
participantData[pId].isInviteV4Sent &#x3D; isInviteV4Sent;
@ -224,7 +227,10 @@ class GroupChat extends Chat {
return await this.client.pupPage.evaluate(async (chatId, participantIds) &#x3D;&gt; {
const chat &#x3D; await window.WWebJS.getChat(chatId, { getAsModel: false });
const participants &#x3D; participantIds.map(p &#x3D;&gt; {
return chat.groupMetadata.participants.get(p);
const wid &#x3D; window.Store.WidFactory.createWid(p);
const lid &#x3D; wid.server!&#x3D;&#x3D;&#x27;lid&#x27; ? window.Store.LidUtils.getCurrentLid(wid) : wid;
const phone &#x3D; wid.server&#x3D;&#x3D;&#x27;lid&#x27; ? window.Store.LidUtils.getPhoneNumber(wid) : wid;
return chat.groupMetadata.participants.get(lid?._serialized) || chat.groupMetadata.participants.get(phone?._serialized);
}).filter(p &#x3D;&gt; Boolean(p));
await window.Store.GroupParticipants.removeParticipants(chat, participants);
return { status: 200 };
@ -240,7 +246,10 @@ class GroupChat extends Chat {
return await this.client.pupPage.evaluate(async (chatId, participantIds) &#x3D;&gt; {
const chat &#x3D; await window.WWebJS.getChat(chatId, { getAsModel: false });
const participants &#x3D; participantIds.map(p &#x3D;&gt; {
return chat.groupMetadata.participants.get(p);
const wid &#x3D; window.Store.WidFactory.createWid(p);
const lid &#x3D; wid.server!&#x3D;&#x3D;&#x27;lid&#x27; ? window.Store.LidUtils.getCurrentLid(wid) : wid;
const phone &#x3D; wid.server&#x3D;&#x3D;&#x27;lid&#x27; ? window.Store.LidUtils.getPhoneNumber(wid) : wid;
return chat.groupMetadata.participants.get(lid?._serialized) || chat.groupMetadata.participants.get(phone?._serialized);
}).filter(p &#x3D;&gt; Boolean(p));
await window.Store.GroupParticipants.promoteParticipants(chat, participants);
return { status: 200 };
@ -256,7 +265,10 @@ class GroupChat extends Chat {
return await this.client.pupPage.evaluate(async (chatId, participantIds) &#x3D;&gt; {
const chat &#x3D; await window.WWebJS.getChat(chatId, { getAsModel: false });
const participants &#x3D; participantIds.map(p &#x3D;&gt; {
return chat.groupMetadata.participants.get(p);
const wid &#x3D; window.Store.WidFactory.createWid(p);
const lid &#x3D; wid.server!&#x3D;&#x3D;&#x27;lid&#x27; ? window.Store.LidUtils.getCurrentLid(wid) : wid;
const phone &#x3D; wid.server&#x3D;&#x3D;&#x27;lid&#x27; ? window.Store.LidUtils.getPhoneNumber(wid) : wid;
return chat.groupMetadata.participants.get(lid?._serialized) || chat.groupMetadata.participants.get(phone?._serialized);
}).filter(p &#x3D;&gt; Boolean(p));
await window.Store.GroupParticipants.demoteParticipants(chat, participants);
return { status: 200 };
@ -512,7 +524,7 @@ module.exports &#x3D; GroupChat;
<footer id="jsdoc-footer" class="jsdoc-footer">
<div id="jsdoc-footer-container">
<p>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.11 on June 30, 2025.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.11 on August 8, 2025.
</p>
</div>
</footer>