新增 Synology Chat 渠道扩展,支持在 Yuxi 平台中集成群晖 Synology Chat 即时通讯渠道。 包含以下功能模块: - client: Synology Chat API 客户端封装 - accounts: 账户管理 - webhook: Webhook 事件处理 - security: 安全校验 - dedupe: 消息去重 - status: 会话状态管理 - session: 会话管理 - types: 类型定义
24 lines
794 B
Python
24 lines
794 B
Python
from __future__ import annotations
|
|
|
|
import logging
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
async def probe(account: dict) -> bool:
|
|
token = account.get("token", "")
|
|
incoming_url = account.get("incoming_url", "")
|
|
return bool(token) and bool(incoming_url)
|
|
|
|
|
|
def build_summary(account: dict) -> dict:
|
|
configured = bool(account.get("token")) and bool(account.get("incoming_url"))
|
|
return {
|
|
"configured": configured,
|
|
"has_token": bool(account.get("token")),
|
|
"has_webhook_url": bool(account.get("incoming_url")),
|
|
"bot_name": account.get("bot_name", "ForcePilot"),
|
|
"dm_policy": account.get("dm_policy", "allowlist"),
|
|
"nas_host": account.get("nas_host", ""),
|
|
"allow_insecure_ssl": account.get("allow_insecure_ssl", False),
|
|
} |