koishi-plugin-smmcat-gptimage2 0.0.21 → 0.0.23

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 +14 -2
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -95,7 +95,7 @@ var Chat = {
95
95
  if (session.guildId) {
96
96
  await session.bot.internal.sendMessage(session.channelId, mdContent);
97
97
  } else {
98
- mdContent.markdown.content = mdContent.markdown.content = mdContent.markdown.content.replace(/<qqbot-at-user[^>]*\/>/g, "");
98
+ mdContent.markdown.content = mdContent.markdown.content.replace(/<qqbot-at-user[^>]*\/>/g, "");
99
99
  await session.bot.internal.sendPrivateMessage(session.userId, mdContent);
100
100
  }
101
101
  } catch (error) {
@@ -167,7 +167,7 @@ function apply(ctx, config) {
167
167
  const modelConfig = {
168
168
  use: modelList[0]
169
169
  };
170
- const videoModelList = [{ name: "grok-video-10s", duration: 10 }];
170
+ const videoModelList = [{ name: "grok-video-10s", duration: 10 }, { name: "grok-video-20s", duration: 20 }];
171
171
  const videoConfig = {
172
172
  use: videoModelList[0]
173
173
  };
@@ -479,6 +479,7 @@ ${data?.url ? `[查看信息](${data.webUrl})` : ""}`;
479
479
  return session.userId;
480
480
  });
481
481
  ctx.command("中断请求").action(async ({ session }) => {
482
+ if (!config.onlyUse.includes(session.userId)) return `该功能暂不对外支持`;
482
483
  const { userId } = session;
483
484
  if (!ImgGpt.userCache[userId]) {
484
485
  return `暂无正在执行的请求数据...`;
@@ -490,6 +491,7 @@ ${data?.url ? `[查看信息](${data.webUrl})` : ""}`;
490
491
  return "最后的请求已内部中断";
491
492
  });
492
493
  ctx.command("当前进度").action(async ({ session }) => {
494
+ if (!config.onlyUse.includes(session.userId)) return `该功能暂不对外支持`;
493
495
  const temp = ImgGpt.userCache[session.userId] || null;
494
496
  if (!temp) return `您暂未进行任何生图操作...`;
495
497
  const data = await ctx.http.post(`https://easy-tools.mgtv100.com/external/v1/pear/imageTaskShow`, { task_id: temp.task_id });
@@ -526,12 +528,21 @@ ${data?.url ? `[查看信息](${data.webUrl})` : ""}`;
526
528
  }
527
529
  });
528
530
  ctx.command("切换生图接口").action(async ({ session }) => {
531
+ if (!config.onlyUse.includes(session.userId)) return `该功能暂不对外支持`;
529
532
  const use = modelList.filter((i) => i !== modelConfig.use);
530
533
  if (use) {
531
534
  modelConfig.use = use[0];
532
535
  }
533
536
  return `切换成功,现在使用的是 ${modelConfig.use}`;
534
537
  });
538
+ ctx.command("切换视频接口").action(async ({ session }) => {
539
+ if (!config.onlyUse.includes(session.userId)) return `该功能暂不对外支持`;
540
+ const use = videoModelList.filter((i) => i.name !== videoConfig.use.name);
541
+ if (use) {
542
+ videoConfig.use = use[0];
543
+ }
544
+ return `切换成功,现在使用的是 ${videoConfig.use.name}`;
545
+ });
535
546
  ctx.command("生图 <prompt:text>").action(async ({ session }, prompt) => {
536
547
  if (!config.onlyUse.includes(session.userId)) return `该功能暂不对外支持`;
537
548
  const text = import_koishi.h.select(prompt, "text")[0]?.attrs.content || null;
@@ -585,6 +596,7 @@ tip:您现在使用的是 ${videoConfig.use.name} 进行处理`);
585
596
  });
586
597
  const waitTime = {};
587
598
  ctx.command("查视频进度 <task_id>").action(async ({ session }, task_id) => {
599
+ if (!config.onlyUse.includes(session.userId)) return `该功能暂不对外支持`;
588
600
  if (!task_id) {
589
601
  return `请携带 task_id 参数`;
590
602
  }
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.21",
4
+ "version": "0.0.23",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [