Skip to content

Commit 563f6d5

Browse files
committed
🐛 fix target scope and adapter string conversion
1 parent 38327a4 commit 563f6d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/nonebot_plugin_alconna/uniseg/target.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,11 @@ def dump(self, only_scope: bool = False, save_self_id: bool = True):
249249
@classmethod
250250
def load(cls, data: dict[str, Any]):
251251
scope = data.pop("scope", None)
252+
if isinstance(scope, str):
253+
scope = SupportScope(scope)
252254
adapter = data.pop("adapter", None)
255+
if isinstance(adapter, str):
256+
adapter = SupportAdapter(adapter)
253257
platform = data.pop("platforms", None)
254258
if platform:
255259
platform = set(platform) # type: ignore

0 commit comments

Comments
 (0)