Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sendPresence #237

Merged
merged 3 commits into from
Dec 11, 2023

Conversation

gabrielpastori1
Copy link
Contributor

Hi Team,

This pull request introduces a new feature for sending presence status. Key changes include:

  1. Added presenceSchema in validate.schema.ts.
  2. Updated sendMessage.controller.ts with sendPresence method.
  3. Extended sendMessage.dto.ts with SendPresenceDto class.
  4. New POST route for presence sending in sendMessage.router.ts.
  5. Implemented sendPresence logic in whatsapp.service.ts.

@DavidsonGomes
Copy link
Collaborator

Excellent, please send us a description of the request so we can add it to Evolution's postman

@bergpinheiro
Copy link
Contributor

Esse endpoint envia o status digitando para o destinatário.

@gabrielpastori1
Copy link
Contributor Author

The request

curl --location '{{baseUrl}}/message/sendPresence/teste' \
--header 'Content-Type: application/json' \
--header 'apikey: {{apiKey}}' \
--data '{
    "number": "{{remoteJid}}",
    "options": {
        "delay": 2000, //ms
        "presence": "composing"
    }
}'

Usage

sendPresence.mp4

@bergpinheiro
Copy link
Contributor

No caso @gabrielpastori1 daria pra usar o status recording tambem?

@gabrielpastori1
Copy link
Contributor Author

No caso @gabrielpastori1 daria pra usar o status recording tambem?

Eu usei os status disponíveis no validete,schema.ts, acabei de fazer o teste e deu certo tb usando recording
image
image

@DavidsonGomes
Copy link
Collaborator

Ta legal a implementação, coloque na parte de chats e não em mensagens, alterando isso ja aprovo daqui!

@gabrielpastori1
Copy link
Contributor Author

gabrielpastori1 commented Dec 6, 2023

Estava fazendo a migração, mas olhando o código ele faz extends dos padrão de envio de mensagem, ele usa os mesmos valores de options do src\whatsapp\dto\sendMessage.dto.ts, acho que seria o mais ideal manter no sendMessage

image

@DavidsonGomes
Copy link
Collaborator

Estava fazendo a migração, mas olhando o código ele faz extends dos padrão de envio de mensagem, ele usa os mesmos valores de options do src\whatsapp\dto\sendMessage.dto.ts, acho que seria o mais ideal manter no sendMessage

image

A questao é o contexto onde se aplica a função, ela é aplicada no chat e não como o envio de uma mensage, da mesma forma que temos o read messages, delete messages, etc...

@gabrielpastori1
Copy link
Contributor Author

Pronto, mudei do /message/sendPresence/instance para /chat/sendPresence/instance

@DavidsonGomes DavidsonGomes merged commit fb63774 into EvolutionAPI:develop Dec 11, 2023
@gabrielpastori1 gabrielpastori1 deleted the add-send-presence branch December 11, 2023 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants