🚑refactor(config): 修复模型type校验

This commit is contained in:
molanp 2025-07-11 22:41:21 +08:00
parent 632ec3e46e
commit c1368ab4ac
2 changed files with 3 additions and 3 deletions

View File

@ -46,7 +46,7 @@ def _handle_config(plugin: Plugin, exists_module: list[str]):
reg_config.value,
help=reg_config.help,
default_value=reg_config.default_value,
type=reg_config.type,
type=reg_config.type, # type: ignore
arg_parser=reg_config.arg_parser,
_override=False,
)

View File

@ -1,6 +1,6 @@
from collections.abc import Callable
from datetime import datetime
from typing import Any, Literal, Type # noqa: UP035
from typing import Any, Literal
from nonebot.compat import model_dump
from pydantic import BaseModel, Field
@ -65,7 +65,7 @@ class RegisterConfig(BaseModel):
"""配置注解"""
default_value: Any | None = None
"""默认值"""
type: Type = str # noqa: UP006
type: object = str
"""参数类型"""
arg_parser: Callable | None = None
"""参数解析"""