17 lines
542 B
Python
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", ""),
|
||
|
|
}
|