aboutsummaryrefslogtreecommitdiff
path: root/api.go
diff options
context:
space:
mode:
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,
}
}