dankgrinder 8.92.0 → 8.94.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/lib/grinder.js +7 -4
- package/lib/rawLogger.js +6 -0
- package/package.json +1 -1
package/lib/grinder.js
CHANGED
|
@@ -1544,9 +1544,11 @@ class AccountWorker {
|
|
|
1544
1544
|
return;
|
|
1545
1545
|
}
|
|
1546
1546
|
|
|
1547
|
-
// Level-locked detection —
|
|
1548
|
-
|
|
1549
|
-
|
|
1547
|
+
// Level-locked detection — check rawLogger (CV2/embed text) NOT just content
|
|
1548
|
+
const raw = rawLogger.getLastRaw(this.channel?.id);
|
|
1549
|
+
const rawAllText = (raw?.content || '') + '\n' + (raw?.cv2Text || '') + '\n' + (raw?.embedText || '');
|
|
1550
|
+
if (rawAllText.toLowerCase().includes('not unlocked')) {
|
|
1551
|
+
const lvMatch = rawAllText.match(/level\s*(\d+)/i);
|
|
1550
1552
|
if (lvMatch) {
|
|
1551
1553
|
const targetLv = parseInt(lvMatch[1]);
|
|
1552
1554
|
cmdResult.levelLocked = targetLv;
|
|
@@ -1888,7 +1890,8 @@ class AccountWorker {
|
|
|
1888
1890
|
{ cmd: 'tidy', times: 2 },
|
|
1889
1891
|
],
|
|
1890
1892
|
3: [
|
|
1891
|
-
{ cmd: 'work
|
|
1893
|
+
{ cmd: 'work apply', times: 1 },
|
|
1894
|
+
{ cmd: 'work shift', times: 1 },
|
|
1892
1895
|
{ cmd: 'shop sell common coin 1', times: 2 },
|
|
1893
1896
|
],
|
|
1894
1897
|
5: [
|
package/lib/rawLogger.js
CHANGED
|
@@ -583,6 +583,12 @@ function attachDmLogger(client, opts = {}) {
|
|
|
583
583
|
pipe.exec().catch(() => {});
|
|
584
584
|
}
|
|
585
585
|
|
|
586
|
+
// Store to channelLast so getLastRaw(channelId) works for DM messages.
|
|
587
|
+
// This is critical: attachRawLogger's channel filter may miss on first login
|
|
588
|
+
// (this.channel not yet set), but attachDmLogger always fires for DMs.
|
|
589
|
+
const stored = store(d, 'CREATE');
|
|
590
|
+
if (stored && stored.then) stored.catch(() => {});
|
|
591
|
+
|
|
586
592
|
// Emit to listeners
|
|
587
593
|
if (dmEvent) {
|
|
588
594
|
for (const fn of dmListeners) {
|