Skip to content

表情包 ZIP 格式

用于导入导出表情包及其表情图片。

ZIP 结构

text
sticker_pack.zip
├─ sticker_pack.json    # 表情包元数据与条目定义
└─ images/              # 表情图片
   ├─ se_xxx.png
   └─ se_yyy.webp

sticker_pack.json

顶层字段:

字段类型必填说明
versionnumber固定为 1
idstring表情包 UUID(用于导入冲突检测)
namestring表情包名称
entriesarray表情条目数组

条目字段:

字段类型必填说明
idstring表情条目 UUID
triggerTextstring触发文本。建议使用中文方括号格式,如 【微笑】。同一表情包内不可重复。
imagestring图片在 ZIP 中的相对路径,如 images/se_xxx.png

导入行为

  • 导入时按 UUID 检测冲突:若本地已存在同 UUID 的表情包或表情条目,弹出确认对话框让用户选择覆盖或导入为副本。
  • 图片文件会被归一化存储(压缩为 WebP,通过 SHA-256 哈希去重)。
  • 导入为副本时,条目会生成新 UUID,但图片会复用本地哈希检查——如果之前导入过相同图片则复用。

最小示例

json
{
  "version": 1,
  "id": "sp_abc123",
  "name": "日常反应",
  "entries": [
    {
      "id": "se_xyz01",
      "triggerText": "【微笑】",
      "image": "images/smile.png"
    },
    {
      "id": "se_xyz02",
      "triggerText": "【无语】",
      "image": "images/speechless.webp"
    }
  ]
}

完整示例

json
{
  "version": 1,
  "id": "sp_daily01",
  "name": "日常反应包",
  "entries": [
    {
      "id": "se_d01",
      "triggerText": "【微笑】",
      "image": "images/se_d01.webp"
    },
    {
      "id": "se_d02",
      "triggerText": "【大笑】",
      "image": "images/se_d02.webp"
    },
    {
      "id": "se_d03",
      "triggerText": "【哭泣】",
      "image": "images/se_d03.webp"
    },
    {
      "id": "se_d04",
      "triggerText": "【生气】",
      "image": "images/se_d04.webp"
    },
    {
      "id": "se_d05",
      "triggerText": "【害羞】",
      "image": "images/se_d05.webp"
    },
    {
      "id": "se_d06",
      "triggerText": "【疑问】",
      "image": "images/se_d06.webp"
    }
  ]
}

AI 生成约束

  • triggerText 建议格式:用中文方括号包裹简短描述,如 【微笑】 / 【无语】
  • 同一表情包内 triggerText 不可重复(导入时会自动追加数字后缀解决冲突)。
  • 图片文件必须真实存在于 ZIP 的 images/ 目录下。
  • 图片推荐使用 WebP 或 PNG,尺寸建议在 128x128 ~ 512x512 之间。
  • 图片导入后会归一化为 WebP 格式并通过 SHA-256 去重,因此不需要担心重复导入相同图片占用空间。

常见错误

  • image 路径使用 \ 而非 / → 跨平台兼容性问题,必须用 /
  • triggerText 不包含方括号 → 可以正常使用,但不合惯例
  • 图片文件在 ZIP 中不存在 → 该条目导入时会被跳过
  • 同表情包内重复 triggerText → 导入时自动追加后缀如 【微笑2】