From 2e2187ebf4e40510ed5c05ce50cf067857591bb0 Mon Sep 17 00:00:00 2001 From: ValdikSS Date: Mon, 29 Jan 2018 14:07:26 +0300 Subject: Enable Long Polling for Telegram. Reduces bandwidth consumption. (#350) Fixes #349. --- bridge/telegram/telegram.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bridge/telegram/telegram.go') diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go index 2aabf3a8..9ce4eb14 100644 --- a/bridge/telegram/telegram.go +++ b/bridge/telegram/telegram.go @@ -35,7 +35,9 @@ func (b *Btelegram) Connect() error { flog.Debugf("%#v", err) return err } - updates, err := b.c.GetUpdatesChan(tgbotapi.NewUpdate(0)) + u := tgbotapi.NewUpdate(0) + u.Timeout = 60 + updates, err := b.c.GetUpdatesChan(u) if err != nil { flog.Debugf("%#v", err) return err -- cgit v1.2.3