make reconnect delay and chat queue delay in bot options instead of global

This commit is contained in:
ChomeNS
2023-06-05 14:10:55 +07:00
parent ad8fa2ba03
commit 00b2e5d4a9
4 changed files with 6 additions and 12 deletions

View File

@@ -75,7 +75,6 @@ public class Bot {
this.port = botOption.port;
this.options = botOption;
if (options.reconnectDelay == -1) options.reconnectDelay = config.reconnectDelay;
this.bots = bots;

View File

@@ -14,10 +14,6 @@ public class Configuration {
@Getter public Map<String, String> consolePrefixes;
@Getter public int reconnectDelay = 2000;
@Getter public int chatQueueDelay = 125;
@Getter public Map<String, String> keys;
@Getter public String weatherApiKey;
@@ -114,7 +110,8 @@ 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;
@Getter public int reconnectDelay = 2000;
@Getter public boolean removeNamespaces = false;
@Getter public int chatQueueDelay = 125;
}
}

View File

@@ -45,7 +45,7 @@ public class ChatPlugin extends Bot.Listener {
public ChatPlugin (Bot bot) {
this.bot = bot;
queueDelay = bot.config().chatQueueDelay();
queueDelay = bot.options().chatQueueDelay();
this.commandSpyParser = new CommandSpyParser(bot);