Support API
约 223 字小于 1 分钟
2025-09-26
概览
辅助能力(OCR、版本信息、可发送能力检查、AI 声聊等)。
AI 声聊
get_ai_characters
- 功能: 获取可用 AI 角色列表。
- 参数:
group_id: str | int
,chat_type: Literal[1,2]
- 返回:
AICharacterList
(封装characters: list[AICharacter]
) - 示例:
characters = await api.get_ai_characters(123456, 1)
get_ai_record
- 功能: 请求 AI 语音并返回链接(实验性)。
- 参数:
group_id: str | int
,character_id: str
,text: str
- 返回:
str
URL - 示例:
url = await api.get_ai_record(123456, character_id, "你好")
状态检查
can_send_image
- 功能: 是否可发图片。
- 返回:
bool
- 示例:
ok = await api.can_send_image()
can_send_record
- 功能: 是否可发语音。
- 参数:
group_id: str | int
- 返回:
bool
- 示例:
ok = await api.can_send_record(123456)
OCR(Windows)
ocr_image
- 功能: 本地 OCR 图片(Windows)。
- 参数:
image: str
- 返回:
list[dict]
- 示例:
items = await api.ocr_image("C:/a.jpg")
其它
get_version_info
- 功能: 获取 NapCat 版本信息。
- 返回:
dict
- 示例:
ver = await api.get_version_info()
bot_exit
- 功能: 退出机器人进程。
- 返回:
None
- 示例:
await api.bot_exit()
版权所有
版权归属:huan-yp