Skip to content

Commit

Permalink
Merge pull request #251 from RobotHanzo/feat/pests-destroyer-start-st…
Browse files Browse the repository at this point in the history
…op-webhook-config

feat: Ability to toggle whether to send discord webhooks upon pest destroyer start / stop
onixiya1337 authored Aug 4, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 27f05c5 + b0c60ae commit 7054e36
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1337,6 +1337,10 @@ public static void triggerManuallyPestsDestroyer() {
description = "Sends a notification if pests detection number has been exceeded"
)
public static boolean sendNotificationIfPestsDetectionNumberExceeded = true;
@Switch(name = "Send Webhook log when pest destroyer starts/stops", category = PESTS_DESTROYER, subcategory = "Logs",
description = "Sends a webhook log when pest destroyer starts/stops"
)
public static boolean sendWebhookLogWhenPestDestroyerStartsStops = true;
//</editor-fold>
//</editor-fold>

Original file line number Diff line number Diff line change
@@ -155,7 +155,9 @@ public void start() {
enabled = true;
preparing = false;
LogUtils.sendWarning("[Pests Destroyer] Starting killing shitters!");
LogUtils.webhookLog("[Pests Destroyer]\\nStarting killing shitters!");
if (FarmHelperConfig.sendWebhookLogWhenPestDestroyerStartsStops) {
LogUtils.webhookLog("[Pests Destroyer]\\nStarting killing shitters!");
}
}, MacroHandler.getInstance().isMacroToggled() ? (800 + (long) (Math.random() * 500)) : 0, TimeUnit.MILLISECONDS);
IFeature.super.start();
}
@@ -164,7 +166,9 @@ public void start() {
public void stop() {
if (enabled || preparing) {
LogUtils.sendWarning("[Pests Destroyer] Stopping!");
LogUtils.webhookLog("[Pests Destroyer]\\nStopping!");
if (FarmHelperConfig.sendWebhookLogWhenPestDestroyerStartsStops) {
LogUtils.webhookLog("[Pests Destroyer]\\nStopping!");
}
if (GameStateHandler.getInstance().getPestsCount() == 0) {
pestsLocations.clear();
}

0 comments on commit 7054e36

Please sign in to comment.