diff --git a/aiogram/utils/context.py b/aiogram/utils/context.py index 2a846b23..77861eaa 100644 --- a/aiogram/utils/context.py +++ b/aiogram/utils/context.py @@ -114,3 +114,25 @@ def check_configured(): :return: """ return get_value(CONFIGURED) + + +class _Context: + """ + Other things for interactions with the execution context. + """ + + def __getitem__(self, item): + return get_value(item) + + def __setitem__(self, key, value): + set_value(key, value) + + def __delitem__(self, key): + del_value(key) + + @staticmethod + def get_context(): + return get_current_state() + + +context = _Context()