From 2e13c28ddd3326219caed04ba44195802bb7cd18 Mon Sep 17 00:00:00 2001 From: sheldygg Date: Wed, 8 Feb 2023 17:36:00 +0200 Subject: [PATCH] add new method for Router --- aiogram/dispatcher/router.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aiogram/dispatcher/router.py b/aiogram/dispatcher/router.py index f1ddc1c4..12f59fb1 100644 --- a/aiogram/dispatcher/router.py +++ b/aiogram/dispatcher/router.py @@ -179,6 +179,12 @@ class Router: self._parent_router = router router.sub_routers.append(self) + def include_routers(self, *routers): + if not routers: + raise ValueError("You must provide routers") + for router in routers: + self.include_router(router) + def include_router(self, router: Router) -> Router: """ Attach another router.