open-wa / wa-automate-nodejs

💬 🤖 The most reliable tool for chatbots with advanced features. Be sure to 🌟 this repository for updates!
https://docs.openwa.dev/
Other
3.12k stars 590 forks source link

Send a message to a contact not saved (new contact) #254

Closed rfscheidt closed 4 years ago

rfscheidt commented 4 years ago

First of all, I know that this question has already been asked. But, is possible you create a new method to use the url below to send message? This way, the contact can or not be saved. Am I Correct?

https://api.whatsapp.com/send?phone=YOU NUMBER&text=YOUMESSAGE.

mcroni commented 4 years ago

You can send a message using the client.sendText directly to send a message to someone not in your contact list

rfscheidt commented 4 years ago

for me it dosen't work, just if I add the contact on the phone's list. Is it work for you?

barkerpedro commented 4 years ago

Sulla sends a message to numbers that are not saved in your contacts, however the contact has to open a conversation with you first. It is a block that exists to prevent SPAM.

rfscheidt commented 4 years ago

@smashah in your opinion, it is not could be interesting create a new method to sendText without has contact save? Using this way that said above?

smashah commented 4 years ago

I figured out this issue long time ago and there is a much simpler way to do it. It has not been implemented out of principal.

classic-gentleman commented 4 years ago

... and a library that's often mentioned here (and conversely, this repo gets mentioned there) for cross-pollination of efforts does implement it and it's short enough that reproducing is trivial. And we all know everything boils down to WAPI at some point. Cat's out of the bag.

Meaning that if I figured this out and I'm far from intent on spamming, the professional spammers have had this down for ages. We're kind of holding back on functionality for what amounts, in effect, to amateurs and pranksters.

Which brings us to the following: is not doing it out of principle worth it? Is there any indication that this is doing more good than harming legitimate uses? Is there any evidence that WhatsApp itself banning offenders either mechanically due to suspicious behaviour or through in-app reporting is not effective?

Given the COVID-19 pandemic I foresee huge needs for communications solutions that include WhatsApp interoperability. And some companies are very sensitive to timing; to the point that it's either finding adequate solutions for home office right now, or layoffs are due. Which is quite the situation I'm working on and I'm hardly the only one.

I am not forking this repository no matter what, because sadly the landscape is already fragmented, but I see myself forced to a somewhat fragile setup of monkey patching (which is nonetheless doable through TS module augmentation). I do wonder however if the recent worldwide developments call for a review of policy.

smashah commented 4 years ago

@classic-gentleman you're right and I've been thinking about it for a while. I think the solution to this dilemma is to amend the license and implement the functionality.

rfscheidt commented 4 years ago

I agree.

classic-gentleman commented 4 years ago

@classic-gentleman you're right and I've been thinking about it for a while. I think the solution to this dilemma is to amend the license and implement the functionality.

Well, seriously, you know this is a one liner on the code side; the point is that I'm not observing things for a long time but this is a recurring issue that's prominent on the readme and it didn't preclude people from opening issues in this regard. Multiple times. Meaning you haven't been spared any effort to enforce your morals, people still don't get it, and those lacking ethics don't give a marble anyway.

Thank you for reconsidering. It is the utmost sign of maturity to change course when the situation calls for it.

joaomirandas commented 4 years ago

Yeah i agree with every argument proposed but we need to have careful with this options, most part of us are pro developers and use this repo for relevant actions buuuuuuut at the same time we have a lot of homeMakers trying to create some "definitive" software and make money with this. I'm sure all that nature of homeMakers will use this for spam or send unsolicited messages.

That's can have serious implications to all of us,WhatsApp can recognize this nature of actions and make a little bit more harder to do RevEng ( of course we know they have expertise for it, eg. Buttons ) - so this movement at some point can revers against us and kill this repo permanently!

WHAT'S UP guys, let's try some smarter solution,

Idea: We could collab and create an server over restAPI for sulla without limitations of send messages and distribute it to who want to help in this meanwhile of COVID-19. A simple form request explaining nature of use and we provide for this user an endpoint and token. Easy, fast, secure!

Just an idea to think, considering security of repo first.

classic-gentleman commented 4 years ago

"Easy, fast, secure", expensive (think of the bandwidth concerns) and adds a serious point of failure on top of a moving target which is the private WhatsApp API.

I've already stated my rationale: those intent on spamming have figured it out already, those stupid enough to spam will be reported or autobanned, and the remaining dissatisfied will replace the library in the best case scenario, and in the worse, will ship bloatware that mix and match pieces of libraries that get the task done. A fork in this scenario seems even reasonable.

But it's ultimately pointless. It's literally a one-liner code wise. Just not worth overcomplicating it and creating maintainability hell.

joaomirandas commented 4 years ago

It's just an idea man, you could give smarter one in that case. One without make more easy for spammers.

rfscheidt commented 4 years ago

I think there could be 2 sendText () methods, make it clear that one of them is for uninitiated contacts. Each of them need to use the method with maturity.

classic-gentleman commented 4 years ago

It's just an idea man, you could give smarter one in that case. One without make more easy for spammers.

I apologise if it sounded like criticism towards your suggestions. Not the case; I had thought this over as well. Thought of rate limiting, of a nonce, of a gateway like you suggested, and ultimately realised this is pointless. Other libraries have implemented it already and in an user friendly manner.

And I'm leaving the decision on @smashah's hands but as I have mentioned in passing, the work is pretty much done. It's a trivial change, the occasional refactoring and cleanup notwithstanding. I'm positive he knows what I mean. And I think he nodded back at me when he mentioned he's been thinking about this for a while.

smashah commented 4 years ago

Hi all,

After much thought, I've figured out the best way to put this subject to bed once and for all.

It is true that there are other libraries out there with this functionality already. Also, it is becoming quickly apparent that, still, people are wanting the ability to send messages to strangers from this repo despite me being crystal clear in previous issues, and in the README, of my position. I assume this is because open-wa is the most kept-up-to-date and most frequently-evolving library in this space.

A lot of work done here gets disseminated throughout the 'industry' (this annoyed me for about 5 minutes, but it's a fact of life for open source, and this is how I started the library in the first place anyway). One right I've tried to keep for myself, for all the time and work I put into this, was to be able to deny this functionality. Ever since @joaomirandasa and I figured out the solution to this was out there, however, I knew the day will come where I had to choose to either:

a) Continue rejecting this feature and haemorrhage users to other libraries/forks, further fragmenting this space. b) Implement it, let this feature run amok in the world, and live with the recurring regret of the potential harm of this decision.

The reason I never wanted to implement this feature is because it is completely clear how powerful a tool WhatsApp can be - along with spam being annoying in general. The ability to send someone an unsolicited WhatsApp message is to be able to speak to a person in their most intimate space. This can be used for good but I have seen too many instances where the spreading of misinformation on WhatsApp has dug people deeper into hate and cost people their lives. From Myanmar to India to Mexico. From dangerous fake news on COVID to the destruction of a democracy. I was hoping to never have to choose between a and b.

Today, though, I chose a new option:

c) Implement the feature in a way that limits the amount of numbers with easy access to this feature and switch this project over to a new license.

"Easy" is the keyword here. It is trivial to implement this feature - and forkers gonna fork - but I don't have to, nor want to, make it easy for people to use this feature.

So today I will be pushing a new version of sulla-hotfix (edit: this is the old name of the library) which will allow members of my BMAC, with a license key, to send messages to unknown numbers.

This new version will:

  1. Finally allow people who gain value from this library to get access to this premium feature.
  2. Limit the amount of numbers with access to this feature using this library.
  3. Let's be honest, support the ungodly amount of hours I put into this project; advancing the WhatsApp space.
  4. Implement a new project License - A mix of the Hippocratic License & the Do Not Harm License.

As with most major (& hard) decisions, there will be people who are unhappy or disappointed with it - I will leave this issue open for a few days after implementation so everyone can be heard on this issue. I just want to thank everyone who has been helping me throughout the last few months dealing with issues like this by reminding people about the anti-spam stance of this library @gnadelwartz @joaomirandasa @barkerpedro @arturromaorocha thank you. Just note that this change does not change the FACT that this project is not allowed to be used to spam people.

The process of obtaining a license key will become increasingly restrictive. The plan is to:

So, this current process will be as easy as it will ever be.

If this feature is so important for you and it has to come from this library - due to it being the most kept up-to-date, advanced and reliable - then the membership fee should be a reasonable price to pay (£5pm/£50pa per number). Instructions incoming on readme.

smashah commented 4 years ago

@github-actions run

⚡ Release! ⚡ ```js (async () => { function exec(cmd) { console.log(execSync(cmd).toString()); } // Config const gitUserEmail = "github-actions[bot]@users.noreply.github.com"; const gitUserName = "github-actions[bot]"; exec(`echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc`); exec(`git config --global user.email "${gitUserEmail}"`); exec(`git config --global user.name "${gitUserName}"`); exec(`npm i`); exec(`npm run release-ci`); var result = execSync(`npx auto-changelog -o ./tempchangelog.txt --commit-limit false --template ./compact-keepachangelog.hbs --stdout`).toString(); await postComment(result); })(); ```
smashah commented 4 years ago

Changelog

🚀 Release 1.8.32 (2020-04-03)

smashah commented 4 years ago

https://github.com/smashah/sulla#starting-a-conversation

In order to unlock the functionality to send texts to unknown numbers through sulla-hotfix itself, you will need an License key.

One License Key is valid for one number. Each License Key is £5 per month or £50 per year.

For now the process happens through Buy Me A Coffee (BMAC)

How to get an License key:

  1. Go to BMAC.
  2. Click on 'Membership'.
  3. Select your payment preference (monthly/annually).
  4. Add the number you want to assign to the License Key in the notes, along with the use case for this functionality
  5. Select "Make this message private."
  6. Complete the process for membership.
  7. You will receive your License key via email.
  8. Add licenseKey to your config:
...
create({
  licenseKey: "..."
})
...

Notes:

classic-gentleman commented 4 years ago
  1. You know this is going to be circumvented
  2. I like the idea but I believe the fee is too high, unless (3)
  3. I'd be fonder of the initiative were the money to be donated to charities that overwatch the very activities you condemn on the new license.
joaomirandas commented 4 years ago

Wow!! Incredible solution made by @smashah , it is an important step for this repository and must be thanked by each one of us - allowing people to start conversations, increasing the possibilities of use and allowing people to implement in their business, create SASS services and many other things, but the most important thing is to keep the library up to date. The reverse engineering done here by shah with guys like @barkerpedro @arturromaorocha @gnadelwartz is difficult and takes a long time, when we create a collaborative environment like this, we see this updates / bug window getting smaller, and helping all of us who use it constantly .

This way of implementing and paying a fair price of use makes forks stupid, because the biggest difficulty is keeping the repository up to date and when we focus our efforts on a single point we guarantee that we will have the least possible problems and the shortest update time for corrections also making potential forks obsolete.

We knew that good things would come, very well thought out and executed! Once again congratulations @smashah 👏🏽👏🏽

smashah commented 4 years ago
  • You know this is going to be circumvented
  • I like the idea but I believe the fee is too high, unless (3)
  • I'd be fonder of the initiative were the money to be donated to charities that overwatch the very activities you condemn on the new license.

@classic-gentleman

  1. Inevitable, as you said. However, if people want the latest and best updates with proper and quick support then this is clearly the right option over any delayed forks.
  2. Reasonable reaction. It's not meant to be easy and cheap. I would argue that people using this functionality are going to be profiting off it so £5pm doesn't seem so bad when you consider the alternatives (e.g twillio). There are always 2 other ways, that are mentioned above this in the readme, to start a conversation. To be honest, this option is also super easy, you don't need to change any code other than adding your licenseKey to the config.
  3. If imagining me as Scrooge McDuck swimming in a pool of money annoys anyone enough to consider other options then so be it. I'll be spending every £ earned on increasingly frivolous indulgences and at the strip club. /s
gnadelwartz commented 4 years ago

I really like the proposal because

For me sulla-hotfix is almost feature complete and you should choose for every new feature if it's commercial only.

jm2c

smashah commented 4 years ago

thank you @joaomirandasa @gnadelwartz

mcroni commented 4 years ago

@smashah and everyone working on this library, i say thanks to you. I do agree with you on this stand. Spamming would really be a big problem if allowed. I think getting a license key would do and should also be under certain strict rules.

smashah commented 4 years ago

Thanks for the discussion and feedback everyone. I will be closing this issue but leaving it pinned for now.