mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
add new method for Router
This commit is contained in:
parent
e8d279c8f2
commit
2e13c28ddd
1 changed files with 6 additions and 0 deletions
|
|
@ -179,6 +179,12 @@ class Router:
|
||||||
self._parent_router = router
|
self._parent_router = router
|
||||||
router.sub_routers.append(self)
|
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:
|
def include_router(self, router: Router) -> Router:
|
||||||
"""
|
"""
|
||||||
Attach another router.
|
Attach another router.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue