Improvements in mentionedJidList and content, referring to sendMessage (#2166)
* Improvements in mentions and content, referring to sendMessage * Add function in MessageMedia * fix: remove fromAll * Update src/Client.js * Update src/Client.js * Update Client.js --------- Co-authored-by: Rafael <you@example.com> Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
This commit is contained in:
parent
01d23e8dff
commit
a91bf1c762
1 changed files with 5 additions and 1 deletions
|
|
@ -742,6 +742,10 @@ class Client extends EventEmitter {
|
|||
* @returns {Promise<Message>} Message that was just sent
|
||||
*/
|
||||
async sendMessage(chatId, content, options = {}) {
|
||||
if (options.mentions && options.mentions.some(possiblyContact => possiblyContact instanceof Contact)) {
|
||||
console.warn('Mentions with an array of Contact are now deprecated. See more at https://github.com/pedroslopez/whatsapp-web.js/pull/2166.');
|
||||
options.mentions = options.mentions.map(a => a.id._serialized);
|
||||
}
|
||||
let internalOptions = {
|
||||
linkPreview: options.linkPreview === false ? undefined : true,
|
||||
sendAudioAsVoice: options.sendAudioAsVoice,
|
||||
|
|
@ -751,7 +755,7 @@ class Client extends EventEmitter {
|
|||
caption: options.caption,
|
||||
quotedMessageId: options.quotedMessageId,
|
||||
parseVCards: options.parseVCards === false ? false : true,
|
||||
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact => contact.id._serialized) : [],
|
||||
mentionedJidList: Array.isArray(options.mentions) ? options.mentions : [],
|
||||
extraOptions: options.extra
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue