diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9b16f2e..d6834c0 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,8 +4,11 @@ - @@ -480,7 +482,8 @@ - diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/Configuration.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/Configuration.java index 6580629..5566f23 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/Configuration.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/Configuration.java @@ -16,6 +16,8 @@ public class Configuration { @Getter public int reconnectDelay = 2000; + @Getter public int chatQueueDelay = 125; + @Getter public Map keys; @Getter public String weatherApiKey; diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java index 435d486..e5b7b5b 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java @@ -49,7 +49,7 @@ public class ChatPlugin extends Bot.Listener { chatParsers.add(new KaboomChatParser(bot)); chatParsers.add(new ChomeNSCustomChatParser(bot)); - bot.executor().scheduleAtFixedRate(this::sendChatTick, 0, 125, TimeUnit.MILLISECONDS); + bot.executor().scheduleAtFixedRate(this::sendChatTick, 0, bot.config().chatQueueDelay(), TimeUnit.MILLISECONDS); } @Override diff --git a/src/main/resources/default-config.yml b/src/main/resources/default-config.yml index 90646c0..e236401 100644 --- a/src/main/resources/default-config.yml +++ b/src/main/resources/default-config.yml @@ -11,6 +11,8 @@ consolePrefixes: reconnectDelay: 2000 +chatQueueDelay: 125 + discord: prefix: 'default!' token: 'token here'