1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Add state_list to StatesGroup

This commit is contained in:
Cub11k 2023-04-14 22:00:42 +03:00
parent 1797f076dc
commit d466da3542
2 changed files with 11 additions and 1 deletions

View File

@ -81,6 +81,11 @@ class StatesGroup:
value.name = ':'.join((cls.__name__, name))
value.group = cls
@property
def state_list(self):
return [value for name, value in self.__dict__.items()
if not name.startswith('__') and not callable(value) and isinstance(value, State)]
class SkipHandler:
"""

View File

@ -191,7 +191,12 @@ class StatesGroup:
value.name = ':'.join((cls.__name__, name))
value.group = cls
@property
def state_list(self):
return [value for name, value in self.__dict__.items()
if not name.startswith('__') and not callable(value) and isinstance(value, State)]
class BaseMiddleware:
"""
Base class for middleware.