koishi-plugin-codex-reset 0.1.0 → 0.1.1
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/README.md +8 -8
- package/lib/index.js +4 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,20 +7,20 @@
|
|
|
7
7
|
- 定时轮询 AIHOT 的 Codex / ChatGPT Work 重置事件快照。
|
|
8
8
|
- 支持推送新的重置预告、已确认的全员重置和重置卡事件。
|
|
9
9
|
- 目标支持平台 + 频道配置,例如 `onebot` + `123456789`。
|
|
10
|
-
- `codex
|
|
11
|
-
- `codex
|
|
12
|
-
- `codex
|
|
13
|
-
- `codex
|
|
10
|
+
- `codex.probability` / `重置概率`:基于历史快照计算经验概率。
|
|
11
|
+
- `codex.event` / `最近重置`:统计上一次已确认重置距今多少小时。
|
|
12
|
+
- `codex.calendar` / `重置日历`:生成本月的 PNG 日历图片,右侧详情固定为命令执行当天。
|
|
13
|
+
- `codex.history` / `重置历史`:生成公开重置事件的历史时间线图片。
|
|
14
14
|
- 日历中的 Tibo 头像作为本地资源随插件发布,不依赖用户访问 X 或运行时下载图片。
|
|
15
15
|
|
|
16
16
|
## 命令
|
|
17
17
|
|
|
18
18
|
命令目前都不接收额外参数:
|
|
19
19
|
|
|
20
|
-
- `codex
|
|
21
|
-
- `codex
|
|
22
|
-
- `codex
|
|
23
|
-
- `codex
|
|
20
|
+
- `codex.probability`,别名 `重置概率`:读取当前 API 快照,统计历史事件日率,并估算未来 24 小时和 7 天出现公开重置事件的概率。
|
|
21
|
+
- `codex.event`,别名 `最近重置`:显示上一次已确认重置发生时间、距今小时数、类型和事件名称。
|
|
22
|
+
- `codex.calendar`,别名 `重置日历`:发送本月日历 PNG;右侧详情固定显示命令执行当天(北京时间)的事件。
|
|
23
|
+
- `codex.history`,别名 `重置历史`:发送按北京时间排列的历史重置时间线 PNG。
|
|
24
24
|
|
|
25
25
|
日历和历史时间线命令需要安装并启用 `koishi-plugin-puppeteer`;概率、日历和历史命令都可以在配置中单独关闭。
|
|
26
26
|
|
package/lib/index.js
CHANGED
|
@@ -303,8 +303,7 @@ function apply(ctx, config) {
|
|
|
303
303
|
ctx.setInterval(() => void monitor.poll(), config.pollInterval * 1000);
|
|
304
304
|
});
|
|
305
305
|
ctx.on('dispose', () => monitor.dispose());
|
|
306
|
-
ctx.command('codex
|
|
307
|
-
.alias('codex-reset.probability')
|
|
306
|
+
ctx.command('codex.probability', '分析 Codex 重置事件的历史概率')
|
|
308
307
|
.alias('重置概率')
|
|
309
308
|
.action(async () => {
|
|
310
309
|
if (!config.enableProbabilityCommand)
|
|
@@ -314,8 +313,7 @@ function apply(ctx, config) {
|
|
|
314
313
|
return '暂时无法获取 Codex 重置事件数据,请稍后再试。';
|
|
315
314
|
return (0, stats_1.formatProbability)((0, stats_1.analyzeProbability)(snapshot));
|
|
316
315
|
});
|
|
317
|
-
ctx.command('codex
|
|
318
|
-
.alias('codex-reset.event')
|
|
316
|
+
ctx.command('codex.event', '查看上一次 Codex 重置距今多久')
|
|
319
317
|
.alias('最近重置')
|
|
320
318
|
.action(async () => {
|
|
321
319
|
const snapshot = await monitor.ensureSnapshot();
|
|
@@ -323,8 +321,7 @@ function apply(ctx, config) {
|
|
|
323
321
|
return '暂时无法获取 Codex 重置事件数据,请稍后再试。';
|
|
324
322
|
return (0, stats_1.formatLatestReset)(snapshot);
|
|
325
323
|
});
|
|
326
|
-
ctx.command('codex
|
|
327
|
-
.alias('codex-reset.calendar')
|
|
324
|
+
ctx.command('codex.calendar', '发送本月的 Codex 重置日历图片')
|
|
328
325
|
.alias('重置日历')
|
|
329
326
|
.action(async () => {
|
|
330
327
|
if (!config.enableCalendarCommand)
|
|
@@ -342,8 +339,7 @@ function apply(ctx, config) {
|
|
|
342
339
|
return '日历图片生成失败,请检查 Puppeteer 服务和中文字体。';
|
|
343
340
|
}
|
|
344
341
|
});
|
|
345
|
-
ctx.command('codex
|
|
346
|
-
.alias('codex-reset.history')
|
|
342
|
+
ctx.command('codex.history', '发送 Codex 重置历史时间线图片')
|
|
347
343
|
.alias('重置历史')
|
|
348
344
|
.action(async () => {
|
|
349
345
|
if (!config.enableHistoryCommand)
|