From 926e6f826e9c3df8aab62f43ebf6dfe6dcea6df4 Mon Sep 17 00:00:00 2001 From: student_2333 Date: Sat, 6 Jul 2024 21:06:15 +0800 Subject: [PATCH] up --- nonebot_plugin_multincm/__init__.py | 2 +- nonebot_plugin_multincm/config.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nonebot_plugin_multincm/__init__.py b/nonebot_plugin_multincm/__init__.py index 4d1f7d4..6b8e3ed 100644 --- a/nonebot_plugin_multincm/__init__.py +++ b/nonebot_plugin_multincm/__init__.py @@ -29,7 +29,7 @@ "▶ Bot 会自动解析你发送的网易云链接\n" if config.ncm_auto_resolve else "" ) -__version__ = "1.1.0.post1" +__version__ = "1.1.0.post2" __plugin_meta__ = PluginMetadata( name="MultiNCM", description="网易云多选点歌", diff --git a/nonebot_plugin_multincm/config.py b/nonebot_plugin_multincm/config.py index 856a359..aae3197 100644 --- a/nonebot_plugin_multincm/config.py +++ b/nonebot_plugin_multincm/config.py @@ -1,10 +1,16 @@ from typing import Annotated, Optional, Tuple +from cookit.pyd import get_model_with_config from nonebot import get_plugin_config +from nonebot.compat import PYDANTIC_V2 from pydantic import AnyHttpUrl, BaseModel +BaseConfigModel = ( + get_model_with_config({"coerce_numbers_to_str": True}) if PYDANTIC_V2 else BaseModel +) -class ConfigModel(BaseModel): + +class ConfigModel(BaseConfigModel): # login ncm_ctcode: int = 86 ncm_phone: Optional[str] = None