git clone https://github.com/lorenzobarrantes/Bot.git
- Enviar mensaje de texto
- Enviar menus como botones o listas
- Enviar stickers
- Marcar los mensajes como "visto"
- Reaccionar con emojis los mensajes del usuario
- Enviar documentos pdf
- Dirigete al directorio donde descargaste el proyecto
cd chatbotwms
- Crea un ambiente virtual con al menos la version de python 3.10
Requiere pip y virtualenv
pip install pip
pip install virtualenv
Crear carpeta .venv (si no esta en la clonacion)
virtualenv .venv
- Activa el ambiente virtual
Linux/Mac
source .venv/bin/activate
Windows
.\.venv\Scripts\activate
- Instala las dependencias
pip install -r requirements.txt
- Corre la aplicacion
python app.py
- Checkear que este levantada http://127.0.0.1:5000/bienvenido
Ingresar la URL
http://127.0.0.1:5000/webhook
Hacer un POST
en body, seleccionar "raw" y tipo "JSON", no olvidar agregar tu número
{
"object": "whatsapp_business_account",
"entry": [{
"id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "PHONE_NUMBER",
"phone_number_id": "PHONE_NUMBER_ID"
},
"contacts": [{
"profile": {
"name": "NAME"
},
"wa_id": "PHONE_NUMBER"
}],
"messages": [{
"from": "agrega tu numero",
"id": "wamid.ID",
"timestamp": "TIMESTAMP",
"text": {
"body": "hola"
},
"type": "text"
}]
},
"field": "messages"
}]
}]
}
video: https://www.youtube.com/watch?v=puYWiZDJnL0&ab_channel=bigdateros