dsh-qq-moony 0.9.0 → 0.9.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/CHANGELOG.md +5 -0
- package/client.js +3 -3
- package/index.js +9 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/client.js
CHANGED
|
@@ -206,7 +206,7 @@ window.__ModuleLoader__.load({
|
|
|
206
206
|
'div',
|
|
207
207
|
{ style: 说明 },
|
|
208
208
|
状态.online
|
|
209
|
-
?
|
|
209
|
+
? `今天回了 ${状态.roundsToday ?? 0} 轮(${状态.sentToday ?? 0} 条),这一小时 ${状态.roundsThisHour ?? 0} 轮(上限 ${状态.perDay}/天、${状态.perHour}/时)`
|
|
210
210
|
: '检查 NapCat 有没有启动、3000 端口通不通、token 对不对',
|
|
211
211
|
),
|
|
212
212
|
),
|
|
@@ -302,7 +302,7 @@ window.__ModuleLoader__.load({
|
|
|
302
302
|
'div',
|
|
303
303
|
null,
|
|
304
304
|
h('div', { style: 标题 }, '每小时上限'),
|
|
305
|
-
h('div', { style: 说明 }, '
|
|
305
|
+
h('div', { style: 说明 }, '一小时内最多回几轮(1–200),到顶直接拒发'),
|
|
306
306
|
),
|
|
307
307
|
h('input', {
|
|
308
308
|
type: 'number',
|
|
@@ -320,7 +320,7 @@ window.__ModuleLoader__.load({
|
|
|
320
320
|
'div',
|
|
321
321
|
null,
|
|
322
322
|
h('div', { style: 标题 }, '每天上限'),
|
|
323
|
-
h('div', { style: 说明 }, '
|
|
323
|
+
h('div', { style: 说明 }, '一天内最多回几轮(1–1000),按自然日算'),
|
|
324
324
|
),
|
|
325
325
|
h('input', {
|
|
326
326
|
type: 'number',
|
package/index.js
CHANGED
|
@@ -808,7 +808,9 @@ export function apply(ctx, 配置) {
|
|
|
808
808
|
stickerCount: 读表情库().length,
|
|
809
809
|
perHour: Number(c.perHour ?? 20),
|
|
810
810
|
perDay: Number(c.perDay ?? 60),
|
|
811
|
-
sentToday: 记录.filter((t) => 现在 - t < 86400).length,
|
|
811
|
+
sentToday: 记录.filter((t) => 现在 - t < 86400).length,
|
|
812
|
+
roundsToday: 读账(轮次账).filter((t) => 现在 - t < 86400).length,
|
|
813
|
+
roundsThisHour: 读账(轮次账).filter((t) => 现在 - t < 3600).length,
|
|
812
814
|
sentThisHour: 记录.filter((t) => 现在 - t < 3600).length,
|
|
813
815
|
});
|
|
814
816
|
return;
|
|
@@ -924,17 +926,12 @@ export function apply(ctx, 配置) {
|
|
|
924
926
|
if (一分钟 >= 上限分钟) return `这一分钟已经发了 ${一分钟} 条,喘口气再说`;
|
|
925
927
|
const 一小时 = 记录.filter((t) => 现在 - t < 3600).length;
|
|
926
928
|
const 一天 = 记录.filter((t) => 现在 - t < 86400).length;
|
|
927
|
-
//
|
|
929
|
+
// 小时/天的额度一律按「轮」算;每分钟的硬上限永远按「条」算
|
|
928
930
|
const 轮记录 = 读账(轮次账);
|
|
929
931
|
const 轮小时 = 轮记录.filter((t) => 现在 - t < 3600).length;
|
|
930
932
|
const 轮一天 = 轮记录.filter((t) => 现在 - t < 86400).length;
|
|
931
|
-
if (c.
|
|
932
|
-
|
|
933
|
-
if (轮一天 >= c.perDay) return `今天已经回了 ${轮一天} 轮,到顶了,明天再聊`;
|
|
934
|
-
return '';
|
|
935
|
-
}
|
|
936
|
-
if (一小时 >= c.perHour) return `这一小时已经发了 ${一小时} 条,到顶了,等会儿再说`;
|
|
937
|
-
if (一天 >= c.perDay) return `今天已经发了 ${一天} 条,到顶了,明天再聊`;
|
|
933
|
+
if (轮小时 >= c.perHour) return `这一小时已经回了 ${轮小时} 轮,到顶了,等会儿再说`;
|
|
934
|
+
if (轮一天 >= c.perDay) return `今天已经回了 ${轮一天} 轮,到顶了,明天再聊`;
|
|
938
935
|
return '';
|
|
939
936
|
}
|
|
940
937
|
|
|
@@ -995,7 +992,9 @@ export function apply(ctx, 配置) {
|
|
|
995
992
|
ok: true,
|
|
996
993
|
uin: Number(r.data?.user_id ?? 0),
|
|
997
994
|
nickname: String(r.data?.nickname ?? ''),
|
|
998
|
-
sentToday: 记录.filter((t) => 现在 - t < 86400).length,
|
|
995
|
+
sentToday: 记录.filter((t) => 现在 - t < 86400).length,
|
|
996
|
+
roundsToday: 读账(轮次账).filter((t) => 现在 - t < 86400).length,
|
|
997
|
+
roundsThisHour: 读账(轮次账).filter((t) => 现在 - t < 3600).length,
|
|
999
998
|
sentThisHour: 记录.filter((t) => 现在 - t < 3600).length,
|
|
1000
999
|
};
|
|
1001
1000
|
} catch (e) {
|