feat: option to log connection status messages or not
This commit is contained in:
@@ -176,6 +176,7 @@ public class Configuration {
|
||||
public boolean useChat = false;
|
||||
public boolean useSNBTComponents = true;
|
||||
public boolean coreCommandSpy = true;
|
||||
public boolean logConnectionStatusMessages = true;
|
||||
public boolean resolveSRV = true;
|
||||
public int reconnectDelay = 2000;
|
||||
public int chatQueueDelay = 125;
|
||||
|
||||
@@ -112,7 +112,7 @@ public class DiscordPlugin {
|
||||
|
||||
@Override
|
||||
public void onConnecting () {
|
||||
if (bot.connectAttempts > 6) return;
|
||||
if (!bot.options.logConnectionStatusMessages || bot.connectAttempts > 6) return;
|
||||
else if (bot.connectAttempts == 6) {
|
||||
sendMessageInstantly(I18nUtilities.get("info.suppressing"), channelId);
|
||||
|
||||
@@ -141,7 +141,7 @@ public class DiscordPlugin {
|
||||
|
||||
@Override
|
||||
public void disconnected (final DisconnectedEvent event) {
|
||||
if (bot.connectAttempts >= 6) return;
|
||||
if (!bot.options.logConnectionStatusMessages || bot.connectAttempts >= 6) return;
|
||||
|
||||
final String reason = ComponentUtilities.stringifyDiscordAnsi(event.getReason());
|
||||
sendMessageInstantly(
|
||||
|
||||
@@ -43,7 +43,7 @@ public class LoggerPlugin implements Listener {
|
||||
|
||||
@Override
|
||||
public void onConnecting () {
|
||||
if (bot.connectAttempts > 10) return;
|
||||
if (!bot.options.logConnectionStatusMessages || bot.connectAttempts > 10) return;
|
||||
else if (bot.connectAttempts == 10) {
|
||||
log(I18nUtilities.get("info.suppressing"));
|
||||
|
||||
@@ -70,7 +70,7 @@ public class LoggerPlugin implements Listener {
|
||||
|
||||
@Override
|
||||
public void disconnected (final DisconnectedEvent event) {
|
||||
if (bot.connectAttempts >= 10) return;
|
||||
if (!bot.options.logConnectionStatusMessages || bot.connectAttempts >= 10) return;
|
||||
|
||||
final Component message = Component.translatable(
|
||||
I18nUtilities.get("info.disconnected"),
|
||||
|
||||
Reference in New Issue
Block a user