tulir / whatsmeow

Go library for the WhatsApp web multidevice API
https://go.mau.fi/whatsmeow
Mozilla Public License 2.0
2.25k stars 418 forks source link

When I send a docx file it turns into a zip file #648

Closed tasovayasin closed 2 months ago

tasovayasin commented 2 months ago

I can send pdf or txt but i can't send docx file.

msgV = &waE2E.Message{DocumentMessage: &waE2E.DocumentMessage{
    Caption:       proto.String(caption),
    URL:           proto.String(uploaded.URL),
    DirectPath:    proto.String(uploaded.DirectPath),
    MediaKey:      uploaded.MediaKey,
    Mimetype:      proto.String(http.DetectContentType([]byte(data))),
    FileEncSHA256: uploaded.FileEncSHA256,
    FileSHA256:    uploaded.FileSHA256,
    FileLength:    proto.Uint64(uint64(len(data))),
}}

}

resp, err := cli.SendMessage(context.Background(), recipient, msgV, whatsmeow.SendRequestExtra{
MediaHandle: uploaded.Handle,
})
tulir commented 2 months ago

This is just user error, whatsmeow does not touch files