Make DocumentMessage handler use FileName attribute (whatsapp) (#1488)

* [whatsapp] make DocumentMessage handler use FileName attribute.

referenced: https://github.com/Rhymen/go-whatsapp/blob/master/message.go#L582

* fix lint
This commit is contained in:
Avinash Reddy 2021-05-26 03:36:45 +05:30 committed by GitHub
parent 4b4b2d790e
commit 4fcad8e04b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -359,9 +359,9 @@ func (b *Bwhatsapp) HandleDocumentMessage(message whatsapp.DocumentMessage) {
return
}
filename := fmt.Sprintf("%v%v", message.Info.Id, fileExt[0])
filename := fmt.Sprintf("%v", message.FileName)
b.Log.Debugf("Trying to download %s with type %s", filename, message.Type)
b.Log.Debugf("Trying to download %s with extension %s and type %s", filename, fileExt, message.Type)
data, err := message.Download()
if err != nil {