add reconnect delay to each bot option (optional)

This commit is contained in:
ChomeNS
2023-04-25 13:40:14 +07:00
parent a9b40c0ceb
commit a5359b705a
4 changed files with 22 additions and 18 deletions

View File

@@ -69,6 +69,7 @@ public class Bot {
this.port = botOption.port;
this.options = botOption;
if (options.reconnectDelay == -1) options.reconnectDelay = config.reconnectDelay;
this.allBots = allBots;
@@ -172,7 +173,7 @@ public class Bot {
public void disconnected(DisconnectedEvent disconnectedEvent) {
loggedIn = false;
int reconnectDelay = config.reconnectDelay();
int reconnectDelay = options.reconnectDelay();
final String stringMessage = ComponentUtilities.stringify(disconnectedEvent.getReason());

View File

@@ -14,7 +14,7 @@ public class Configuration {
@Getter public Map<String, String> consolePrefixes;
@Getter public int reconnectDelay = 7000;
@Getter public int reconnectDelay = 2000;
@Getter public Map<String, String> keys;
@@ -83,5 +83,6 @@ public class Configuration {
@Getter @Setter public boolean useCore = true;
@Getter @Setter public boolean useChat = false;
@Getter public boolean hasEssentials = true;
@Getter public int reconnectDelay = -1;
}
}