From 0a4e2eaf3a7d00e5d85106a1b10a37246c72b819 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 5 May 2019 15:35:47 +0200 Subject: [PATCH] Fix telegram connection pool bug --- royalnet/bots/telegram.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/royalnet/bots/telegram.py b/royalnet/bots/telegram.py index 43ac64df..b61884ef 100644 --- a/royalnet/bots/telegram.py +++ b/royalnet/bots/telegram.py @@ -1,4 +1,5 @@ import telegram +from telegram.utils.request import Request import asyncio import typing import logging as _logging @@ -25,7 +26,9 @@ class TelegramBot(GenericBot): def _init_client(self): """Create the :py:class:`telegram.Bot`, and set the starting offset.""" - self.client = telegram.Bot(self._telegram_config.token) + # https://github.com/python-telegram-bot/python-telegram-bot/issues/341 + request = Request(5) + self.client = telegram.Bot(self._telegram_config.token, request=request) self._offset: int = -100 def _call_factory(self) -> typing.Type[Call]: