# Respuestas aleatorias en el bot

Para enviar respuestas aleatorias a los clientes, configura las opciones a continuación. Puedes usar frases completas, palabras individuales, números o archivos adjuntos.

En el caso de que sea necesario enviar una frase, las opciones de respuesta deben escribirse en el formato <mark style="color:rojo;">**{**</mark>**texto1**<mark style="color:rojo;">**|**</mark>**texto2**<mark style="color:rojo;">**|**</mark>**texto3**<mark style="color:rojo;">**}**</mark>, por ejemplo:&#x20;

<div data-with-frame="true"><figure><img src="/files/5d1df1a776666b2b19fce035403f653177ca5a91" alt="" width="375"><figcaption></figcaption></figure></div>

Cómo funciona el bot:

<div data-with-frame="true"><figure><img src="/files/d8a0259c1203be3688b0db3ccc7c1a2926e42fb0" alt="" width="375"><figcaption></figcaption></figure></div>

### Envío de un archivo adjunto aleatorio:

Para mostrar aleatoriamente un enlace, la lista de URL debe escribirse en el formato \
**\<enlace1>**<mark style="color:rojo;">**<$>**</mark>**\<enlace2>**<mark style="color:rojo;">**<$>**</mark>**\<enlace3>**, ejemplo:&#x20;

<div data-with-frame="true"><figure><img src="/files/23e740a9580fc59efb93c27755497f1143052d8c" alt="" width="375"><figcaption></figcaption></figure></div>

&#x20;Prueba del bot:

<div data-with-frame="true"><figure><img src="/files/ec55e70e3fd84ad8dcdaafb31a2f0af2d0863814" alt="" width="375"><figcaption></figcaption></figure></div>

### Envío de un número aleatorio:

Para generar un número aleatorio, llama a la `random` función con límites inferior y superior y asígnala a una variable. Luego, muestra el valor en un mensaje del bot haciendo referencia a la variable dentro de `#{}`.

**Ejemplo:**

<div data-with-frame="true"><figure><img src="/files/2290575d8514134f28223f14de2c921e14bc6c9b" alt="" width="375"><figcaption></figcaption></figure></div>

Prueba del bot:

<div data-with-frame="true"><figure><img src="/files/02c6219f0c30e522407ac92a58eb3376f2c31d16" alt="" width="375"><figcaption></figcaption></figure></div>

### Envío de una frase aleatoria:&#x20;

Para reducir potencialmente el riesgo de ser bloqueado en las difusiones de WhatsApp, se recomienda variar ligeramente el contenido de tu mensaje para cada destinatario. Puedes automatizar esto usando llaves `{}` y la barra vertical `|` para definir variaciones de texto aleatorias dentro de una frase. Ejemplo:

<mark style="color:rojo;">**{**</mark>**Hola**<mark style="color:rojo;">**|**</mark>**Hola**<mark style="color:rojo;">**}**</mark>. Quiero vender mi programa de formación.

<div data-with-frame="true"><figure><img src="/files/4998bf2de1da320cac132a0a7a8f8657e1fbf57a" alt="" width="360"><figcaption></figcaption></figure></div>

Respuestas del bot:

<div data-with-frame="true"><figure><img src="/files/ae72468fa51278cea1960f6f7d14146bedb6443f" alt="" width="443"><figcaption></figcaption></figure></div>

### Envío de una respuesta aleatoria:

Tomemos un ejemplo de cómo enviar un comentario seleccionado aleatoriamente a un cliente **en Instagram**.

El **select\_random('str1|str2')** método se encarga de seleccionar una cadena aleatoria

donde  **str1 y str2** - son variables en cuyos valores se escriben las opciones de respuesta.

Para enviar una respuesta a un comentario debajo de una publicación que el cliente comentó - **insta\_create*****\_*****comment("str")**

donde **str**  - es la variable con el valor del resultado obtenido por el **select\_random** método.

{% hint style="info" %}
Puedes usar cualquier otro método de envío de mensajes en lugar de i**nsta\_create\_comment().**
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mavibot.ai/doc/es/chatbot/builder/responses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
