Skip to content

Commit

Permalink
✏️ change pydantic related usage
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu authored Feb 4, 2024
1 parent 7f8ead9 commit 6577900
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Adapter(BaseAdapter):
@override
def __init__(self, driver: Driver, **kwargs: Any):
super().__init__(driver, **kwargs)
self.adapter_config = Config.parse_obj(self.config)
self.adapter_config = Config.parse_obj(dict(self.config))

@classmethod
@override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pydantic import Field, Extra, BaseModel
from pydantic import Field, BaseModel


class Config(BaseModel, extra=Extra.ignore):
class Config(BaseModel):
...
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ __plugin_meta__ = PluginMetadata(
)

global_config = get_driver().config
config = Config.parse_obj(global_config)
config = Config.parse_obj(dict(global_config))
{% if cookiecutter.sub_plugin %}
sub_plugins = nonebot.load_plugins(
str(Path(__file__).parent.joinpath("plugins").resolve())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pydantic import BaseModel, Extra
from pydantic import BaseModel


class Config(BaseModel, extra=Extra.ignore):
class Config(BaseModel):
"""Plugin Config Here"""

0 comments on commit 6577900

Please sign in to comment.