ForcePilot/backend/package/yuxi/channel/extensions/zulip/status.py
Kris d5e36d33b7 feat(channel): 添加 Zalo OA、Zoom Chat 和 Zulip 渠道扩展
新增 Zalo OA、Zoom Chat、Zulip 三个渠道扩展。

Zalo OA 渠道扩展主要模块:sidecar_client, config, gateway, outbound, streaming, pairing, security, auth, dedupe, directory, monitor, status, session, reactions, tools

Zoom Chat 渠道扩展主要模块:config, gateway, webhook, outbound, streaming, pairing, security, crypto, dedupe, actions, media, mentions, monitor, status, session, reactions, threading

Zulip 渠道扩展主要模块:client, config, gateway, outbound, streaming, pairing, security, monitor, status
2026-05-21 12:06:26 +08:00

33 lines
909 B
Python

from __future__ import annotations
import logging
from yuxi.channel.extensions.zulip.client import ZulipAsyncClient
logger = logging.getLogger(__name__)
class ZulipStatus:
@staticmethod
async def probe_account(account: dict) -> bool:
realm_url = account.get("realm_url", "")
bot_email = account.get("bot_email", "")
bot_api_key = account.get("bot_api_key", "")
if not realm_url or not bot_email or not bot_api_key:
return False
client = ZulipAsyncClient(
realm_url=realm_url,
bot_email=bot_email,
bot_api_key=bot_api_key,
timeout=10.0,
connect_timeout=5.0,
)
try:
result = await client.get_own_user()
return result.get("result") == "success"
except Exception:
return False
finally:
await client.close()