chat queue delay in config

This commit is contained in:
Chayapak 2023-04-26 15:23:43 +07:00
parent f9d9918e85
commit 895f2abf7e
4 changed files with 19 additions and 12 deletions

View file

@ -4,8 +4,11 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="50f184fa-7bed-4956-baf5-7586ff26ea08" name="Changes" comment="fix fallback name?">
<list default="true" id="50f184fa-7bed-4956-baf5-7586ff26ea08" name="Changes" comment="make time output shorter?&#10;mabe">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/Configuration.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/Configuration.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/default-config.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/default-config.yml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -97,13 +100,6 @@
<option name="presentableId" value="Default" />
<updated>1680245437032</updated>
</task>
<task id="LOCAL-00076" summary="i forgor to commit bot">
<created>1681725538670</created>
<option name="number" value="00076" />
<option name="presentableId" value="LOCAL-00076" />
<option name="project" value="LOCAL" />
<updated>1681725538670</updated>
</task>
<task id="LOCAL-00077" summary="add kick !!!!">
<created>1681727904938</created>
<option name="number" value="00077" />
@ -440,7 +436,14 @@
<option name="project" value="LOCAL" />
<updated>1682426984674</updated>
</task>
<option name="localTasksCounter" value="125" />
<task id="LOCAL-00125" summary="make time output shorter?&#10;mabe">
<created>1682488807874</created>
<option name="number" value="00125" />
<option name="presentableId" value="LOCAL-00125" />
<option name="project" value="LOCAL" />
<updated>1682488807875</updated>
</task>
<option name="localTasksCounter" value="126" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -455,7 +458,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="probably improve logquery?" />
<MESSAGE value="forgor to set the thread to null" />
<MESSAGE value="log exception for funni?" />
<MESSAGE value="fart?!?!?!" />
@ -480,7 +482,8 @@
<MESSAGE value="add reconnect delay to each bot option (optional)" />
<MESSAGE value="change stuff a bit" />
<MESSAGE value="fix fallback name?" />
<option name="LAST_COMMIT_MESSAGE" value="fix fallback name?" />
<MESSAGE value="make time output shorter?&#10;mabe" />
<option name="LAST_COMMIT_MESSAGE" value="make time output shorter?&#10;mabe" />
</component>
<component name="XSLT-Support.FileAssociations.UIState">
<expand />

View file

@ -16,6 +16,8 @@ public class Configuration {
@Getter public int reconnectDelay = 2000;
@Getter public int chatQueueDelay = 125;
@Getter public Map<String, String> keys;
@Getter public String weatherApiKey;

View file

@ -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

View file

@ -11,6 +11,8 @@ consolePrefixes:
reconnectDelay: 2000
chatQueueDelay: 125
discord:
prefix: 'default!'
token: 'token here'