chore(v1.34.7): bump version and generate docs
This commit is contained in:
parent
211205363c
commit
f935b50011
77 changed files with 5207 additions and 2669 deletions
110
docs/structures_Chat.js.html
generated
110
docs/structures_Chat.js.html
generated
|
|
@ -4,7 +4,7 @@
|
|||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.11">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.34.6 » Source: structures/Chat.js</title>
|
||||
<title>whatsapp-web.js 1.34.7 » Source: structures/Chat.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>34.<wbr>6</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>34.<wbr>7</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
@ -94,6 +94,12 @@ class Chat extends Base {
|
|||
*/
|
||||
this.pinned = !!data.pin;
|
||||
|
||||
/**
|
||||
* Indicates if the Chat is locked
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.isLocked = data.isLocked;
|
||||
|
||||
/**
|
||||
* Indicates if the chat is muted or not
|
||||
* @type {boolean}
|
||||
|
|
@ -110,15 +116,17 @@ class Chat extends Base {
|
|||
* Last message fo chat
|
||||
* @type {Message}
|
||||
*/
|
||||
this.lastMessage = data.lastMessage ? new Message(this.client, data.lastMessage) : undefined;
|
||||
|
||||
this.lastMessage = data.lastMessage
|
||||
? new Message(this.client, data.lastMessage)
|
||||
: undefined;
|
||||
|
||||
return super._patch(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a message to this chat
|
||||
* @param {string|MessageMedia|Location} content
|
||||
* @param {MessageSendOptions} [options]
|
||||
* @param {MessageSendOptions} [options]
|
||||
* @returns {Promise&lt;Message>} Message that was just sent
|
||||
*/
|
||||
async sendMessage(content, options) {
|
||||
|
|
@ -138,7 +146,7 @@ class Chat extends Base {
|
|||
* @returns {Promise&lt;boolean>} result
|
||||
*/
|
||||
async clearMessages() {
|
||||
return this.client.pupPage.evaluate(chatId => {
|
||||
return this.client.pupPage.evaluate((chatId) => {
|
||||
return window.WWebJS.sendClearChat(chatId);
|
||||
}, this.id._serialized);
|
||||
}
|
||||
|
|
@ -148,7 +156,7 @@ class Chat extends Base {
|
|||
* @returns {Promise&lt;Boolean>} result
|
||||
*/
|
||||
async delete() {
|
||||
return this.client.pupPage.evaluate(chatId => {
|
||||
return this.client.pupPage.evaluate((chatId) => {
|
||||
return window.WWebJS.sendDeleteChat(chatId);
|
||||
}, this.id._serialized);
|
||||
}
|
||||
|
|
@ -189,7 +197,10 @@ class Chat extends Base {
|
|||
* @returns {Promise&lt;{isMuted: boolean, muteExpiration: number}>}
|
||||
*/
|
||||
async mute(unmuteDate) {
|
||||
const result = await this.client.muteChat(this.id._serialized, unmuteDate);
|
||||
const result = await this.client.muteChat(
|
||||
this.id._serialized,
|
||||
unmuteDate,
|
||||
);
|
||||
this.isMuted = result.isMuted;
|
||||
this.muteExpiration = result.muteExpiration;
|
||||
return result;
|
||||
|
|
@ -209,7 +220,7 @@ class Chat extends Base {
|
|||
/**
|
||||
* Mark this chat as unread
|
||||
*/
|
||||
async markUnread(){
|
||||
async markUnread() {
|
||||
return this.client.markChatUnread(this.id._serialized);
|
||||
}
|
||||
|
||||
|
|
@ -221,45 +232,56 @@ class Chat extends Base {
|
|||
* @returns {Promise&lt;Array&lt;Message>>}
|
||||
*/
|
||||
async fetchMessages(searchOptions) {
|
||||
let messages = await this.client.pupPage.evaluate(async (chatId, searchOptions) => {
|
||||
const msgFilter = (m) => {
|
||||
if (m.isNotification) {
|
||||
return false; // dont include notification messages
|
||||
let messages = await this.client.pupPage.evaluate(
|
||||
async (chatId, searchOptions) => {
|
||||
const msgFilter = (m) => {
|
||||
if (m.isNotification) {
|
||||
return false; // dont include notification messages
|
||||
}
|
||||
if (
|
||||
searchOptions &amp;&amp;
|
||||
searchOptions.fromMe !== undefined &amp;&amp;
|
||||
m.id.fromMe !== searchOptions.fromMe
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
const chat = await window.WWebJS.getChat(chatId, {
|
||||
getAsModel: false,
|
||||
});
|
||||
let msgs = chat.msgs.getModelsArray().filter(msgFilter);
|
||||
|
||||
if (searchOptions &amp;&amp; searchOptions.limit > 0) {
|
||||
while (msgs.length &lt; searchOptions.limit) {
|
||||
const loadedMessages = await window
|
||||
.require('WAWebChatLoadMessages')
|
||||
.loadEarlierMsgs({ chat });
|
||||
if (!loadedMessages || !loadedMessages.length) break;
|
||||
msgs = [...loadedMessages.filter(msgFilter), ...msgs];
|
||||
}
|
||||
|
||||
if (msgs.length > searchOptions.limit) {
|
||||
msgs.sort((a, b) => (a.t > b.t ? 1 : -1));
|
||||
msgs = msgs.splice(msgs.length - searchOptions.limit);
|
||||
}
|
||||
}
|
||||
if (searchOptions &amp;&amp; searchOptions.fromMe !== undefined &amp;&amp; m.id.fromMe !== searchOptions.fromMe) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
const chat = await window.WWebJS.getChat(chatId, { getAsModel: false });
|
||||
let msgs = chat.msgs.getModelsArray().filter(msgFilter);
|
||||
return msgs.map((m) => window.WWebJS.getMessageModel(m));
|
||||
},
|
||||
this.id._serialized,
|
||||
searchOptions,
|
||||
);
|
||||
|
||||
if (searchOptions &amp;&amp; searchOptions.limit > 0) {
|
||||
while (msgs.length &lt; searchOptions.limit) {
|
||||
const loadedMessages = await window.Store.ConversationMsgs.loadEarlierMsgs(chat,chat.msgs);
|
||||
if (!loadedMessages || !loadedMessages.length) break;
|
||||
msgs = [...loadedMessages.filter(msgFilter), ...msgs];
|
||||
}
|
||||
|
||||
if (msgs.length > searchOptions.limit) {
|
||||
msgs.sort((a, b) => (a.t > b.t) ? 1 : -1);
|
||||
msgs = msgs.splice(msgs.length - searchOptions.limit);
|
||||
}
|
||||
}
|
||||
|
||||
return msgs.map(m => window.WWebJS.getMessageModel(m));
|
||||
|
||||
}, this.id._serialized, searchOptions);
|
||||
|
||||
return messages.map(m => new Message(this.client, m));
|
||||
return messages.map((m) => new Message(this.client, m));
|
||||
}
|
||||
|
||||
/**
|
||||
* Simulate typing in chat. This will last for 25 seconds.
|
||||
*/
|
||||
async sendStateTyping() {
|
||||
return this.client.pupPage.evaluate(chatId => {
|
||||
return this.client.pupPage.evaluate((chatId) => {
|
||||
window.WWebJS.sendChatstate('typing', chatId);
|
||||
return true;
|
||||
}, this.id._serialized);
|
||||
|
|
@ -269,7 +291,7 @@ class Chat extends Base {
|
|||
* Simulate recording audio in chat. This will last for 25 seconds.
|
||||
*/
|
||||
async sendStateRecording() {
|
||||
return this.client.pupPage.evaluate(chatId => {
|
||||
return this.client.pupPage.evaluate((chatId) => {
|
||||
window.WWebJS.sendChatstate('recording', chatId);
|
||||
return true;
|
||||
}, this.id._serialized);
|
||||
|
|
@ -279,7 +301,7 @@ class Chat extends Base {
|
|||
* Stops typing or recording in chat immediately.
|
||||
*/
|
||||
async clearState() {
|
||||
return this.client.pupPage.evaluate(chatId => {
|
||||
return this.client.pupPage.evaluate((chatId) => {
|
||||
window.WWebJS.sendChatstate('stop', chatId);
|
||||
return true;
|
||||
}, this.id._serialized);
|
||||
|
|
@ -317,7 +339,7 @@ class Chat extends Base {
|
|||
async getPinnedMessages() {
|
||||
return this.client.getPinnedMessages(this.id._serialized);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sync chat history conversation
|
||||
* @return {Promise&lt;boolean>} True if operation completed successfully, false otherwise.
|
||||
|
|
@ -352,7 +374,7 @@ class Chat extends Base {
|
|||
*/
|
||||
async getCustomerNote() {
|
||||
if (this.isGroup || this.isChannel) return null;
|
||||
|
||||
|
||||
return this.client.getCustomerNote(this.id._serialized);
|
||||
}
|
||||
}
|
||||
|
|
@ -368,7 +390,7 @@ module.exports = Chat;
|
|||
<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 January 30, 2026.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.11 on April 24, 2026.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
|||
Loading…
Reference in a new issue