icq/files.go
Alexander Kiryukhin 9efc5ffd51 New BotApi
2019-08-13 15:26:05 +03:00

32 lines
485 B
Go

package icq
import (
"encoding/json"
"net/http"
"net/url"
)
type files struct {
client *client
}
func newFiles(client *client) *files {
return &files{client: client}
}
func (f *files) GetInfo(fileID string) (*FileInfo, error) {
resp, err := f.client.request(
http.MethodGet,
"/chats/getInfo",
url.Values{
"fileId": []string{fileID},
},
nil,
)
if err != nil {
return nil, err
}
result := new(FileInfo)
return result, json.NewDecoder(resp).Decode(result)
}