chore: mark version v1.22.0
This commit is contained in:
parent
8bd2624866
commit
a1bbd25fd3
1 changed files with 846 additions and 284 deletions
|
|
@ -4,7 +4,7 @@
|
|||
<head>
|
||||
<meta name="generator" content="JSDoc 3.6.11">
|
||||
<meta charset="utf-8">
|
||||
<title>whatsapp-web.js 1.21.0 » Source: structures/Message.js</title>
|
||||
<title>whatsapp-web.js 1.22.0 » 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>21.<wbr>0</a>
|
||||
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>22.<wbr>0</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
@ -38,6 +38,7 @@ const Order = require('./Order');
|
|||
const Payment = require('./Payment');
|
||||
const Reaction = require('./Reaction');
|
||||
const {MessageTypes} = require('../util/Constants');
|
||||
const {Contact} = require('./Contact');
|
||||
|
||||
/**
|
||||
* Represents a Message on WhatsApp
|
||||
|
|
@ -198,8 +199,8 @@ class Message extends Base {
|
|||
inviteCodeExp: data.inviteCodeExp,
|
||||
groupId: data.inviteGrp,
|
||||
groupName: data.inviteGrpName,
|
||||
fromId: data.from._serialized,
|
||||
toId: data.to._serialized
|
||||
fromId: data.from?._serialized ? data.from._serialized : data.from,
|
||||
toId: data.to?._serialized ? data.to._serialized : data.to
|
||||
} : undefined;
|
||||
|
||||
/**
|
||||
|
|
@ -255,6 +256,16 @@ class Message extends Base {
|
|||
this.productId = data.productId;
|
||||
}
|
||||
|
||||
/** Last edit time */
|
||||
if (data.latestEditSenderTimestampMs) {
|
||||
this.latestEditSenderTimestampMs = data.latestEditSenderTimestampMs;
|
||||
}
|
||||
|
||||
/** Last edit message author */
|
||||
if (data.latestEditMsgKey) {
|
||||
this.latestEditMsgKey = data.latestEditMsgKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Links included in the message.
|
||||
* @type {Array&lt;{link: string, isSuspicious: boolean}>}
|
||||
|
|
@ -607,6 +618,42 @@ class Message extends Base {
|
|||
return reaction;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Edits the current message.
|
||||
* @param {string} content
|
||||
* @param {MessageEditOptions} [options] - Options used when editing the message
|
||||
* @returns {Promise&lt;?Message>}
|
||||
*/
|
||||
async edit(content, options = {}) {
|
||||
if (options.mentions &amp;&amp; options.mentions.some(possiblyContact => possiblyContact instanceof Contact)) {
|
||||
options.mentions = options.mentions.map(a => a.id._serialized);
|
||||
}
|
||||
let internalOptions = {
|
||||
linkPreview: options.linkPreview === false ? undefined : true,
|
||||
mentionedJidList: Array.isArray(options.mentions) ? options.mentions : [],
|
||||
extraOptions: options.extra
|
||||
};
|
||||
|
||||
if (!this.fromMe) {
|
||||
return null;
|
||||
}
|
||||
const messageEdit = await this.client.pupPage.evaluate(async (msgId, message, options) => {
|
||||
let msg = window.Store.Msg.get(msgId);
|
||||
if (!msg) return null;
|
||||
|
||||
let catEdit = (msg.type === 'chat' &amp;&amp; window.Store.MsgActionChecks.canEditText(msg));
|
||||
if (catEdit) {
|
||||
const msgEdit = await window.WWebJS.editMessage(msg, message, options);
|
||||
return msgEdit.serialize();
|
||||
}
|
||||
return null;
|
||||
}, this.id._serialized, content, internalOptions);
|
||||
if (messageEdit) {
|
||||
return new Message(this.client, messageEdit);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Message;
|
||||
|
|
@ -620,7 +667,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 May 29, 2023.
|
||||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.11 on August 10, 2023.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
|||
Loading…
Reference in a new issue