外观
get_pet_profile
获取本人宠物资料。
调用
js
const result = await api.get_pet_profile(self_id)参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
self_id | number | 是 | 在线 Bot QQ 号 |
返回值
js
{
pet_id: 'PET_ID',
pet_name: '小卡',
user_id: '123456789',
birthday_at: 1700000000,
gender: 2,
avatar_url: 'https://example.com/avatar.png',
personality: '小太阳',
personality_url: 'https://example.com/personality.png',
species: '蒜头鹅',
job_name: '小乞丐',
level: { level: 7, current_exp: 20, level_exp: 100, exp_rate: 0.2 },
medals: [
{
medal_id: 'MEDAL_ID',
name: '初见',
progress: '1',
category: '成长',
image_url: 'https://example.com/medal.png',
requirement: '达成条件',
description: '勋章说明',
},
],
traits: ['粘人程度'],
}主档案接口异常时,框架会自动读取 QQ 的宠物缓存档案以保证 pet_id 可用;缓存档案只保证返回 pet_id、pet_name 和 avatar_url,其他字段可能为空或省略。
