30 lines
887 B
Python
30 lines
887 B
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from typing import Any
|
||
|
|
|
||
|
|
|
||
|
|
class WeChatDiscoveryAdapter:
|
||
|
|
@staticmethod
|
||
|
|
def resolve_discovery_name(config: dict[str, Any]) -> str:
|
||
|
|
return config.get("name", "WeChat")
|
||
|
|
|
||
|
|
@staticmethod
|
||
|
|
def resolve_discovery_visible(config: dict[str, Any]) -> bool:
|
||
|
|
return config.get("enabled", True)
|
||
|
|
|
||
|
|
@staticmethod
|
||
|
|
def resolve_discovery_label(config: dict[str, Any], mode: str) -> str:
|
||
|
|
labels = {
|
||
|
|
"wecom": "WeCom (Enterprise WeChat)",
|
||
|
|
"mp": "WeChat Official Account",
|
||
|
|
"personal": "WeChat Personal (Bridge)",
|
||
|
|
}
|
||
|
|
return labels.get(mode, "WeChat")
|
||
|
|
|
||
|
|
@staticmethod
|
||
|
|
def get_discovery_meta() -> dict[str, Any]:
|
||
|
|
return {
|
||
|
|
"icon": "wechat",
|
||
|
|
"description": "WeChat channel adapter - supports WeCom, Official Account, and Bridge modes",
|
||
|
|
}
|