mioku-plugin-deerpipe 1.1.1 → 1.1.2
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/index.ts +3 -5
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ScreenshotService } from "mioku";
|
|
2
1
|
import { definePlugin, type MiokiContext } from "mioki";
|
|
2
|
+
import { getService, Services } from "mioku";
|
|
3
3
|
import { initDeerDatabase, type DeerDatabase } from "./db";
|
|
4
4
|
import { handleDeerCommand, parseDeerCommand } from "./commands";
|
|
5
5
|
|
|
@@ -11,9 +11,7 @@ const deerpipePlugin = definePlugin({
|
|
|
11
11
|
async setup(ctx: MiokiContext) {
|
|
12
12
|
ctx.logger.info("deerpipe 插件正在初始化...");
|
|
13
13
|
|
|
14
|
-
const screenshotService = ctx.
|
|
15
|
-
| ScreenshotService
|
|
16
|
-
| undefined;
|
|
14
|
+
const screenshotService = getService(ctx, Services.Screenshot);
|
|
17
15
|
|
|
18
16
|
if (!screenshotService) {
|
|
19
17
|
ctx.logger.warn("screenshot 服务未加载,deerpipe 插件无法生成图片");
|
|
@@ -51,7 +49,7 @@ const deerpipePlugin = definePlugin({
|
|
|
51
49
|
}
|
|
52
50
|
});
|
|
53
51
|
|
|
54
|
-
ctx.handle("message", async (event
|
|
52
|
+
ctx.handle("message", async (event) => {
|
|
55
53
|
const text = ctx.text(event);
|
|
56
54
|
if (!text) return;
|
|
57
55
|
|