Skip to content

Instantly share code, notes, and snippets.

@phpRajat
Created May 31, 2019 18:20
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save phpRajat/84c0f16f9d13f362bbd73328f5a29f84 to your computer and use it in GitHub Desktop.
Save phpRajat/84c0f16f9d13f362bbd73328f5a29f84 to your computer and use it in GitHub Desktop.
setTimeout(function () {
function getAllModules() {
return new Promise((resolve) => {
const id = _.uniqueId("fakeModule_");
window["webpackJsonp"](
[], {
[id]: function (module, exports, __webpack_require__) {
resolve(__webpack_require__.c);
}
}, [id]
);
});
}
var modules = getAllModules()._value;
for (var key in modules) {
if (modules[key].exports) {
if (modules[key].exports.default) {
if (modules[key].exports.default.Wap) {
store_id = modules[key].i.replace(/"/g, '"');
}
}
if (modules[key].exports.sendTextMsgToChat) {
chat_id = modules[key].i.replace(/"/g, '"');
}
}
}
}, 2000);
function _requireById(id) {
return webpackJsonp([], null, [id]);
}
var store_id = 0;
var chat_id = 0;
var Store = {};
function init() {
window.Store = _requireById(store_id).default;
window.Store.sendTextMsgToChat = _requireById(chat_id).sendTextMsgToChat;
console.log("Store is ready");
window.Store.Chat.find("91xxxxxxxxxx@c.us").then((user) => { window.Store.sendTextMsgToChat(user, "hellao"); });
}
setTimeout(function () {
init();
}, 5000);
@phpRajat
Copy link
Author

window.Store.Chat.find("91xxxxxxxxxx@c.us").then((user) => { window.Store.sendTextMsgToChat(user, "hello"); });

@ghersonn
Copy link

ghersonn commented Jun 1, 2019

Thanks friend, it works very well. Now how can I send an image?

@phpRajat
Copy link
Author

phpRajat commented Jun 3, 2019

I updated this code for send image. Please check this.
https://gist.github.com/phpRajat/a6422922efae32914f4dbd1082f3f412

@ramz3001
Copy link

ramz3001 commented Jun 5, 2019

great post bro , but can you describe how to send media files ? i would appreciate it. thanks in advance

@ameetpawar00
Copy link

ameetpawar00 commented Dec 18, 2019

undefined window["webpackJsonp"] if using as background script . ..
can it be used in background script if not thent what else. ... . thankyou

@ameetpawar00
Copy link

ameetpawar00 commented Dec 18, 2019

want to use it as background script window["webpackJsonp"] is not available what to do any alternative or way. . .. thankyou

@JoaoAlrc
Copy link

you know how to send stickers to wpp bro?

@krunal54
Copy link

krunal54 commented Jan 8, 2020

1
Not sure what is webpackJsonp. Please help!

@krunal54
Copy link

krunal54 commented Jan 8, 2020

Is it possible to post full code with all import to help us all.
Thanks

@florisvaldobatista
Copy link

Hello guys, does anyone know how to call these functions from javaScript in delphi?

@0xdeepmehta
Copy link

0xdeepmehta commented Jun 29, 2020

1
Not sure what is webpackJsonp. Please help!

Have You solved it ?
I have same issuse

@mikelustosa
Copy link

mikelustosa commented Aug 10, 2020

sendContact not work?

@dportabella
Copy link

Use this library to automate WhatsApp: https://github.com/open-wa/wa-automate-nodejs

@joaosouz4dev
Copy link

the lib from the comment above is paid for many functions.
Use this library to automate WhatsApp: https://github.com/orkestral/venom
we are free, welcome red hat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment