Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/core/elements/temp/__init__.py

31 lines
579 B
Python
Raw Normal View History

2021-10-20 14:04:30 +00:00
from typing import Union
2021-08-25 11:23:59 +00:00
class EnabledModulesCache:
_cache = {}
@staticmethod
def add_cache(key, value):
EnabledModulesCache._cache[key] = value
@staticmethod
def get_cache(key):
return EnabledModulesCache._cache.get(key, False)
class SenderInfoCache:
_cache = {}
@staticmethod
def add_cache(key, value):
SenderInfoCache._cache[key] = value
@staticmethod
2021-10-20 14:04:30 +00:00
def get_cache(key) -> Union[dict, bool]:
2021-08-25 11:23:59 +00:00
return SenderInfoCache._cache.get(key, False)
2021-09-10 18:05:27 +00:00
2021-10-14 15:29:45 +00:00
2021-08-25 11:23:59 +00:00
__all__ = ["EnabledModulesCache", "SenderInfoCache"]