pre implement cache

This commit is contained in:
2025-02-22 13:06:06 +08:00
parent 5eb3c66232
commit e1bc81c9e1
4 changed files with 37 additions and 1 deletions

View File

@ -11,6 +11,25 @@ from nonebot import logger
from .config import config
class Cache:
"""
缓存类
"""
def __init__(self):
self.cache = {}
def get(self, key):
if key in self.cache:
return self.cache[key]
else:
self.cache[key] = None
return None
def set(self, key, value):
self.cache[key] = value
class MarshoContext:
"""
Marsho 的上下文类