PaiGram/utils/base.py

17 lines
417 B
Python
Raw Normal View History

from telegram.ext import CallbackContext, ExtBot
from service import BaseService
class PaimonContext(CallbackContext[ExtBot, dict, dict, dict]):
"""
PaimoeContext
"""
@property
def service(self) -> BaseService:
value = self.bot_data.get("service")
if value is None:
raise RuntimeError("没有与此上下文对象关联的实例化服务")
return value