How to limit the number of messages a user writes ...
# 🤝help
b
I have seen the websites of some of you that offer the chatbot service and observed that none of them have a chatbot available to answer questions. I imagine it must be because of the cost. I would like to give some kind of solution to that by imitating the number of messages that a person can make in a connection. Do you have anything developed that you can share with me please? --------------------- He visto las páginas web de algunos de ustedes que ofrecen el servicio de chatbot y he observado que ninguno de ellos tiene un chatbot disponible para responder preguntas. Supongo que debe ser por el costo. Me gustaría dar alguna especie de solución a eso imitando la cantidad de mensajes que una persona puede enviar en una conexión. ¿Tienes algo desarrollado que puedas compartir conmigo por favor? 🆙👍😌
b
Try to watch this one

https://youtu.be/OOr3don1X-E?si=vAm6JTLiByroMDsP

, time code 18:20, he explains how to set message counter and with that you can manage it for your needs
b
I share what I did, I hope it helps you. More questions through this same channel. This is what I did: if (!user.mensajes) { user.mensajes = 0 } user.mensajes += 1; console.log(
cantidad de mensajes QQQQ: "${user.mensajes}"
) // Check if the user has reached the message limit Te comparto lo que hice, espero que te ayude. Más preguntas por este mismo canal.
What I'm doing is that if the user of the Chat sends a key in the same chat, the bot looks for it in a table and if the key is there, it deletes the data from the table and resets the message counter. Again, the chat can be used. I'm trying to figure out where I can store those keys in a table in the same Chat. Who can help me please? I'll share the code if it works, you know I'm generous. > Lo que estoy haciendo es que si el usuario del Chat envia una clave en el mimo chat, el bot la busca en una tabla y si esta allí la clave, borra el dato de la tabla y reinicia el contador de mensajes. Nuevamente el chat puede ser usado. > Estoy tartando de aprender donde puedo guardar esas claves en una tabla en el mismo Chat ¿Quien me ayuda por favor? . Yo comparto el codigo si resulta, ustedes saben que soy generoso.
Guys, here's my code for you to share this wonderful solution. > Muchachos, aquí les dejo mi código para compartir esta solución maravillosa.
Only 3 messages available > Sólo 3 mensajes disponibles
If you have any better ideas or improvements for the code, I would really appreciate it if you could share them with me here. 🔥 👍 > Si tienen alguna idea mejor o alguna mejora para el código, les agradecería mucho que me la compartieran aquí.
❤️‍🔥 ❤️‍🔥 I need help learning how to delete rows from the "Data3Table" table. If the key "CLAVE12345" is used, I have to delete that record line where that key is or also add a "FLAG" field that if it is 1 the key "CLAVE12345" is enabled and if it is 0 it is disabled. What do you guys think is better? ❤️‍🔥 > Necesito me ayuden a aprende ra borrar las filas de la tabla "Data3Table", si se usa la clave "CLAVE12345", tengo que borrar esa linea de registro donde esta esa clave o tambien agregarle un campo "FLAG" que si es 1 la clave "CLAVE12345" esta habilitada y si es 0 esta desabilitada. ¿Que piensan ustedes es mejor?
a
I have a similar question, I want to limit the use of messages or tokens in a conversation and then display a message explaining that it is no longer possible to chat. idk, something similar, thanks.
3 Views