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

Add the possibility to getbase class of a State object

This commit is contained in:
_run 2022-06-29 20:21:42 +05:00
parent fbb9a73fc0
commit fec47cecaf
2 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,7 @@ class StatesGroup:
if not name.startswith('__') and not callable(value) and isinstance(value, State): if not name.startswith('__') and not callable(value) and isinstance(value, State):
# change value of that variable # change value of that variable
value.name = ':'.join((cls.__name__, name)) value.name = ':'.join((cls.__name__, name))
value.group = cls
class SkipHandler: class SkipHandler:

View File

@ -163,6 +163,10 @@ class StatesGroup:
if not name.startswith('__') and not callable(value) and isinstance(value, State): if not name.startswith('__') and not callable(value) and isinstance(value, State):
# change value of that variable # change value of that variable
value.name = ':'.join((cls.__name__, name)) value.name = ':'.join((cls.__name__, name))
value.group = cls
class BaseMiddleware: class BaseMiddleware: