dankgrinder 8.114.0 β†’ 8.651.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.
@@ -14,7 +14,7 @@ const RE_NEWLINE = /\n/g;
14
14
  * @param {function} opts.waitForDankMemer
15
15
  * @returns {Promise<{result: string, coins: number}>}
16
16
  */
17
- async function runBeg({ channel, waitForDankMemer }) {
17
+ async function runBeg({ channel, waitForDankMemer, useSlash = false, prefix = 'pls' }) {
18
18
  LOG.cmd(`${c.white}${c.bold}pls beg${c.reset}`);
19
19
 
20
20
  await sendCommand(channel, 'beg', { useSlash, prefix });
@@ -84,7 +84,7 @@ function pickSafeButton(buttons, customSafe) {
84
84
  * @param {string[]} [opts.safeAnswers]
85
85
  * @returns {Promise<{result: string, coins: number}>}
86
86
  */
87
- async function runCrime({ channel, waitForDankMemer, safeAnswers }) {
87
+ async function runCrime({ channel, waitForDankMemer, safeAnswers, useSlash = false, prefix = 'pls' }) {
88
88
  LOG.cmd(`${c.white}${c.bold}pls crime${c.reset}`);
89
89
 
90
90
  await sendCommand(channel, 'crime', { useSlash, prefix });
@@ -14,7 +14,7 @@ sendCommand,
14
14
  * @param {function} opts.waitForDankMemer
15
15
  * @returns {Promise<{result: string, coins: number}>}
16
16
  */
17
- async function runDeposit({ channel, waitForDankMemer }) {
17
+ async function runDeposit({ channel, waitForDankMemer, useSlash = false, prefix = 'pls' }) {
18
18
  LOG.cmd(`${c.white}${c.bold}pls dep max${c.reset}`);
19
19
 
20
20
  await sendCommand(channel, 'dep max', { useSlash, prefix });
@@ -94,7 +94,7 @@ async function resolveDigFlow({ channel, waitForDankMemer, response }) {
94
94
  * @param {object} [opts.client]
95
95
  * @returns {Promise<{result: string, coins: number}>}
96
96
  */
97
- async function runDig({ channel, waitForDankMemer, client }) {
97
+ async function runDig({ channel, waitForDankMemer, client, useSlash = false, prefix = 'pls' }) {
98
98
  LOG.cmd(`${c.white}${c.bold}pls dig${c.reset}`);
99
99
 
100
100
  await sendCommand(channel, 'dig', { useSlash, prefix });
@@ -14,7 +14,7 @@ const RE_DROP_NAME_FALLBACK = /(\w[\w\s']+)/;
14
14
  const RE_COST_LINE = /Cost:\s*[β£πŸ’°o]?\s*([\d,]+)/i;
15
15
  const RE_WHITESPACE_UNDERSCORE = /\s+/g;
16
16
 
17
- async function runDrops({ channel, waitForDankMemer, redis, accountId }) {
17
+ async function runDrops({ channel, waitForDankMemer, redis, accountId, useSlash = false, prefix = 'pls' }) {
18
18
  LOG.cmd(`${c.white}${c.bold}pls drops${c.reset}`);
19
19
 
20
20
  await sendCommand(channel, 'drops', { useSlash, prefix });
@@ -1293,7 +1293,7 @@ async function advancePastConfirmation(response, waitForDankMemer) {
1293
1293
  // ── Single-cycle farm orchestrator ──────────────────────────────────────────
1294
1294
  // Sends `pls farm view` once, then completes the full hoeβ†’waterβ†’plantβ†’harvest
1295
1295
  // cycle by looping on the returned manage menu β€” no additional command sends.
1296
- async function runFarm({ channel, waitForDankMemer, client, redis, accountId, forceRun }) {
1296
+ async function runFarm({ channel, waitForDankMemer, client, redis, accountId, forceRun, useSlash = false, prefix = 'pls' }) {
1297
1297
  LOG.cmd(`${c.white}${c.bold}pls farm view${c.reset}`);
1298
1298
 
1299
1299
  await sendCommand(channel, 'farm view', { useSlash, prefix });
@@ -303,7 +303,7 @@ async function playFishRound({ gameMsg, channel, msgId, waitForDankMemer }) {
303
303
  * @param {function} opts.waitForDankMemer
304
304
  * @returns {Promise<{result: string, coins: number, nextCooldownSec?: number}>}
305
305
  */
306
- async function runFish({ channel, waitForDankMemer }) {
306
+ async function runFish({ channel, waitForDankMemer, useSlash = false, prefix = 'pls' }) {
307
307
  LOG.cmd(`${c.white}${c.bold}pls fish catch${c.reset}`);
308
308
 
309
309
  await sendCommand(channel, 'fish catch', { useSlash, prefix });
@@ -388,7 +388,7 @@ async function runFish({ channel, waitForDankMemer }) {
388
388
  * @param {AbortSignal} [opts.signal] - Signal to stop early
389
389
  * @returns {Promise<{totalRounds, totalCaught, totalMines, results: Array}>}
390
390
  */
391
- async function runFishLoop({ channel, waitForDankMemer, maxRounds = 50, onRound, signal }) {
391
+ async function runFishLoop({ channel, waitForDankMemer, maxRounds = 50, onRound, signal, useSlash = false, prefix = 'pls' }) {
392
392
  LOG.cmd(`${c.white}${c.bold}pls fish catch${c.reset} (loop mode, max ${maxRounds} rounds)`);
393
393
 
394
394
  await sendCommand(channel, 'fish catch', { useSlash, prefix });
@@ -127,7 +127,7 @@ async function playHighLow(response, depth = 0) {
127
127
  return { result: 'done', coins: 0 };
128
128
  }
129
129
 
130
- async function runHighLow({ channel, waitForDankMemer }) {
130
+ async function runHighLow({ channel, waitForDankMemer, useSlash = false, prefix = 'pls' }) {
131
131
  LOG.cmd(`${c.white}${c.bold}pls hl${c.reset}`);
132
132
 
133
133
  await sendCommand(channel, 'hl', { useSlash, prefix });
@@ -78,7 +78,7 @@ function pickDodgeLane(dragonPos, buttons) {
78
78
  return buttons[Math.floor(Math.random() * buttons.length)];
79
79
  }
80
80
 
81
- async function runHunt({ channel, waitForDankMemer, client }) {
81
+ async function runHunt({ channel, waitForDankMemer, client, useSlash = false, prefix = 'pls' }) {
82
82
  LOG.cmd(`${c.white}${c.bold}pls hunt${c.reset}`);
83
83
 
84
84
  await sendCommand(channel, 'hunt', { useSlash, prefix });
@@ -195,7 +195,7 @@ async function enrichItems(items) {
195
195
  /**
196
196
  * Check inventory for all pages and return full item list.
197
197
  */
198
- async function runInventory({ channel, waitForDankMemer, client, accountId, redis, onPageProgress }) {
198
+ async function runInventory({ channel, waitForDankMemer, client, accountId, redis, onPageProgress, useSlash = false, prefix = 'pls' }) {
199
199
  LOG.cmd(`${c.white}${c.bold}pls inv${c.reset}`);
200
200
 
201
201
  await sendCommand(channel, 'inv', { useSlash, prefix });
@@ -35,7 +35,7 @@ async function refetchMsg(channel, msgId) {
35
35
  * @param {function} opts.waitForDankMemer
36
36
  * @returns {Promise<{result: string, coins: number}>}
37
37
  */
38
- async function runPostMemes({ channel, waitForDankMemer }) {
38
+ async function runPostMemes({ channel, waitForDankMemer, useSlash = false, prefix = 'pls' }) {
39
39
  LOG.cmd(`${c.white}${c.bold}pls pm${c.reset}`);
40
40
 
41
41
  await sendCommand(channel, 'pm', { useSlash, prefix });
@@ -201,7 +201,7 @@ async function getPlayerLevel({ channel, waitForDankMemer, accountId = 'default'
201
201
  * @param {object} [opts.redis]
202
202
  * @returns {Promise<object>} Parsed profile data
203
203
  */
204
- async function runProfile({ channel, waitForDankMemer, accountId = 'default', redis }) {
204
+ async function runProfile({ channel, waitForDankMemer, accountId = 'default', redis, useSlash = false, prefix = 'pls' }) {
205
205
  LOG.cmd(`${c.white}${c.bold}pls profile${c.reset}`);
206
206
  await sendCommand(channel, 'profile', { useSlash, prefix });
207
207
  const response = await waitForDankMemer(8000);
@@ -19,7 +19,7 @@ const { meetsLevelRequirement } = require('./profile');
19
19
  * @param {object} [opts.redis]
20
20
  * @returns {Promise<{result: string, coins: number}>}
21
21
  */
22
- async function runScratch({ channel, waitForDankMemer, accountId, redis }) {
22
+ async function runScratch({ channel, waitForDankMemer, accountId, redis, useSlash = false, prefix = 'pls' }) {
23
23
  // Check level 25 requirement before wasting a command
24
24
  const canRun = await meetsLevelRequirement({ channel, waitForDankMemer, accountId, redis }, 25);
25
25
  if (!canRun) {
@@ -82,7 +82,7 @@ function pickSafeButton(buttons, customSafe) {
82
82
  * @param {string[]} [opts.safeAnswers] - Custom safe search locations
83
83
  * @returns {Promise<{result: string, coins: number}>}
84
84
  */
85
- async function runSearch({ channel, waitForDankMemer, safeAnswers }) {
85
+ async function runSearch({ channel, waitForDankMemer, safeAnswers, useSlash = false, prefix = 'pls' }) {
86
86
  LOG.cmd(`${c.white}${c.bold}pls search${c.reset}`);
87
87
 
88
88
  await sendCommand(channel, 'search', { useSlash, prefix });
@@ -194,7 +194,7 @@ async function selectRandomStreamOption(msg) {
194
194
  }
195
195
  }
196
196
 
197
- async function runStream({ channel, waitForDankMemer, client }) {
197
+ async function runStream({ channel, waitForDankMemer, client, useSlash = false, prefix = 'pls' }) {
198
198
  LOG.cmd(`${c.white}${c.bold}pls stream${c.reset}`);
199
199
 
200
200
  await sendCommand(channel, 'stream', { useSlash, prefix });
@@ -77,7 +77,7 @@ async function learnFromResult(question, correctAnswer, redis) {
77
77
  LOG.debug(`[trivia] Learned: "${key.substring(0, 40)}..." β†’ "${correctAnswer}"`);
78
78
  }
79
79
 
80
- async function runTrivia({ channel, waitForDankMemer, redis }) {
80
+ async function runTrivia({ channel, waitForDankMemer, redis, useSlash = false, prefix = 'pls' }) {
81
81
  LOG.cmd(`${c.white}${c.bold}pls trivia${c.reset}`);
82
82
 
83
83
  await sendCommand(channel, 'trivia', { useSlash, prefix });
@@ -404,7 +404,7 @@ async function handleGenericMinigame({ channel, current, waitForDankMemer }) {
404
404
  * @param {function} opts.waitForDankMemer
405
405
  * @returns {Promise<{result: string, coins: number, nextCooldownSec?: number}>}
406
406
  */
407
- async function runWorkShift({ channel, waitForDankMemer }) {
407
+ async function runWorkShift({ channel, waitForDankMemer, useSlash = false, prefix = 'pls' }) {
408
408
  LOG.cmd(`${c.white}${c.bold}pls work shift${c.reset}`);
409
409
 
410
410
  await sendCommand(channel, 'work shift', { useSlash, prefix });
package/lib/grinder.js CHANGED
@@ -352,7 +352,7 @@ async function sendLog(accountName, command, response, status) {
352
352
  const safeResponse = stripAnsi(String(response || '')).replace(/\s+/g, ' ').trim();
353
353
  await fetch(`${API_URL}/api/grinder/log`, {
354
354
  method: 'POST',
355
- headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
355
+ headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
356
356
  body: JSON.stringify({ account_name: accountName, command: safeCommand, response: safeResponse, status }),
357
357
  });
358
358
  } catch { /* silent */ }
@@ -366,7 +366,7 @@ const earningsBatch = new AsyncBatchQueue(async (batch) => {
366
366
  try {
367
367
  await fetch(`${API_URL}/api/grinder/earnings-batch`, {
368
368
  method: 'POST',
369
- headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
369
+ headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
370
370
  body: JSON.stringify({ items: batch }),
371
371
  });
372
372
  } catch {
@@ -375,7 +375,7 @@ const earningsBatch = new AsyncBatchQueue(async (batch) => {
375
375
  try {
376
376
  await fetch(`${API_URL}/api/grinder/earnings`, {
377
377
  method: 'POST',
378
- headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
378
+ headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
379
379
  body: JSON.stringify(item),
380
380
  });
381
381
  } catch {}
@@ -398,7 +398,7 @@ async function reportCommandFeed(accountId, accountName, data) {
398
398
  try {
399
399
  await fetch(`${API_URL}/api/grinder/command-feed`, {
400
400
  method: 'POST',
401
- headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
401
+ headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
402
402
  body: JSON.stringify({ account_id: accountId, account_name: accountName, ...normalized }),
403
403
  });
404
404
  } catch { /* silent β€” dashboard just won't see this update */ }
@@ -964,7 +964,7 @@ class AccountWorker {
964
964
  try {
965
965
  await fetch(`${API_URL}/api/grinder/inventory`, {
966
966
  method: 'POST',
967
- headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
967
+ headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
968
968
  body: JSON.stringify({
969
969
  account_id: this.account.id,
970
970
  items: result.items || [],
@@ -1028,7 +1028,7 @@ class AccountWorker {
1028
1028
  try {
1029
1029
  await fetch(`${API_URL}/api/grinder/profile`, {
1030
1030
  method: 'POST',
1031
- headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
1031
+ headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
1032
1032
  body: JSON.stringify({
1033
1033
  account_id: this.account.id,
1034
1034
  level: result.level,
@@ -1203,7 +1203,7 @@ class AccountWorker {
1203
1203
  try {
1204
1204
  await fetch(`${API_URL}/api/grinder/status`, {
1205
1205
  method: 'POST',
1206
- headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
1206
+ headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
1207
1207
  body: JSON.stringify({
1208
1208
  account_id: this.account.id,
1209
1209
  balance: wallet,
@@ -1530,7 +1530,7 @@ class AccountWorker {
1530
1530
  try {
1531
1531
  await fetch(`${API_URL}/api/grinder/status`, {
1532
1532
  method: 'POST',
1533
- headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
1533
+ headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
1534
1534
  body: JSON.stringify({ account_id: this.account.id, active: false, userId: this.account.userId }),
1535
1535
  });
1536
1536
  } catch {}
@@ -2954,7 +2954,7 @@ class AccountWorker {
2954
2954
  try {
2955
2955
  await fetch(`${API_URL}/api/grinder/actions`, {
2956
2956
  method: 'DELETE',
2957
- headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
2957
+ headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
2958
2958
  body: JSON.stringify({ action_id: action.id }),
2959
2959
  });
2960
2960
  } catch {}
@@ -2965,7 +2965,7 @@ class AccountWorker {
2965
2965
  try {
2966
2966
  await fetch(`${API_URL}/api/grinder/actions`, {
2967
2967
  method: 'DELETE',
2968
- headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
2968
+ headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
2969
2969
  body: JSON.stringify({ action_id: action.id }),
2970
2970
  });
2971
2971
  } catch {}
@@ -2977,7 +2977,7 @@ class AccountWorker {
2977
2977
  try {
2978
2978
  await fetch(`${API_URL}/api/grinder/actions`, {
2979
2979
  method: 'DELETE',
2980
- headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
2980
+ headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
2981
2981
  body: JSON.stringify({ action_id: action.id }),
2982
2982
  });
2983
2983
  } catch {}
@@ -2988,7 +2988,7 @@ class AccountWorker {
2988
2988
  try {
2989
2989
  await fetch(`${API_URL}/api/grinder/actions`, {
2990
2990
  method: 'DELETE',
2991
- headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
2991
+ headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
2992
2992
  body: JSON.stringify({ action_id: action.id }),
2993
2993
  });
2994
2994
  } catch {}
@@ -3042,7 +3042,7 @@ class AccountWorker {
3042
3042
  // Report status non-blocking
3043
3043
  fetch(`${API_URL}/api/grinder/status`, {
3044
3044
  method: 'POST',
3045
- headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
3045
+ headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
3046
3046
  body: JSON.stringify({ account_id: this.account.id, discord_username: this.username, avatar_url: this.avatarUrl, userId: this.account.userId }),
3047
3047
  }).catch(() => {});
3048
3048
 
@@ -3121,7 +3121,7 @@ class AccountWorker {
3121
3121
  // Report invalid status to API
3122
3122
  fetch(`${API_URL}/api/grinder/status`, {
3123
3123
  method: 'POST',
3124
- headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
3124
+ headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
3125
3125
  body: JSON.stringify({ account_id: this.account.id, active: false, status: 'token_invalid', userId: this.account.userId }),
3126
3126
  }).catch(() => {});
3127
3127
  sendWebhook('Token Invalid', `**${this.account.label || this.account.id}** has an invalid Discord token.`, 0xef4444);
@@ -3158,7 +3158,7 @@ class AccountWorker {
3158
3158
  this.stats.bankBalance = bank;
3159
3159
  await fetch(`${API_URL}/api/grinder/status`, {
3160
3160
  method: 'POST',
3161
- headers: { Authorization: `Bearer ${this.apiKey}`, 'Content-Type': 'application/json' },
3161
+ headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
3162
3162
  body: JSON.stringify({ account_id: this.account.id, balance: wallet, bank_balance: bank, total_balance: wallet + bank, userId: this.account.userId }),
3163
3163
  }).catch(() => {});
3164
3164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dankgrinder",
3
- "version": "8.114.0",
3
+ "version": "8.651.0",
4
4
  "description": "Dank Memer automation engine β€” grind coins while you sleep",
5
5
  "bin": {
6
6
  "dankgrinder": "bin/dankgrinder.js"