aboutsummaryrefslogtreecommitdiff
path: root/uploads.go
diff options
context:
space:
mode:
authorAlexander Kiryukhin <a.kiryukhin@mail.ru>2019-08-09 02:16:08 +0300
committerAlexander Kiryukhin <a.kiryukhin@mail.ru>2019-08-09 02:16:08 +0300
commit188740f248bf26934aa8db832f5c9c9b9418b2fc (patch)
tree89f2c9f5ab9ba267862d16b9d0dc048b00f06fea /uploads.go
parent94c96cef29cd83bc60b2eabb8bb89c9fd8c7059b (diff)
0.1.8 Release -- small fixes
Diffstat (limited to 'uploads.go')
-rw-r--r--uploads.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/uploads.go b/uploads.go
index 57b2ce8..7800fab 100644
--- a/uploads.go
+++ b/uploads.go
@@ -1,5 +1,5 @@
-// Package tamtam implements TamTam Bot API
-// Copyright (c) 2019 Alexander Kiryukhin <a.kiryukhin@mail.ru>
+//Package tamtam implements TamTam Bot API
+//Copyright (c) 2019 Alexander Kiryukhin <a.kiryukhin@mail.ru>
package tamtam
import (
@@ -21,6 +21,7 @@ func newUploads(client *client) *uploads {
return &uploads{client: client}
}
+//GetUploadURL returns url to upload files
func (a *uploads) GetUploadURL(uploadType UploadType) (*UploadEndpoint, error) {
result := new(UploadEndpoint)
values := url.Values{}
@@ -37,6 +38,7 @@ func (a *uploads) GetUploadURL(uploadType UploadType) (*UploadEndpoint, error) {
return result, json.NewDecoder(body).Decode(result)
}
+//UploadMedia uploads file to TamTam server
func (a *uploads) UploadMedia(uploadType UploadType, filename string) (*UploadedInfo, error) {
bodyBuf := &bytes.Buffer{}
bodyWriter := multipart.NewWriter(bodyBuf)