Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TESTED]corrected farming check patches & harvest reminder dm #5785

Merged
merged 6 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/tickers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
const { patches } = await getFarmingInfo(id);
for (const patchType of farmingPatchNames) {
const patch = patches[patchType];
if (!patch) continue;

Check warning on line 229 in src/lib/tickers.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Unexpected object value in conditional. The condition is always true

Check warning on line 229 in src/lib/tickers.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Unexpected object value in conditional. The condition is always true
if (patch.plantTime < basePlantTime) continue;

const storeHarvestablePlant = patch.lastPlanted;
Expand Down Expand Up @@ -267,7 +267,7 @@
if (!user) continue;
const message = await user
.send({
content: `The ${planted.name} planted in your ${patchType} patches is ready to be harvested!`,
content: `The ${planted.name} planted in your ${patchType} patches are ready to be harvested!`,
components: [farmingReminderButtons]
})
.catch(noOp);
Expand All @@ -279,7 +279,7 @@
filter: () => true
});
if (!selection.isButton()) return;
message.edit({ components: [] });

Check warning on line 282 in src/lib/tickers.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 282 in src/lib/tickers.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

// Check disable first so minion doesn't have to be free to disable reminders.
if (selection.customId === 'DISABLE') {
Expand All @@ -290,12 +290,12 @@
return;
}
if (minionIsBusy(user.id)) {
selection.reply({ content: 'Your minion is busy.' });

Check warning on line 293 in src/lib/tickers.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 293 in src/lib/tickers.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
return;
}
if (selection.customId === 'HARVEST') {
message.author = user;
runCommand({

Check warning on line 298 in src/lib/tickers.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 298 in src/lib/tickers.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
commandName: 'farming',
args: { harvest: { patch_name: patchType } },
bypassInhibitors: true,
Expand All @@ -308,7 +308,7 @@
});
}
} catch {
message.edit({ components: [] });

Check warning on line 311 in src/lib/tickers.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 311 in src/lib/tickers.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
}
}
}
Expand Down Expand Up @@ -392,6 +392,6 @@
ticker.timer = setTimeout(fn, ticker.interval);
}
};
fn();

Check warning on line 395 in src/lib/tickers.ts

View workflow job for this annotation

GitHub Actions / Node v18.12.0 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 395 in src/lib/tickers.ts

View workflow job for this annotation

GitHub Actions / Node v20 - ubuntu-latest

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
}
}
2 changes: 1 addition & 1 deletion src/lib/util/farmingHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function findPlant(lastPlanted: IPatchData['lastPlanted']) {
export function userGrowingProgressStr(patchesDetailed: IPatchDataDetailed[]): BaseMessageOptions {
let str = '';
for (const patch of patchesDetailed.filter(i => i.ready === true)) {
str += `${Emoji.Tick} **${patch.friendlyName}**: ${patch.lastQuantity} ${patch.lastPlanted} is ready to be harvested!\n`;
str += `${Emoji.Tick} **${patch.friendlyName}**: ${patch.lastQuantity} ${patch.lastPlanted} are ready to be harvested!\n`;
}
for (const patch of patchesDetailed.filter(i => i.ready === false)) {
str += `${Emoji.Stopwatch} **${patch.friendlyName}**: ${patch.lastQuantity} ${
Expand Down
Loading