From d20adeb6efe63b8ee7c45668cd8c0dee61f23369 Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Sun, 15 Sep 2024 23:44:58 +0800 Subject: [PATCH] Changed initial start cooldown so it'll update the flag after the message flood finishes rather than on ping --- KfChatDotNetBot/ChatBot.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/KfChatDotNetBot/ChatBot.cs b/KfChatDotNetBot/ChatBot.cs index cd2f0bf..7eae422 100644 --- a/KfChatDotNetBot/ChatBot.cs +++ b/KfChatDotNetBot/ChatBot.cs @@ -116,7 +116,6 @@ public class ChatBot { _logger.Info("Not pinging the connection as we're currently disconnected"); } - if (InitialStartCooldown) InitialStartCooldown = false; var inactivityTime = DateTime.UtcNow - KfClient.LastPacketReceived; _logger.Debug($"Last KF event was {inactivityTime:g} ago"); var inactivityTimeout = (await Helpers.GetValue(BuiltIn.Keys.KiwiFarmsInactivityTimeout)).ToType(); @@ -211,10 +210,12 @@ public class ChatBot } else { - _logger.Debug($"_seenMsgIds check => {!_seenMsgIds.Contains(message.MessageId)}, _initialStartCooldown => {InitialStartCooldown}"); + _logger.Debug($"_seenMsgIds check => {!_seenMsgIds.Contains(message.MessageId)}, InitialStartCooldown => {InitialStartCooldown}"); } _seenMsgIds.Add(message.MessageId); } + + if (InitialStartCooldown) InitialStartCooldown = false; } public SentMessageTrackerModel SendChatMessage(string message, bool bypassSeshDetect = false)