From 634c8cf0870d8edb1f5c9e8f79ee2d89e5ccdbd1 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:49:47 +0700 Subject: [PATCH] fix: misc irc send tick --- build-number.txt | 2 +- .../me/chayapak1/chomens_bot/plugins/IRCPlugin.java | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/build-number.txt b/build-number.txt index 2b7e6090..274c0052 100644 --- a/build-number.txt +++ b/build-number.txt @@ -1 +1 @@ -1232 \ No newline at end of file +1234 \ No newline at end of file diff --git a/src/main/java/me/chayapak1/chomens_bot/plugins/IRCPlugin.java b/src/main/java/me/chayapak1/chomens_bot/plugins/IRCPlugin.java index 8c9d6609..a9dea5b8 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/IRCPlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/IRCPlugin.java @@ -18,6 +18,7 @@ import org.pircbotx.hooks.events.MessageEvent; import javax.net.ssl.SSLSocketFactory; import java.util.*; +import java.util.concurrent.TimeUnit; public class IRCPlugin extends ListenerAdapter { private final Configuration.IRC ircConfig; @@ -83,7 +84,7 @@ public class IRCPlugin extends ListenerAdapter { bot.irc = this; } - // Main.executor.scheduleAtFixedRate(this::queueTick, 0, 500, TimeUnit.MILLISECONDS); + Main.executor.scheduleAtFixedRate(this::queueTick, 0, 100, TimeUnit.MILLISECONDS); } @Override @@ -201,8 +202,7 @@ public class IRCPlugin extends ListenerAdapter { final String withIRCColors = ColorUtilities.convertAnsiToIrc(firstLog); - // we don't need the queue - bot.sendRaw().rawLineNow("PRIVMSG " + entry.getKey() + " :" + withIRCColors); + bot.sendIRC().message(entry.getKey(), withIRCColors); } } catch (Exception ignored) {} } @@ -232,10 +232,6 @@ public class IRCPlugin extends ListenerAdapter { if (channel == null) return; - final String withIRCColors = ColorUtilities.convertAnsiToIrc(message); - - this.bot.sendIRC().message(channel, withIRCColors); - - // addMessageToQueue(channel, message); + addMessageToQueue(channel, message); } }