WAppAI / assistant

A WhatsApp chatbot that leverages Bing AI's and others LLMs conversational capabilities.
MIT License
93 stars 31 forks source link

Optional whitelist environment variable #68

Closed veigamann closed 1 year ago

veigamann commented 1 year ago

Currently, the bot responds to all incoming messages, regardless of the sender's phone number. To provide more control over who can interact with Sydney, we need to implement an optional whitelist feature.

This feature preposition aims to introduce an environment variable to define a whitelist of phone numbers to which the bot will respond. The following considerations should be taken into account:

  1. If the whitelist environment variable is left blank or undefined, the bot should continue to respond to any phone number as it does currently.

  2. If the user opts to use the whitelist feature, they should be able to specify a list of phone numbers (with the country code) separated by commas. For example: WHITELIST="5515999999999,491111111111"

  3. When the bot receives an invitation to join a group chat, it should verify if the inviting phone number is included in the whitelist. If the phone number is not whitelisted, the bot should decline the invitation.

  4. Once inside a group chat, the bot should respond to any participant, regardless of whether their phone number is included in the whitelist or not.

veigamann commented 1 year ago

Implemented in 4d9695d