diff --git a/bot.go b/bot.go index c58afec4..8f933ff2 100644 --- a/bot.go +++ b/bot.go @@ -539,9 +539,15 @@ func WriteToHTTPResponse(w http.ResponseWriter, c Chattable) error { } if t, ok := c.(Fileable); ok { - if hasFilesNeedingUpload(t.files()) { + files := t.files() + + if hasFilesNeedingUpload(files) { return errors.New("unable to use http response to upload files") } + + for _, file := range files { + params[file.Name] = file.Data.SendData() + } } values := buildParams(params)