mioku-plugin-meme 1.0.0 → 2.0.0

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.
package/config.md CHANGED
@@ -78,7 +78,7 @@ fields:
78
78
 
79
79
  ```mioku-fields
80
80
  keys:
81
- - base.api.baseU
81
+ - base.api.baseUrl
82
82
  - base.api.timeoutMs
83
83
  - base.trigger.requirePrefix
84
84
  - base.trigger.prefixes
package/index.ts CHANGED
@@ -1,5 +1,4 @@
1
- import type { AIService } from "../../src/services/ai/types";
2
- import type { ConfigService } from "../../src/services/config/tpyes";
1
+ import type { AIService, ConfigService } from "mioku";
3
2
  import { definePlugin, type MiokiContext } from "mioki";
4
3
  import { MEME_BASE_CONFIG } from "./configs/base";
5
4
  import { MEME_FILTER_CONFIG } from "./configs/filters";
@@ -76,6 +75,11 @@ const memePlugin = definePlugin({
76
75
  `[meme] ${instruction}\n执行错误: ${normalizeErrorMessage(error)}`,
77
76
  );
78
77
  }
78
+ const rawText = ctx.text(event)?.trim() ?? "";
79
+ const hasSlashPrefix = baseConfig.trigger.prefixes.some((p: string) => rawText.startsWith(p));
80
+ if (!hasSlashPrefix) {
81
+ return;
82
+ }
79
83
  const chatRuntime = aiService?.getChatRuntime();
80
84
  if (chatRuntime) {
81
85
  try {
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "mioku-plugin-meme",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "基于 meme-generator API 的表情包制作插件",
5
5
  "main": "index.ts",
6
+ "type": "module",
6
7
  "keywords": [
7
8
  "mioku"
8
9
  ],
@@ -57,5 +58,13 @@
57
58
  }
58
59
  ]
59
60
  }
61
+ },
62
+ "peerDependencies": {
63
+ "mioku": "^0.8.0",
64
+ "mioki": "^0.16.0"
65
+ },
66
+ "devDependencies": {
67
+ "mioku": "workspace:*",
68
+ "mioki": "^0.16.0"
60
69
  }
61
70
  }
package/runtime.ts CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  getPluginRuntimeState,
4
4
  resetPluginRuntimeState,
5
5
  setPluginRuntimeState,
6
- } from "../../src";
6
+ } from "mioku";
7
7
 
8
8
  export interface MemeRuntimeState {
9
9
  runtime?: MemePluginRuntime;
package/skills.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AISkill, AITool } from "../../src";
1
+ import type { AISkill, AITool } from "mioku";
2
2
  import type { MemeImageSourceOptions } from "./types";
3
3
  import { getMemeRuntimeState } from "./runtime";
4
4