summaryrefslogtreecommitdiffstats
path: root/bridge/telegram/telegram.go
diff options
context:
space:
mode:
authorValdikSS <iam@valdikss.org.ru>2018-01-29 14:07:26 +0300
committerWim <wim@42.be>2018-01-29 12:07:26 +0100
commit2e2187ebf4e40510ed5c05ce50cf067857591bb0 (patch)
treeb9c0ab09c2919d6f906433faa1ec49f10f567109 /bridge/telegram/telegram.go
parent762c3350f47d5e1288153c78ba619dde42be397a (diff)
downloadmatterbridge-msglm-2e2187ebf4e40510ed5c05ce50cf067857591bb0.tar.gz
matterbridge-msglm-2e2187ebf4e40510ed5c05ce50cf067857591bb0.tar.bz2
matterbridge-msglm-2e2187ebf4e40510ed5c05ce50cf067857591bb0.zip
Enable Long Polling for Telegram. Reduces bandwidth consumption. (#350)
Fixes #349.
Diffstat (limited to 'bridge/telegram/telegram.go')
-rw-r--r--bridge/telegram/telegram.go4
1 files changed, 3 insertions, 1 deletions
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