forked from Minecraft/QoL
Changing Ping
Instead of pinging for first alert, ping when limit is reached to better identify if it's a real issuemaster
parent
ad0a2d0e13
commit
364a2a2bb1
|
@ -32,18 +32,19 @@ public class GriefAlert implements Runnable {
|
||||||
int lines = plugin.getConfig().getInt("grief-alert.lines", 5);
|
int lines = plugin.getConfig().getInt("grief-alert.lines", 5);
|
||||||
if (num < lines) {
|
if (num < lines) {
|
||||||
alert(alert);
|
alert(alert);
|
||||||
if (num == 1) {
|
} else if (num == lines) {
|
||||||
|
String extra = " Suppressing more alerts for a while";
|
||||||
String webhook = plugin.getConfig().getString("grief-alert.webhook", "");
|
String webhook = plugin.getConfig().getString("grief-alert.webhook", "");
|
||||||
String message = "@here " + alert;
|
String message = "@here " + alert;
|
||||||
if (StringUtils.isNotEmpty(webhook)) {
|
if (StringUtils.isNotEmpty(webhook)) {
|
||||||
|
extra += " and pinging Discord";
|
||||||
Map<String, String> data = new HashMap<>();
|
Map<String, String> data = new HashMap<>();
|
||||||
data.put("username", "Grief Alert");
|
data.put("username", "Grief Alert");
|
||||||
data.put("content", message);
|
data.put("content", message);
|
||||||
CoreWeb.asyncPost(plugin, webhook, data);
|
CoreWeb.asyncPost(plugin, webhook, data);
|
||||||
}
|
}
|
||||||
}
|
extra += "...";
|
||||||
} else if (num == lines) {
|
alert(alert + extra);
|
||||||
alert(alert + " Suppressing more alerts for a while...");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue