koishi-plugin-smmcat-gptimage2 0.0.21 → 0.0.22

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 +9 -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
  };
@@ -532,6 +532,13 @@ ${data?.url ? `[查看信息](${data.webUrl})` : ""}`;
532
532
  }
533
533
  return `切换成功,现在使用的是 ${modelConfig.use}`;
534
534
  });
535
+ ctx.command("切换视频接口").action(async ({ session }) => {
536
+ const use = videoModelList.filter((i) => i.name !== videoConfig.use.name);
537
+ if (use) {
538
+ videoConfig.use = use[0];
539
+ }
540
+ return `切换成功,现在使用的是 ${videoConfig.use.name}`;
541
+ });
535
542
  ctx.command("生图 <prompt:text>").action(async ({ session }, prompt) => {
536
543
  if (!config.onlyUse.includes(session.userId)) return `该功能暂不对外支持`;
537
544
  const text = import_koishi.h.select(prompt, "text")[0]?.attrs.content || null;
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.22",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [