From 364a2a2bb190a5a56543b77056b12ba104b93841 Mon Sep 17 00:00:00 2001 From: Etzelia Date: Tue, 4 Dec 2018 14:17:17 -0600 Subject: [PATCH] Changing Ping Instead of pinging for first alert, ping when limit is reached to better identify if it's a real issue --- .../xyz/etztech/qol/other/GriefAlert.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main/java/xyz/etztech/qol/other/GriefAlert.java b/src/main/java/xyz/etztech/qol/other/GriefAlert.java index da692de..7f1a4c7 100644 --- a/src/main/java/xyz/etztech/qol/other/GriefAlert.java +++ b/src/main/java/xyz/etztech/qol/other/GriefAlert.java @@ -32,18 +32,19 @@ public class GriefAlert implements Runnable { int lines = plugin.getConfig().getInt("grief-alert.lines", 5); if (num < lines) { alert(alert); - if (num == 1) { - String webhook = plugin.getConfig().getString("grief-alert.webhook", ""); - String message = "@here " + alert; - if (StringUtils.isNotEmpty(webhook)) { - Map data = new HashMap<>(); - data.put("username", "Grief Alert"); - data.put("content", message); - CoreWeb.asyncPost(plugin, webhook, data); - } - } } else if (num == lines) { - alert(alert + " Suppressing more alerts for a while..."); + String extra = " Suppressing more alerts for a while"; + String webhook = plugin.getConfig().getString("grief-alert.webhook", ""); + String message = "@here " + alert; + if (StringUtils.isNotEmpty(webhook)) { + extra += " and pinging Discord"; + Map data = new HashMap<>(); + data.put("username", "Grief Alert"); + data.put("content", message); + CoreWeb.asyncPost(plugin, webhook, data); + } + extra += "..."; + alert(alert + extra); } }