code-chat-br / whatsapp-api

CodeChat - WhatsApp Api
https://docs.codechat.dev
Apache License 2.0
566 stars 236 forks source link

Exclusão de Mensagens. #115

Closed lucianosg closed 3 months ago

lucianosg commented 5 months ago

Não estou conseguindo excluir mensagens através da API.

Retorno ao tentar excluir pela API uma mensagem enviada pelo celular: DELETE /chat/deleteMessageForEveryone/xxxxxxxx?id=3ABB7F7EBE8FFA851ECFDEBF45A08B53 HTTP/1.1 Host: 999.99.999.999:9999 apikey: xxxxxxxxxx

http://999.99.999.999:9999/chat/deleteMessageForEveryone/xxxxxxxxx?id=3ABB7F7EBE8FFA851ECFDEBF45A08B53 { "status": 500, "error": "Internal Server Error", "message": [ "Error while deleting message for everyone", "TypeError: Cannot read properties of null (reading 'keyRemoteJid')" ] }

Retorno ao tentar excluir pela API uma mensagem enviada através da API: DELETE /chat/deleteMessageForEveryone/xxxxxxxx?id=BAE505E4A9DE1743 HTTP/1.1 Host: 999.99.999.999:9999 apikey: xxxxxxxxxx

http://999.99.999.999:9999/chat/deleteMessageForEveryone/xxxxxxxxx?id=BAE505E4A9DE1743 { "status": 500, "error": "Internal Server Error", "message": [ "Error while deleting message for everyone", "PrismaClientValidationError: \nInvalid this.repository.message.findUnique() invocation in\n/codechat/dist/src/whatsapp/services/whatsapp.service.js:1377:63\n\n 1374 return __awaiter(this, void 0, void 0, function* () {\n 1375 try {\n 1376 const id = Number.parseInt(del.id);\n→ 1377 const message = yield this.repository.message.findUnique({\n where: {\n + id: Int\n }\n })\n\nArgument id is missing." ] }

Ao excluir no celular mensagens enviadas por ele recebo notificação do procedimento, mas ao excluir no celular mensagens enviadas pela API o mesmo não acontece.

Percebi que a composição do ID das mensagens são diferentes. Não sei se teria algo a ver. O mais provável é que esteja fazendo algo errado.

A versão que estou usando é 1.3.0.36.

jrCleber commented 3 months ago

Desconecta e reconecta. Tente deletar a mensagem novamente.

Informe aqui se o erro persistir.