chore(): generate docs
This commit is contained in:
parent
611b7c63d7
commit
376c60668c
76 changed files with 849 additions and 323 deletions
|
|
@ -4,7 +4,7 @@
|
|||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.11">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.34.2 » Source: structures/Message.js</title>
|
||||
<title>whatsapp-web.js 1.34.3 » Source: structures/Message.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>2</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>34.<wbr>3</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
@ -480,7 +480,9 @@ class Message extends Base {
|
|||
|
||||
const result = await this.client.pupPage.evaluate(async (msgId) => {
|
||||
const msg = window.Store.Msg.get(msgId) || (await window.Store.Msg.getMessagesById([msgId]))?.messages?.[0];
|
||||
if (!msg || !msg.mediaData) {
|
||||
|
||||
// REUPLOADING mediaStage means the media is expired and the download button is spinning, cannot be downloaded now
|
||||
if (!msg || !msg.mediaData || msg.mediaData.mediaStage === 'REUPLOADING') {
|
||||
return null;
|
||||
}
|
||||
if (msg.mediaData.mediaStage != 'RESOLVED') {
|
||||
|
|
@ -497,6 +499,10 @@ class Message extends Base {
|
|||
}
|
||||
|
||||
try {
|
||||
const mockQpl = {
|
||||
addAnnotations: function() { return this; },
|
||||
addPoint: function() { return this; }
|
||||
};
|
||||
const decryptedMedia = await window.Store.DownloadManager.downloadAndMaybeDecrypt({
|
||||
directPath: msg.directPath,
|
||||
encFilehash: msg.encFilehash,
|
||||
|
|
@ -504,7 +510,8 @@ class Message extends Base {
|
|||
mediaKey: msg.mediaKey,
|
||||
mediaKeyTimestamp: msg.mediaKeyTimestamp,
|
||||
type: msg.type,
|
||||
signal: (new AbortController).signal
|
||||
signal: (new AbortController).signal,
|
||||
downloadQpl: mockQpl
|
||||
});
|
||||
|
||||
const data = await window.WWebJS.arrayBufferToBase64Async(decryptedMedia);
|
||||
|
|
@ -593,7 +600,7 @@ class Message extends Base {
|
|||
*/
|
||||
async unpin() {
|
||||
return await this.client.pupPage.evaluate(async (msgId) => {
|
||||
return await window.WWebJS.pinUnpinMsgAction(msgId, 2);
|
||||
return await window.WWebJS.pinUnpinMsgAction(msgId, 2, 0);
|
||||
}, this.id._serialized);
|
||||
}
|
||||
|
||||
|
|
@ -780,6 +787,32 @@ class Message extends Base {
|
|||
async getPollVotes() {
|
||||
return await this.client.getPollVotes(this.id._serialized);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send votes to the poll message
|
||||
* @param {Array&lt;string>} selectedOptions Array of options selected.
|
||||
* @returns {Promise}
|
||||
*/
|
||||
async vote(selectedOptions) {
|
||||
if (this.type != MessageTypes.POLL_CREATION) throw 'Invalid usage! Can only be used with a pollCreation message';
|
||||
|
||||
await this.client.pupPage.evaluate(async (messageId, votes) => {
|
||||
if (!messageId) return null;
|
||||
if (!Array.isArray(votes)) votes = [votes];
|
||||
let localIdSet = new Set();
|
||||
const msg =
|
||||
window.Store.Msg.get(messageId) || (await window.Store.Msg.getMessagesById([messageId]))?.messages?.[0];
|
||||
if (!msg) return null;
|
||||
|
||||
msg.pollOptions.forEach(a => {
|
||||
for (const option of votes) {
|
||||
if (a.name === option) localIdSet.add(a.localId);
|
||||
}
|
||||
});
|
||||
|
||||
await window.Store.PollsSendVote.sendVote(msg, localIdSet);
|
||||
}, this.id._serialized, selectedOptions);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Message;
|
||||
|
|
@ -793,7 +826,7 @@ module.exports = Message;
|
|||
<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 November 6, 2025.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.11 on December 13, 2025.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
|||
Loading…
Reference in a new issue