docs: generate docs for the latest release (#3279)
* docs: generate docs for the latest release * docs: mark version v1.26.0 * docs: mark WWeb version v2.3000.1016590837
This commit is contained in:
parent
d2597bba72
commit
01c45047d2
74 changed files with 3898 additions and 891 deletions
|
|
@ -4,7 +4,7 @@
|
|||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.11">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.23.0 » Source: structures/GroupChat.js</title>
|
||||
<title>whatsapp-web.js 1.26.0 » 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>23.<wbr>0</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>25.<wbr>0</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
@ -129,7 +129,7 @@ class GroupChat extends Chat {
|
|||
419: 'The participant can\'t be added because the group is full'
|
||||
};
|
||||
|
||||
await window.Store.GroupMetadata.queryAndUpdate(groupWid);
|
||||
await window.Store.GroupQueryAndUpdate(groupWid);
|
||||
const groupMetadata = group.groupMetadata;
|
||||
const groupParticipants = groupMetadata?.participants;
|
||||
|
||||
|
|
@ -183,7 +183,7 @@ class GroupChat extends Chat {
|
|||
|
||||
if (autoSendInviteV4 &amp;&amp; rpcResultCode === 403) {
|
||||
let userChat, isInviteV4Sent = false;
|
||||
window.Store.ContactCollection.gadd(pWid, { silent: true });
|
||||
window.Store.Contact.gadd(pWid, { silent: true });
|
||||
|
||||
if (rpcResult.name === 'ParticipantRequestCodeCanBeSent' &amp;&amp;
|
||||
(userChat = await window.Store.Chat.find(pWid))) {
|
||||
|
|
@ -312,6 +312,27 @@ class GroupChat extends Chat {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the group setting to allow only admins to add members to the group.
|
||||
* @param {boolean} [adminsOnly=true] Enable or disable this option
|
||||
* @returns {Promise&lt;boolean>} Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.
|
||||
*/
|
||||
async setAddMembersAdminsOnly(adminsOnly=true) {
|
||||
const success = await this.client.pupPage.evaluate(async (groupId, adminsOnly) => {
|
||||
const chatWid = window.Store.WidFactory.createWid(groupId);
|
||||
try {
|
||||
const response = await window.Store.GroupUtils.setGroupMemberAddMode(chatWid, 'member_add_mode', adminsOnly ? 0 : 1);
|
||||
return response.name === 'SetMemberAddModeResponseSuccess';
|
||||
} catch (err) {
|
||||
if(err.name === 'SmaxParsingFailure') return false;
|
||||
throw err;
|
||||
}
|
||||
}, this.id._serialized, adminsOnly);
|
||||
|
||||
success &amp;&amp; (this.groupMetadata.memberAddMode = adminsOnly ? 'admin_add' : 'all_member_add');
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the group settings to only allow admins to send messages.
|
||||
* @param {boolean} [adminsOnly=true] Enable or disable this option
|
||||
|
|
@ -390,10 +411,18 @@ class GroupChat extends Chat {
|
|||
async getInviteCode() {
|
||||
const codeRes = await this.client.pupPage.evaluate(async chatId => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
return window.Store.GroupInvite.queryGroupInviteCode(chatWid);
|
||||
try {
|
||||
return window.compareWwebVersions(window.Debug.VERSION, '>=', '2.3000.0')
|
||||
? await window.Store.GroupInvite.queryGroupInviteCode(chatWid, true)
|
||||
: await window.Store.GroupInvite.queryGroupInviteCode(chatWid);
|
||||
}
|
||||
catch (err) {
|
||||
if(err.name === 'ServerStatusCodeError') return undefined;
|
||||
throw err;
|
||||
}
|
||||
}, this.id._serialized);
|
||||
|
||||
return codeRes.code;
|
||||
return codeRes?.code;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -485,7 +514,7 @@ module.exports = 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 October 21, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.11 on September 18, 2024.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
|||
Loading…
Reference in a new issue