diff --git a/telegram/_bot.py b/telegram/_bot.py index 37241f70987..690d4e96228 100644 --- a/telegram/_bot.py +++ b/telegram/_bot.py @@ -3586,7 +3586,7 @@ async def get_updates( self, offset: int = None, limit: int = None, - timeout: float = None, + timeout: int = None, allowed_updates: Sequence[str] = None, *, read_timeout: float = 2, @@ -3661,7 +3661,7 @@ async def get_updates( await self._post( "getUpdates", data, - read_timeout=read_timeout + timeout if timeout else read_timeout, + read_timeout=read_timeout + float(timeout) if timeout else read_timeout, write_timeout=write_timeout, connect_timeout=connect_timeout, pool_timeout=pool_timeout, diff --git a/telegram/ext/_application.py b/telegram/ext/_application.py index 09c89222ff7..b1040e77544 100644 --- a/telegram/ext/_application.py +++ b/telegram/ext/_application.py @@ -673,7 +673,7 @@ def run_polling( Args: poll_interval (:obj:`float`, optional): Time to wait between polling updates from Telegram in seconds. Default is ``0.0``. - timeout (:obj:`float`, optional): Passed to + timeout (:obj:`int`, optional): Passed to :paramref:`telegram.Bot.get_updates.timeout`. Default is ``10`` seconds. bootstrap_retries (:obj:`int`, optional): Whether the bootstrapping phase of the :class:`telegram.ext.Updater` will retry on failures on the Telegram server. diff --git a/telegram/ext/_extbot.py b/telegram/ext/_extbot.py index eea4ad963ae..a1583aa2962 100644 --- a/telegram/ext/_extbot.py +++ b/telegram/ext/_extbot.py @@ -531,7 +531,7 @@ async def get_updates( self, offset: int = None, limit: int = None, - timeout: float = None, + timeout: int = None, allowed_updates: Sequence[str] = None, *, read_timeout: float = 2, diff --git a/telegram/ext/_updater.py b/telegram/ext/_updater.py index 1318e6c7b0a..688f6df6574 100644 --- a/telegram/ext/_updater.py +++ b/telegram/ext/_updater.py @@ -202,7 +202,7 @@ async def start_polling( Args: poll_interval (:obj:`float`, optional): Time to wait between polling updates from Telegram in seconds. Default is ``0.0``. - timeout (:obj:`float`, optional): Passed to + timeout (:obj:`int`, optional): Passed to :paramref:`telegram.Bot.get_updates.timeout`. Defaults to ``10`` seconds. bootstrap_retries (:obj:`int`, optional): Whether the bootstrapping phase of the :class:`telegram.ext.Updater` will retry on failures on the Telegram server.