Skip to content

Commit

Permalink
feat: Toggleable macro enable/disable discord webhook notification
Browse files Browse the repository at this point in the history
  • Loading branch information
RobotHanzo committed Jul 8, 2024
1 parent b60f5d2 commit e17fb04
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1340,6 +1340,11 @@ public static void triggerManuallyPestsDestroyer() {
description = "Pings everyone on Visitors Macro Logs"
)
public static boolean pingEveryoneOnVisitorsMacroLogs = false;
@Switch(
name = "Send Macro Enable/Disable Logs", category = DISCORD_INTEGRATION, subcategory = "Discord Webhook",
description = "Sends messages when the macro has been enabled or disabled"
)
public static boolean sendMacroEnableDisableLogs = true;
@Text(
name = "WebHook URL", category = DISCORD_INTEGRATION, subcategory = "Discord Webhook",
description = "The URL to use for the webhook",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ public void enableMacro() {
LogUtils.sendDebug("Selected macro: " + LogUtils.capitalize(currentMacro.get().getClass().getSimpleName()));
PlayerUtils.closeScreen();
LogUtils.sendSuccess("Macro enabled!");
LogUtils.webhookLog("Macro enabled!");
if (FarmHelperConfig.sendMacroEnableDisableLogs) {
LogUtils.webhookLog("Macro enabled!");
}

analyticsTimer.reset();
Multithreading.schedule(() -> {
Expand All @@ -206,7 +208,9 @@ public void enableMacro() {
public void disableMacro() {
setMacroToggled(false);
LogUtils.sendSuccess("Macro disabled!");
LogUtils.webhookLog("Macro disabled!");
if (FarmHelperConfig.sendMacroEnableDisableLogs) {
LogUtils.webhookLog("Macro disabled!");
}
currentMacro.ifPresent(m -> {
m.setSavedState(Optional.empty());
m.getRotation().reset();
Expand Down

0 comments on commit e17fb04

Please sign in to comment.