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

feat: Ability to toggle whether to send discord webhooks upon pest destroyer start / stop #251

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
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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();
}
Expand Down