mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 03:29:14 +00:00
feat : Check if the given number is a whatsapp number (#54)
* feat : Check if the given number is a whatsapp number - Avoids sending message to non whatsapp number - Gets the id of the user from whatsapp server rather than generating on client
This commit is contained in:
@@ -25,7 +25,13 @@ exports.ExposeStore = (moduleRaidStr) => {
|
||||
|
||||
exports.LoadUtils = () => {
|
||||
window.WWebJS = {};
|
||||
window.WWebJS.getNumberId = async (id) => {
|
||||
|
||||
let result = await window.Store.Wap.queryExist(id);
|
||||
if (result.jid === undefined)
|
||||
throw 'The number provided is not a registered whatsapp user';
|
||||
return result.jid;
|
||||
};
|
||||
window.WWebJS.sendMessage = async (chat, content, options = {}) => {
|
||||
let attOptions = {};
|
||||
if (options.attachment) {
|
||||
|
||||
Reference in New Issue
Block a user