Giter Site home page Giter Site logo

briuor / wbm Goto Github PK

View Code? Open in Web Editor NEW
205.0 10.0 65.0 190 KB

wbm is an unofficial API to send bulk messages in whatsapp.

License: MIT License

JavaScript 100.00%
whatsapp-api whatsapp-bulk-sender whatsapp-bulk-message whatsapp whatsapp-web whatsapp-message-sender send-message bulk-messages-api send-message-api wbm

wbm's People

Contributors

amit4cult avatar balataca avatar briuor avatar bruno-irc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wbm's Issues

process.stdout.clearLine is not a function

Authenticating...
TypeError: process.stdout.clearLine is not a function
at sendTo (D:\Work\Gtion\DiscordBotSimple\node_modules\wbm\src\api.js:170:24)
at async Object.send (D:\Work\Gtion\DiscordBotSimple\node_modules\wbm\src\api.js:184:9)
at async D:\Work\Gtion\DiscordBotSimple\index.js:59:3

im trying to make a simple bot integrated from discord to WA

Got an error when I tried to start

I want to test from your example, but I got an error. can you help me?

$ node index.js
E:\project\wagela\node_modules\wbm\src\api.js:110
    } catch {
            ^

SyntaxError: Unexpected token {
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (E:\project\wagela\node_modules\wbm\src\index.js:1:8
0)

Cannot Send Messages

I think there is a recent change, worked few days ago, but right now it fails.

Bug is on line 162
await page.waitForSelector(SELECTORS.SEND_BUTTON, { timeout: 5000 });

I think that the Selector value needs to be updated:
SEND_BUTTON: 'div:nth-child(3) > button > span[data-icon="send"]'
this one fails currently

Seems like it does not work.

I tried this with my electron-vue app. I see QR code in console log but my WhatsApp web can't scan it. Is there a specific way to make this work?
Screenshot 2020-03-18 at 2 53 30 AM

stopped working

My application runs correct, connects but does not send msg.

In test.js mode it loops, loses the connection after authentication is done and doesn't send the message.


Minha aplicação esta rodando corretamente, mas ela conecta e não envia as mensagens;
No modo test.js, o navegador é aberto, autenticado, fica em loop (reiniciando) e não envia a mensagem.

Alguma dica?

unauthenticated despite using session : true

I used this method to use session saver, recently it keeps failing and generating new qr and the new qr code can't be scanned

wbm.start({showBrowser: false, qrCodeData: true, session: true})
.then(async qrCodeData => {
console.log(qrCodeData);
await wbm.waitQRCode();
// ...
await wbm.end();
} ).catch(err => { console.log(err); });

Need help with posting output to browser instead of console

Hi,
How to use it for multiple account on same server? Is there any solution?

Also Can anybody help me with the sample code for setting it on server for browser output i have tried many ways but it didn't work?

app.get('/myQR', (req, res) => {
wbm.start({showBrowser: false, qrCodeData: false, session: true}).then(async () => {
res.send(<!DOCTYPE html> <html> <body> <script> ${wbm.generateQRCode()}; </script> </body> </html>);
await wbm.end();
}).catch(err => console.log(err));
})

I tried using express also but not working.

How can I send files along with text?

I used your technique, and now I can send texts. How do I send attachments of files?
What is the format or structure of the attachment parameter in the WhatsApp Web URL? Is it a separate URL, a file path, or some other format?
Are there any alternative methods or libraries within the Puppeteer ecosystem that can simplify the process of attaching files to WhatsApp message

[features] Sending an image or audio

I'm not good at programming. I'm trying to adapt the code to send an attachment or audio. I'm not getting. Any tips?

const message = fs.readFileSync('photo.jpg');

it's not the expected result.

now i cant message again

const wbm = require('wbm');

wbm.start().then(async () => {
const phones = ['target number'];
const message = 'test';
await wbm.send(phones, message);
await wbm.end();
}).catch(err => console.log(err));

first time use this module i can send message, but now i cant send message again

Enter button is not working after sending message to first contact

Hi,
I'm using version 1.1.16
Node version v11.12.0
Mac os big surr 11.2.1

Message sent successfully in logs but not showing in app. just first contact get the message.
I open the browser (showBrowser:true), I see the message initialisation for second contact and onwards but send button in not clicking

I check SEND_BUTTON in node_modules/wbm/src/api.js
SEND_BUTTON: 'div:nth-child(2) > button > span[data-icon="send"]'

I also try with delay page.waitFor(5000) but not working

Sessions

It would be nice to be able to log in through QR once and then reuse the session.
A similar solution is used in pedroslopez/whatsapp-web.js

It’s also good to be able to use multiple sessions at the same time.

Is this possible now?

add random interval for sending message

I got banned for sending to more than 20 contacts. lol.
I thought it because of the interval for every message seems to fast.

so I add randomInt() function
and replace line 154 with:

await page.waitFor((6 * getRandomInt(1, 3)) * 10000);

so the msg would be sent randomly between 1-3 minutes.
I think it will be good feature if you want to add it as an option.

just my two cents 😃

the randomInt() function

function getRandomInt(min, max) {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min)) + min;
 }

message didn't broadcast to clients

I was using the standard sample template given in the README , even after the message was send succesfully (message sent in the terminal) my client didn't recieve any message.

Session not saving

Requiring me to re-authenticate through QR code every message sent. Already tried turning session argument to false, then back to true; did not work. Also reinstalled dependency. Application currently hosted on Amazon AWS EC2 Instance.

Any thoughts would be greatly appreciated.

Error !

hello,
when i try to install wbm it shows me this error :

image

can you please tell me why ?
thanks.

multiple users at the same time

I created an api for many people to use at the same time but it error and using same session.

app.post('/sendtext',jsonParser,(req, res) => {
wbm.start({showBrowser: false, qrCodeData: true, session: false})
.then(async qrCodeData => {
//.................................................
await wbm.send(arraynumber, text);
await wbm.end();
})
})

Can you help me the method for this?

Send message in interval

Hi I am trying to send messages to all the contacts after specified interval of time. But as soon I add setInterval in then block send is failing

Sending Voice Messages

Dear Briuor,

Please advise if your npm wbm package sends automated voice notes. I successfully tested the message sending.

Thanks ahead,
Mohamad

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.