aboutsummaryrefslogtreecommitdiff
path: root/api.go
diff options
context:
space:
mode:
authorAlexander Kiryukhin <a.kiryukhin@mail.ru>2019-08-09 17:52:33 +0300
committerAlexander Kiryukhin <a.kiryukhin@mail.ru>2019-08-09 17:52:48 +0300
commitb87e42f3294318244deae8126b3ac18d543fd3d7 (patch)
tree2b4fe1f84b07ddf80a6cb863c385293c5d2c4496 /api.go
parenta8ca31679d01ddfe461cadb994131986639b4ea1 (diff)
fix uploadsv0.2.0
Diffstat (limited to 'api.go')
-rw-r--r--api.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/api.go b/api.go
index 53ff484..1591398 100644
--- a/api.go
+++ b/api.go
@@ -28,8 +28,9 @@ type Api struct {
// New TamTam Api object
func New(key string) *Api {
+ timeout := 30
u, _ := url.Parse("https://botapi.tamtam.chat/")
- cl := newClient(key, "0.1.8", u)
+ cl := newClient(key, "0.1.8", u, &http.Client{Timeout: time.Duration(timeout) * time.Second})
return &Api{
Bots: newBots(cl),
Chats: newChats(cl),
@@ -38,7 +39,7 @@ func New(key string) *Api {
Subscriptions: newSubscriptions(cl),
client: cl,
updates: make(chan UpdateInterface),
- timeout: 30,
+ timeout: timeout,
pause: 1,
}
}