From 1a0197a4c335021eb936df2b9ebaf5ded8270995 Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Sat, 21 Sep 2024 00:25:14 +0800 Subject: [PATCH] Added a notice for yats genchat logger --- KfChatDotNetBot/ChatBot.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/KfChatDotNetBot/ChatBot.cs b/KfChatDotNetBot/ChatBot.cs index a616660..ec14612 100644 --- a/KfChatDotNetBot/ChatBot.cs +++ b/KfChatDotNetBot/ChatBot.cs @@ -31,6 +31,7 @@ public class ChatBot private Task _kfChatPing; private KfTokenService _kfTokenService; private int _joinFailures = 0; + private DateTimeOffset _yatsLastSeen = DateTimeOffset.UtcNow; public ChatBot() { @@ -357,6 +358,15 @@ public class ChatBot _logger.Info("GambaSesh is now present"); GambaSeshPresent = true; } + + // Only notify if he has been away for a bit to avoid spamming chat if there's TTDs going on + if (user.Id == 160024 && (DateTimeOffset.UtcNow - _yatsLastSeen).TotalHours > 1) + { + SendChatMessage( + $":!: :!: General Chat weirdo {user.Username} has joined. This means your messages are now being logged forever by his unofficial Sneedchat client :!: :!:", + true); + _yatsLastSeen = DateTimeOffset.UtcNow; + } _logger.Info($"{user.Username} joined!"); var userDb = db.Users.FirstOrDefault(u => u.KfId == user.Id); @@ -387,6 +397,7 @@ public class ChatBot _logger.Info("GambaSesh is no longer present"); GambaSeshPresent = false; } + if (userIds.Contains(160024)) _yatsLastSeen = DateTimeOffset.UtcNow; } private void OnKfWsDisconnected(object sender, DisconnectionInfo disconnectionInfo)