diff --git a/utils/base.py b/utils/base.py deleted file mode 100644 index a8da0a5..0000000 --- a/utils/base.py +++ /dev/null @@ -1,17 +0,0 @@ -from service import BaseService -from telegram.ext import CallbackContext, ExtBot - - -class PaimonContext(CallbackContext[ExtBot, dict, dict, dict]): - """自定义的PaimoeContext""" - - @property - def service(self) -> BaseService: - """在回调中从 bot_data 获取 service 实例 - - :return: BaseService 实例 - """ - value = self.application.bot_data.get("service") - if value is None: - raise RuntimeError("没有找到与此上下文对象关联的实例化服务") - return value