mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 01:54:53 +00:00
Wut? Class with item assignments for context.
This commit is contained in:
parent
ed6ae575d1
commit
4ee54ea4e6
1 changed files with 22 additions and 0 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue