mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-19 20:19:14 +00:00
feat: Mention users, get user number from Contact model
This commit is contained in:
@@ -247,7 +247,8 @@ class Client extends EventEmitter {
|
||||
async sendMessage(chatId, content, options={}) {
|
||||
let internalOptions = {
|
||||
caption: options.caption,
|
||||
quotedMessageId: options.quotedMessageId
|
||||
quotedMessageId: options.quotedMessageId,
|
||||
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact => contact.id._serialized) : []
|
||||
};
|
||||
|
||||
if(content instanceof MessageMedia) {
|
||||
|
||||
@@ -20,6 +20,12 @@ class Contact extends Base {
|
||||
*/
|
||||
this.id = data.id;
|
||||
|
||||
/**
|
||||
* Contact's phone number
|
||||
* @type {string}
|
||||
*/
|
||||
this.number = data.userid;
|
||||
|
||||
/**
|
||||
* Indicates if the contact is a business contact
|
||||
* @type {boolean}
|
||||
|
||||
@@ -40,6 +40,8 @@ exports.LoadUtils = () => {
|
||||
delete options.quotedMessageId;
|
||||
}
|
||||
|
||||
options.mentionedJidList = options.mentionedJidList.map(cId=> window.Store.Contact.get(cId).id);
|
||||
|
||||
let locationOptions = {};
|
||||
if (options.location) {
|
||||
locationOptions = {
|
||||
@@ -145,6 +147,7 @@ exports.LoadUtils = () => {
|
||||
res.isGroup = contact.isGroup;
|
||||
res.isWAContact = contact.isWAContact;
|
||||
res.isMyContact = contact.isMyContact;
|
||||
res.userid = contact.userid;
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user