Skip to content

Commit

Permalink
🐛 fix module name load
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu authored Feb 28, 2024
1 parent 58b4ae7 commit 1c9e9f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions nb_cli/config/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,25 @@ class SimpleInfo(BaseModel):


class Adapter(SimpleInfo):
__module_name__ = "adapters"

project_link: str
desc: str

class Config:
module_name = "adapters"


class Plugin(SimpleInfo):
__module_name__ = "plugins"

project_link: str
desc: str

class Config:
module_name = "plugins"


class Driver(SimpleInfo):
__module_name__ = "drivers"

project_link: str
desc: str

class Config:
module_name = "drivers"


class NoneBotConfig(BaseModel):

Expand Down
2 changes: 1 addition & 1 deletion nb_cli/handlers/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async def load_module_data(
raise ValueError(
_("Invalid module type: {module_type}").format(module_type=module_type)
)
module_name: str = getattr(module_class.__config__, "module_name")
module_name: str = module_class.__module_name__

exceptions: list[Exception] = []
urls = [
Expand Down

0 comments on commit 1c9e9f9

Please sign in to comment.