From 4f15a7feeeebb7d3bdeb1be03be3ce1e10e4e81d Mon Sep 17 00:00:00 2001 From: Iulian Onofrei <5748627+revolter@users.noreply.github.com> Date: Fri, 19 May 2023 21:09:16 +0100 Subject: [PATCH] Fix Inconsistent Type Hints for `timeout` Parameter of `Bot.get_updates` (#3709) --- telegram/_bot.py | 2 +- telegram/ext/_application.py | 2 +- telegram/ext/_extbot.py | 2 +- telegram/ext/_updater.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/telegram/_bot.py b/telegram/_bot.py index 9f2cd2467..a6b466002 100644 --- a/telegram/_bot.py +++ b/telegram/_bot.py @@ -3586,7 +3586,7 @@ class Bot(TelegramObject, AsyncContextManager["Bot"]): self, offset: Optional[int] = None, limit: Optional[int] = None, - timeout: Optional[float] = None, + timeout: Optional[int] = None, allowed_updates: Optional[Sequence[str]] = None, *, read_timeout: float = 2, diff --git a/telegram/ext/_application.py b/telegram/ext/_application.py index af2921672..7452e4c9c 100644 --- a/telegram/ext/_application.py +++ b/telegram/ext/_application.py @@ -673,7 +673,7 @@ class Application(Generic[BT, CCT, UD, CD, BD, JQ], AsyncContextManager["Applica 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 704957fcd..c0f37efd9 100644 --- a/telegram/ext/_extbot.py +++ b/telegram/ext/_extbot.py @@ -531,7 +531,7 @@ class ExtBot(Bot, Generic[RLARGS]): self, offset: Optional[int] = None, limit: Optional[int] = None, - timeout: Optional[float] = None, + timeout: Optional[int] = None, allowed_updates: Optional[Sequence[str]] = None, *, read_timeout: float = 2, diff --git a/telegram/ext/_updater.py b/telegram/ext/_updater.py index 993091543..231500b15 100644 --- a/telegram/ext/_updater.py +++ b/telegram/ext/_updater.py @@ -202,7 +202,7 @@ class Updater(AsyncContextManager["Updater"]): 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.