koishi-plugin-smmcat-gptimage2 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +3 -2
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -287,7 +287,7 @@ function apply(ctx, config) {
287
287
  };
288
288
  const VideoGpt = {
289
289
  useCache: {},
290
- statusDict: { queued: "排队中", in_progress: "生成中", completed: "已完成", success: "完成", failed: "失败", err: "未知" },
290
+ statusDict: { queued: "排队中", in_progress: "生成中", completed: "已完成", failure: "失败", success: "完成", failed: "失败", err: "未知" },
291
291
  /** 开始请求 */
292
292
  async startUse(session, content, img = null, fn) {
293
293
  const { userId } = session;
@@ -371,6 +371,7 @@ function apply(ctx, config) {
371
371
  task_id,
372
372
  status,
373
373
  model,
374
+ createdTime: response.data?.submit_time * 1e3 || null,
374
375
  progress: response.data?.progress || "0%",
375
376
  url
376
377
  };
@@ -400,7 +401,7 @@ function apply(ctx, config) {
400
401
  await session.send("该 task_id 并不是您创建的,暂时不能查看");
401
402
  return;
402
403
  }
403
- if (["failed", "err"].includes(data.status || "err")) {
404
+ if (data && ["failed", "err", "failure"].includes(data.status || "err")) {
404
405
  await session.send(VideoGpt.formatMsg(data));
405
406
  } else {
406
407
  const newData = await VideoGpt.getNewDetail(session, task_id);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-smmcat-gptimage2",
3
3
  "description": "简单去使用云接口 GPT-Image2",
4
- "version": "0.0.13",
4
+ "version": "0.0.15",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [