GithubHelp home page GithubHelp logo

Comments (25)

andretasty avatar andretasty commented on May 26, 2024 1

I'm trying to find another solution. If i found, i will post here

from sulla.

vasani-arpit avatar vasani-arpit commented on May 26, 2024

Does your ${num} include country code?

from sulla.

amajai avatar amajai commented on May 26, 2024

@vasani-arpit yes it does

from sulla.

andretasty avatar andretasty commented on May 26, 2024

Any result on it?

from sulla.

amajai avatar amajai commented on May 26, 2024

@andretasty Nope, still having the problem

from sulla.

vasani-arpit avatar vasani-arpit commented on May 26, 2024

Just tested it. Works fine. Are you sure your receiver is a registered WA user?

image

from sulla.

amajai avatar amajai commented on May 26, 2024

@vasani-arpit yes I just tried it again and it didn't work. The receiver is registered in WhatsApp and it is also shown on 'select contact' section that the number is valid. However, I didn't use the WAPI class. How do I use it, it might make a difference.

from sulla.

andretasty avatar andretasty commented on May 26, 2024

I cant send. a tried many numbers, but without success

from sulla.

andretasty avatar andretasty commented on May 26, 2024

@amajai did you tested with WAPI class?

from sulla.

amajai avatar amajai commented on May 26, 2024

@andretasty I don't know how to use it. Was hoping for @vansani-arpit to explain how

from sulla.

vasani-arpit avatar vasani-arpit commented on May 26, 2024

@amajai @andretasty

As you know the underlying library which us being used is wapi.js (which I use in my wbot repo as well). I am yet to explore TypeScript so I prefer same old JS debugging.

In which I'd run web.whatsapp in normal chrome and inject wapi.js using snippet in DevTools. Once it is injected I can use the functions it provides like wapi.sendMessage2 which is being used by this library but via TypeScript.

Now, you can do all this programmatically, that's what exactly sulla does.

from sulla.

andretasty avatar andretasty commented on May 26, 2024

When i try to send a message to new chat, and give a console.log on sendText, node give me this line: Promise { }. What is this?

from sulla.

vasani-arpit avatar vasani-arpit commented on May 26, 2024

It is returning a promise. You need to add .then() and .catch() to get the result when it completes. for more you can check https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise

from sulla.

andretasty avatar andretasty commented on May 26, 2024

is that the problem? Every time that i need to send a message, before i need to open a chat to the contact receive. here is my actual code

// import { create, Whatsapp } from 'sulla';
const sulla = require('sulla');
const express = require('express');

const app = express();

sulla.create().then(client => start(client));

function start(client) {
app.get("/:numero/:msg/", function(req, res){
      client.sendText(req.params.numero + '@c.us',req.params.msg);
      res.sendFile(__dirname + '/html/index.html');
      })
}
app.listen(8090, function(){
      console.log("servidor rodando");
  });

from sulla.

vasani-arpit avatar vasani-arpit commented on May 26, 2024

Keep express aside for the testing purpose and try this

const sulla = require('sulla');
const numero = '12345678900'

sulla.create().then(client => start(client));

function start(client) {
      client.sendText(numero+'@c.us', '👋 Hello from sulla!');
}

If this works then you can think about adding express. If it doesn't then there is something wrong with sulla.

from sulla.

andretasty avatar andretasty commented on May 26, 2024

Still doesn't work :/. Sulla only sends message when the contact is in chat tab

from sulla.

vasani-arpit avatar vasani-arpit commented on May 26, 2024

There could be something wrong with sulla. You can use original one or modify wbot

from sulla.

vasani-arpit avatar vasani-arpit commented on May 26, 2024

On second thought. If you can change this line to sendMessage2 then it could work.

from sulla.

amajai avatar amajai commented on May 26, 2024

Interesting solution. Will try changing the line first. If it doesn't work out, I'll try the wbot since I'm struggling to make the original work for me.

from sulla.

andretasty avatar andretasty commented on May 26, 2024

When i inject wapi.js on web.whatsapp, i get false response when the chat isn't started.

from sulla.

amajai avatar amajai commented on May 26, 2024

@vasani-arpit Unfortunately, changing it to sendMessage2 didn't make a difference. I'm guessing same will happen with wbot since the underlying library is wapi.js. Oh well, looks like its not possible after all. Thanks for the help though.

from sulla.

amajai avatar amajai commented on May 26, 2024

@andretasty Much appreciated you can. I'll do the same as well.

from sulla.

austonpramodh avatar austonpramodh commented on May 26, 2024

found any solutions?

from sulla.

priteshpmehta avatar priteshpmehta commented on May 26, 2024

Keep express aside for the testing purpose and try this

const sulla = require('sulla');
const numero = '12345678900'

sulla.create().then(client => start(client));

function start(client) {
      client.sendText(numero+'@c.us', '👋 Hello from sulla!');
}

If this works then you can think about adding express. If it doesn't then there is something wrong with sulla.

Did any one find solution for this? I am getting ReferenceError: WAPI is not defined error message.

from sulla.

danielcardeenas avatar danielcardeenas commented on May 26, 2024

Plase update to new version

To send a message to a contact (non-group) just type the number

client.sendText('[email protected]', 'Direct message');

On a regular message received do a console.log(message) to and check the from property

from sulla.

Related Issues (20)

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.