ForcePilot/backend/package/yuxi/channels/adapters/line/probe.py
Kris a4ec94ef9d feat(line): 实现完整的 LINE 聊天适配器功能
新增 LINE 官方账号对接的全套功能,包括:
1. 基础的 Bot 探测、会话解析、消息格式化能力
2. 富媒体消息模板、快速回复、卡片指令支持
3. Webhook 签名验证、重放防护、多账户路由管理
4. 消息发送、回复、分块传输、用户绑定管理
5. 交互式配置向导与诊断工具
2026-05-12 00:45:33 +08:00

17 lines
542 B
Python

from __future__ import annotations
from yuxi.channels.adapters.line.send import LINESender
async def probe_line_bot(token: str) -> dict:
async with LINESender(token) as sender:
info = await sender.get_bot_info()
if info is None:
return {"status": "error", "message": "Failed to get bot info"}
return {
"status": "ok",
"display_name": info.get("displayName", ""),
"user_id": info.get("userId", ""),
"picture_url": info.get("pictureUrl", ""),
}