green-api/whatsapp-api-client-python

Q | Create a WhatsApp bot

Closed this issue · 3 comments

Hey there, I was wondering if there is an option to create a WhatsApp bot like a Discord bot by any chance?
~ In simple terms, to control an account who isn't yours, but is defined as an official WhatsApp bot.


My goal in the purpose of the program is to send (not through my account. maybe, from a bot/webhook) all the messages I receive from group x to group y.

Anyways, thanks for any incoming reply(:

Please clarify, do you want to have a WhatsApp bot that would listen to some kind of group or chat and forward messages from there to another chat?

Yes, you can write such a bot, but you will need a separate phone number and instance for this bot.

For example, you have an instance “A” to which you have your personal phone number attached. And also instance “B” to which the bot’s phone number is attached.
Your application should listen to webhooks from instance “A” and, if it receives an incoming message from your group X, forward its contents to group Y but from instance “B”.

Understood. Sorry for the poor explanation. I thought there is a system which maintains bots (of course without an attached phone number), in any case - irrelevant.

So is there a type of event that handles incoming and outgoing messages?

Unfortunately, there are no bots on WhatsApp without phone numbers like there are on Telegram or Discord.

Yes, all types of webhooks are described in our documentation:
https://greenapi.com/en/docs/api/receiving/notifications-format/

You can filter incoming messages by fields of the senderData object to determine the list of groups you want to listen to:
https://greenapi.com/en/docs/api/receiving/notifications-format/incoming-message/Webhook-IncomingMessageReceived/