koishi-plugin-ggcevo 1.0.3 → 1.0.4
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/lib/index.d.ts +1 -0
- package/lib/index.js +4 -3
- package/package.json +1 -1
- package/readme.md +6 -0
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -34,7 +34,8 @@ var name = "ggcevo";
|
|
|
34
34
|
var Config = import_koishi.Schema.object({
|
|
35
35
|
mapMonitorEnabled: import_koishi.Schema.boolean().description("是否启用地图检测定时任务").default(false),
|
|
36
36
|
mapMonitorGroups: import_koishi.Schema.array(import_koishi.Schema.string()).description("地图检测广播的群组ID列表").default([]),
|
|
37
|
-
mapMonitorMapIds: import_koishi.Schema.array(import_koishi.Schema.number()).description("需要检测的地图ID列表").default([])
|
|
37
|
+
mapMonitorMapIds: import_koishi.Schema.array(import_koishi.Schema.number()).description("需要检测的地图ID列表").default([]),
|
|
38
|
+
mapMonitorApiUrl: import_koishi.Schema.string().description("地图检测API地址").default("https://server.dreamprotocol.info:13085/mapmonitor/maps")
|
|
38
39
|
});
|
|
39
40
|
var inject = {
|
|
40
41
|
required: ["database"]
|
|
@@ -185,7 +186,7 @@ function apply(ctx, config) {
|
|
|
185
186
|
if (config.mapMonitorEnabled && config.mapMonitorGroups.length > 0 && config.mapMonitorMapIds.length > 0) {
|
|
186
187
|
ctx.setInterval(async () => {
|
|
187
188
|
try {
|
|
188
|
-
const response = await ctx.http.get(
|
|
189
|
+
const response = await ctx.http.get(config.mapMonitorApiUrl);
|
|
189
190
|
const maps = response.maps || [];
|
|
190
191
|
for (const mapId of config.mapMonitorMapIds) {
|
|
191
192
|
const mapData = maps.find((m) => m.mapId === mapId);
|
|
@@ -440,7 +441,7 @@ ${message}
|
|
|
440
441
|
return `<quote id="${argv.session.messageId}"/>⚠️ 地图检测功能未开启或未配置地图ID。`;
|
|
441
442
|
}
|
|
442
443
|
try {
|
|
443
|
-
const response = await ctx.http.get(
|
|
444
|
+
const response = await ctx.http.get(config.mapMonitorApiUrl);
|
|
444
445
|
const maps = response.maps || [];
|
|
445
446
|
const targetMaps = maps.filter((m) => config.mapMonitorMapIds.includes(m.mapId));
|
|
446
447
|
if (targetMaps.length === 0) {
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -24,6 +24,7 @@ npm install koishi-plugin-ggcevo
|
|
|
24
24
|
| `mapMonitorEnabled` | `boolean` | `false` | 是否启用地图检测定时任务 |
|
|
25
25
|
| `mapMonitorGroups` | `string[]` | `[]` | 地图检测广播的群组 ID 列表 |
|
|
26
26
|
| `mapMonitorMapIds` | `number[]` | `[]` | 需要检测的地图 ID 列表 |
|
|
27
|
+
| `mapMonitorApiUrl` | `string` | `https://server.dreamprotocol.info:13085/mapmonitor/maps` | 地图检测 API 地址 |
|
|
27
28
|
|
|
28
29
|
## 指令列表
|
|
29
30
|
|
|
@@ -95,6 +96,11 @@ npm install koishi-plugin-ggcevo
|
|
|
95
96
|
|
|
96
97
|
## 更新日志
|
|
97
98
|
|
|
99
|
+
### v1.0.4
|
|
100
|
+
|
|
101
|
+
- 新增配置项 `mapMonitorApiUrl`,可将地图检测的 API 地址通过配置项填写,默认值为 `https://server.dreamprotocol.info:13085/mapmonitor/maps`。
|
|
102
|
+
- 移除定时任务与「地图检测」指令中硬编码的 API 地址,改为读取 `mapMonitorApiUrl` 配置。
|
|
103
|
+
|
|
98
104
|
### v1.0.3
|
|
99
105
|
|
|
100
106
|
- 复原「地图检测」指令(命名空间 `sc2arcade/地图检测`),查询已配置地图的检测状态(在线状态、最后状态变更时间、24h/30d 离线次数、近期事件)。原被删除的是「地图检测调试」指令,本次仅复原正常地图检测指令。
|