whatsapp-web-reveng icon indicating copy to clipboard operation
whatsapp-web-reveng copied to clipboard

sendTextMessage not working

Open merbekta opened this issue 5 years ago • 6 comments

Response

DeepinScreenshot_select-area_20190626172009

merbekta avatar Jun 26 '19 14:06 merbekta

I am facing the same

kaykyr avatar Sep 16 '19 22:09 kaykyr

@merbekta Did you succeeded on fixing this issue?

kaykyr avatar Sep 16 '19 23:09 kaykyr

Show the code you’re using to send messages

sthales avatar Sep 16 '19 23:09 sthales

Show the code you’re using to send messages

Hello! My code?

    def sendTextMessage(self, number, text):
        messageId = "3EB0"+binascii.hexlify(Random.get_random_bytes(8)).upper()
        messageTag = str(getTimestamp())
        messageParams = {"key": {"fromMe": True, "remoteJid": number + "@s.whatsapp.net", "id": messageId},"messageTimestamp": getTimestamp(), "status": 1, "message": {"conversation": text}}
        msgData = ["action", {"type": "relay", "epoch": str(self.messageSentCount)},[["message", None, WAWebMessageInfo.encode(messageParams)]]]
        encryptedMessage = WhatsAppEncrypt(self.loginInfo[self.instance]["key"]["encKey"], self.loginInfo[self.instance]["key"]["macKey"],whatsappWriteBinary(msgData))
        payload = bytearray(messageId) + bytearray(",") + bytearray(to_bytes(WAMetrics.MESSAGE, 1)) + bytearray([0x80]) + encryptedMessage
        self.messageSentCount = self.messageSentCount + 1
        self.messageQueue[messageId] = {"desc": "__sending"}
        self.activeWs.send(payload, websocket.ABNF.OPCODE_BINARY)

kaykyr avatar Sep 16 '19 23:09 kaykyr

@merbekta Did you succeeded on fixing this issue?

I couldn't

merbekta avatar Sep 17 '19 05:09 merbekta

Hello @kaykyr Have you successfully implemented this in python???

Manjit2003 avatar Jan 07 '20 16:01 Manjit2003