From 91459846ff375f6dc02644f920a4a9608cd41f2f Mon Sep 17 00:00:00 2001 From: shinchik17 Date: Tue, 13 Jan 2026 11:41:18 +0300 Subject: [PATCH 1/3] fix: update roles extension to use with ptb v22.5 --- ptbcontrib/roles/roleshandler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ptbcontrib/roles/roleshandler.py b/ptbcontrib/roles/roleshandler.py index 012a5ef..43a4c29 100644 --- a/ptbcontrib/roles/roleshandler.py +++ b/ptbcontrib/roles/roleshandler.py @@ -87,9 +87,9 @@ def setup_roles(application: Application) -> Roles: _CCT = TypeVar("_CCT", bound=CallbackContext) +RT = TypeVar("RT") - -class RolesHandler(BaseHandler[Update, _CCT]): +class RolesHandler(BaseHandler[Update, _CCT, RT]): """ A handler that acts as wrapper for existing handler classes allowing to add roles for user access management. You must call :meth:`setup_roles` before this handler can work. @@ -111,7 +111,7 @@ class RolesHandler(BaseHandler[Update, _CCT]): """ def __init__( - self, handler: BaseHandler[Update, _CCT], roles: Union[Role, InvertedRole, None] + self, handler: BaseHandler[Update, _CCT, RT], roles: Union[Role, InvertedRole, None] ) -> None: self.handler = handler self.roles: Union[Role, InvertedRole, None] = roles From f5575560a84dec209b1a143726c80a25b9617b46 Mon Sep 17 00:00:00 2001 From: shinchik17 Date: Fri, 16 Jan 2026 10:34:48 +0300 Subject: [PATCH 2/3] fix: roles ext requirements --- ptbcontrib/roles/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ptbcontrib/roles/requirements.txt b/ptbcontrib/roles/requirements.txt index 688b2c0..1c66edc 100644 --- a/ptbcontrib/roles/requirements.txt +++ b/ptbcontrib/roles/requirements.txt @@ -1 +1 @@ -python-telegram-bot~=20.0 +python-telegram-bot~=21.6 From 6c969a2a327eacd8746ea5c622ee2d2085f96096 Mon Sep 17 00:00:00 2001 From: shinchik17 Date: Sat, 17 Jan 2026 11:41:27 +0300 Subject: [PATCH 3/3] style: fix formating according to pre-commit check --- ptbcontrib/roles/roleshandler.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ptbcontrib/roles/roleshandler.py b/ptbcontrib/roles/roleshandler.py index 43a4c29..f61755f 100644 --- a/ptbcontrib/roles/roleshandler.py +++ b/ptbcontrib/roles/roleshandler.py @@ -89,6 +89,7 @@ def setup_roles(application: Application) -> Roles: _CCT = TypeVar("_CCT", bound=CallbackContext) RT = TypeVar("RT") + class RolesHandler(BaseHandler[Update, _CCT, RT]): """ A handler that acts as wrapper for existing handler classes allowing to add roles for