fix: lint warnings

This commit is contained in:
Soulter
2025-06-28 14:51:35 +08:00
parent 9a9017bc6c
commit d14513ddfd
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -18,8 +18,8 @@ class CommandFilter(HandlerFilter):
def __init__(
self,
command_name: str,
alias: set = None,
handler_md: StarHandlerMetadata = None,
alias: set | None = None,
handler_md: StarHandlerMetadata | None = None,
parent_command_names: List[str] = [""],
):
self.command_name = command_name
+2 -2
View File
@@ -11,7 +11,7 @@ ASTRBOT_T2I_DEFAULT_ENDPOINT = "https://t2i.soulter.top/text2img"
class NetworkRenderStrategy(RenderStrategy):
def __init__(self, base_url: str = ASTRBOT_T2I_DEFAULT_ENDPOINT) -> None:
def __init__(self, base_url: str | None = None) -> None:
super().__init__()
if not base_url:
base_url = ASTRBOT_T2I_DEFAULT_ENDPOINT
@@ -38,7 +38,7 @@ class NetworkRenderStrategy(RenderStrategy):
tmpl_str: str,
tmpl_data: dict,
return_url: bool = True,
options: dict = None,
options: dict | None = None,
) -> str:
"""使用自定义文转图模板"""
default_options = {"full_page": True, "type": "jpeg", "quality": 40}
+2 -2
View File
@@ -6,7 +6,7 @@ logger = LogManager.GetLogger(log_name="astrbot")
class HtmlRenderer:
def __init__(self, endpoint_url: str = None):
def __init__(self, endpoint_url: str | None = None):
self.network_strategy = NetworkRenderStrategy(endpoint_url)
self.local_strategy = LocalRenderStrategy()
@@ -20,7 +20,7 @@ class HtmlRenderer:
tmpl_str: str,
tmpl_data: dict,
return_url: bool = False,
options: dict = None,
options: dict | None = None,
):
"""使用自定义文转图模板。该方法会通过网络调用 t2i 终结点图文渲染API。
@param tmpl_str: HTML Jinja2 模板。