This change modifies the Evolution Bot integration to:
- Split messages on double newline characters (\n\n) and send each part as a separate message in WhatsApp.
- Add a typing delay before sending messages to simulate a more natural, human-like typing experience.
These updates enhance user interaction by breaking long messages into manageable parts and making bot responses feel more conversational.
Adiciona o controlador de chamadas para oferecer chamadas falsas.
- Adiciona o arquivo `call.controller.ts` com a classe `CallController` que possui o método `offerCall` para oferecer chamadas falsas.
- Adiciona o arquivo `call.dto.ts` com as classes `Metadata` e `OfferCallDto` para definir os dados da chamada.
- Atualiza o arquivo `sendMessage.dto.ts` removendo a classe `OfferCallDto`.
- Atualiza o arquivo `whatsapp.baileys.service.ts` importando a classe `OfferCallDto` corretamente e atualizando o método `offerCall` para receber os parâmetros corretos.
- Adiciona o arquivo `call.router.ts` com a classe `CallRouter` para lidar com as rotas relacionadas a chamadas.
- Atualiza o arquivo `index.router.ts` para incluir as rotas relacionadas a chamadas.
Currently, we face an issue when a file with the same name is uploaded more than once:
1. It results in a unique key error in the database.
2. If the file is sent to S3, it overwrites the old file.
To resolve this problem, I've implemented a solution where we concatenate the message ID to the filename. This approach ensures uniqueness for each uploaded file, even if users upload files with identical names multiple times in a chat.
This change allows normal users to upload files with the same name multiple times in a chat without encountering errors or unintended file overwrites.
An error in the WhatsApp audio message handler has been fixed. The system now checks if the file has a valid buffer before sending it. Additionally, validation has been added to verify if the audio is a valid URL or Base64. If these conditions are not met, an error message is shown, and a BadRequestException is thrown.