File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import logging
4- from typing import Any , Protocol
4+ from typing import TYPE_CHECKING , Any
55
66from astrbot .core import html_renderer
77from astrbot .core .utils .command_parser import CommandParserMixin
88from astrbot .core .utils .plugin_kv_store import PluginKVStoreMixin
99
1010from .star import StarMetadata , star_map , star_registry
1111
12+ if TYPE_CHECKING :
13+ from .context import Context
14+
1215logger = logging .getLogger ("astrbot" )
1316
1417
@@ -17,11 +20,9 @@ class Star(CommandParserMixin, PluginKVStoreMixin):
1720
1821 author : str
1922 name : str
23+ context : Context
2024
21- class _ContextLike (Protocol ):
22- def get_config (self , umo : str | None = None ) -> Any : ...
23-
24- def __init__ (self , context : _ContextLike , config : dict | None = None ) -> None :
25+ def __init__ (self , context : Context , config : dict | None = None ) -> None :
2526 self .context = context
2627
2728 def _get_context_config (self ) -> Any :
You can’t perform that action at this time.
0 commit comments