mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
format
This commit is contained in:
parent
ea58ee4137
commit
67e651e239
1 changed files with 4 additions and 2 deletions
|
|
@ -3,7 +3,8 @@ from itertools import chain
|
|||
from typing import List
|
||||
from aiogram.dispatcher.dispatcher import Dispatcher
|
||||
|
||||
AIOGRAM_INTERNAL_HANDLERS = ['update', 'error',]
|
||||
AIOGRAM_INTERNAL_HANDLERS = ['update', 'error', ]
|
||||
|
||||
|
||||
def get_handlers_in_use(dispatcher: Dispatcher, handlers_to_skip: List[str] = AIOGRAM_INTERNAL_HANDLERS) -> List[str]:
|
||||
handlers_in_use = []
|
||||
|
|
@ -14,6 +15,7 @@ def get_handlers_in_use(dispatcher: Dispatcher, handlers_to_skip: List[str] = AI
|
|||
handlers_in_use.extend(chain(*list(map(get_handlers_in_use, router))))
|
||||
else:
|
||||
for update_name, observer in router.observers.items():
|
||||
if (observer.handlers and update_name not in [*handlers_to_skip, *handlers_in_use]): handlers_in_use.append(update_name)
|
||||
if (observer.handlers and update_name not in [*handlers_to_skip, *handlers_in_use]):
|
||||
handlers_in_use.append(update_name)
|
||||
|
||||
return handlers_in_use
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue