mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 11:39:14 +00:00
feat: Get registered ID for a given phone number (#483)
Exposes internal getNumberById function for easy usage. This can help with dealing with brazilian numbers with the extra digit, always returning the correct ID. This will probably eventually replace the current isRegisteredUser function. Co-authored-by: Pedro Lopez <pedroslopez@me.com>
This commit is contained in:
committed by
Pedro S. Lopez
parent
87cb5a0519
commit
576768e390
@@ -34,6 +34,7 @@ exports.ExposeStore = (moduleRaidStr) => {
|
||||
|
||||
exports.LoadUtils = () => {
|
||||
window.WWebJS = {};
|
||||
|
||||
window.WWebJS.getNumberId = async (id) => {
|
||||
|
||||
let result = await window.Store.Wap.queryExist(id);
|
||||
@@ -41,6 +42,7 @@ exports.LoadUtils = () => {
|
||||
throw 'The number provided is not a registered whatsapp user';
|
||||
return result.jid;
|
||||
};
|
||||
|
||||
window.WWebJS.sendSeen = async (chatId) => {
|
||||
let chat = window.Store.Chat.get(chatId);
|
||||
if (chat !== undefined) {
|
||||
@@ -50,6 +52,7 @@ exports.LoadUtils = () => {
|
||||
return false;
|
||||
|
||||
};
|
||||
|
||||
window.WWebJS.sendMessage = async (chat, content, options = {}) => {
|
||||
let attOptions = {};
|
||||
if (options.attachment) {
|
||||
|
||||
Reference in New Issue
Block a user