Android Question WhatsApp Bot

EduardoElias

Well-Known Member
Licensed User
Longtime User
Hi there,

I have tried a Bot on whatsapp that is for asking about medicine information.

you add as a normal phone number and when I write a name of medication it gives me back a text and options like 1, 2, 3 .... so it follows a menu context showing other information.

I want to do the same, if possiblie, using b4a to create a bot to answer customers inquires.

is it possible?

Anyone ever tried that?

thank you
 

DonManfred

Expert
Licensed User
Longtime User
Whatsapp does NOT provide any Api. How will you "read" the Message incoming?
I dont think that it is possible to create an Whatsapp-Bot (it is not allowed by their rules).

Please note that Whatsapp does not encourage bots on their messaging service. Any mass advertising or spamming will lead to your account being banned.
 
Last edited:
Upvote 0

BillMeyer

Well-Known Member
Licensed User
Longtime User
As @DonManfred says, it is virtually impossible to automate Whats Apps and will lead to frustration by the user.

My suggestion would be to use MQTT, such as in this link, and with some clever programming you could achieve this quiet easily. To make it pretty you could use (link)

Now, If I had anything to do with it, I would have my jRDC2 server running hooked up to a MySQL Database to fetch all my data as required. Then I would have a MQTT Server running that will handle all my messaging and with some clever programming (a few cups of coffee in between) I can send a MQTT message to my B4J back end - that would look at what I am asking, request the information from the jRDC2 Server and return it via MQTT.

Now the catch is here. MQTT is a publish/subscribe system, so if you send the MQTT message without a few tricks, then everyone will receive it. EISH !! All you need to do is make sure your requesting app publishes the message to the server only. In this message that you are sending to the server, (use jSON) include the sending user name to the server, which you then use to send the message back to the user who sent it, by publishing to that name only.

My apologies if this is a disruptive spanner in the works reply - but it works for me.
 
Upvote 0

EduardoElias

Well-Known Member
Licensed User
Longtime User
Whatsapp does NOT provide any Api. How will you "read" the Message incoming?
I dont think that it is possible to create an Whatsapp-Bot (it is not allowed by their rules).

Please note that Whatsapp does not encourage bots on their messaging service. Any mass advertising or spamming will lead to your account being banned.
There are some doing that, and in a big scale

So, there is a way
 
Upvote 0

DavideV

Active Member
Licensed User
Longtime User
Telegram allows BOT and there is a free api on their homepage. The api also works with IoT devices as well through http calls. A simple app in B4A can be done.

Edit: the KLM company sends updates about their flights over whatsapp, i don't know if it is an automated service (maybe a desktop pc app that acts like a bot) or not
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
i don't know if it is an automated service (maybe a desktop pc app that acts like a bot) or not
It can be easily done with the pc-whatsapp i guess.

I saw a few python scripts which seems to communicate with the web-whatsapp version. Don´t know how they do it. Just found python references using google search...
 
Upvote 0

jsaplication.mobile

Member
Licensed User
Hi there,

I have tried a Bot on whatsapp that is for asking about medicine information.

you add as a normal phone number and when I write a name of medication it gives me back a text and options like 1, 2, 3 .... so it follows a menu context showing other information.

I want to do the same, if possiblie, using b4a to create a bot to answer customers inquires.

is it possible?

Anyone ever tried that?

thank you
Visite https://www.b4x.com/android/forum/t...legram-background-service.138920/#post-881633
 
Upvote 0
Top