Skip to content

Commit 1c9e9f9

Browse files
authored
🐛 fix module name load
1 parent 58b4ae7 commit 1c9e9f9

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

nb_cli/config/model.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,25 @@ class SimpleInfo(BaseModel):
99

1010

1111
class Adapter(SimpleInfo):
12+
__module_name__ = "adapters"
13+
1214
project_link: str
1315
desc: str
1416

15-
class Config:
16-
module_name = "adapters"
17-
1817

1918
class Plugin(SimpleInfo):
19+
__module_name__ = "plugins"
20+
2021
project_link: str
2122
desc: str
2223

23-
class Config:
24-
module_name = "plugins"
25-
2624

2725
class Driver(SimpleInfo):
26+
__module_name__ = "drivers"
27+
2828
project_link: str
2929
desc: str
3030

31-
class Config:
32-
module_name = "drivers"
33-
3431

3532
class NoneBotConfig(BaseModel):
3633

nb_cli/handlers/store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def load_module_data(
4444
raise ValueError(
4545
_("Invalid module type: {module_type}").format(module_type=module_type)
4646
)
47-
module_name: str = getattr(module_class.__config__, "module_name")
47+
module_name: str = module_class.__module_name__
4848

4949
exceptions: list[Exception] = []
5050
urls = [

0 commit comments

Comments
 (0)