From 92ed776e319a62929463d2534b0205c636bc45ed Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Sun, 27 Jul 2025 01:39:37 -0500 Subject: [PATCH] Added a settings toggle for the impersonation feature --- KfChatDotNetBot/ChatBot.cs | 7 ++++--- KfChatDotNetBot/Settings/BuiltIn.cs | 9 +++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/KfChatDotNetBot/ChatBot.cs b/KfChatDotNetBot/ChatBot.cs index 6355d30..e6ed140 100644 --- a/KfChatDotNetBot/ChatBot.cs +++ b/KfChatDotNetBot/ChatBot.cs @@ -213,7 +213,8 @@ public class ChatBot // Reset value to 0 as we've now successfully joined if (_joinFailures > 0) _joinFailures = 0; var settings = SettingsProvider.GetMultipleValuesAsync([BuiltIn.Keys.GambaSeshDetectEnabled, - BuiltIn.Keys.GambaSeshUserId, BuiltIn.Keys.KiwiFarmsUsername, BuiltIn.Keys.BotDisconnectReplayLimit]) + BuiltIn.Keys.GambaSeshUserId, BuiltIn.Keys.KiwiFarmsUsername, BuiltIn.Keys.BotDisconnectReplayLimit, + BuiltIn.Keys.BotRespondToDiscordImpersonation]) .Result; // Send messages if there are any to replay (Assuming we DC'd, and it's now the message flood) foreach (var replayMsg in SentMessages.Where(msg => msg.Status == SentMessageTrackerStatus.ChatDisconnected) @@ -303,11 +304,11 @@ public class ChatBot _seenMessages.Add(new SeenMessageMetadataModel {MessageId = message.MessageId, LastEdited = message.MessageEditDate}); } UpdateUserLastActivityAsync(message.Author.Id, WhoWasActivityType.Message).Wait(_cancellationToken); - if (message.Author.Id is 70029 or 142504 && + if (message.Author.Id is 70029 or 142504 && settings[BuiltIn.Keys.BotRespondToDiscordImpersonation].ToBoolean() && (message.MessageRawHtmlDecoded.Contains("discord16.png") || message.MessageRawHtmlDecoded.Contains("TwitchBossmanJack:", StringComparison.CurrentCultureIgnoreCase))) { - SendChatMessage($"☝️ {message.Author.Username} is a faggot", true); + SendChatMessage($"☝️ {message.Author.Username} is a nigger faggot", true); } } diff --git a/KfChatDotNetBot/Settings/BuiltIn.cs b/KfChatDotNetBot/Settings/BuiltIn.cs index 463573c..d2cd23b 100644 --- a/KfChatDotNetBot/Settings/BuiltIn.cs +++ b/KfChatDotNetBot/Settings/BuiltIn.cs @@ -927,6 +927,14 @@ public static class BuiltIn Default = "true", ValueType = SettingValueType.Boolean, Regex = "(true|false)" + }, + new BuiltInSettingsModel + { + Key = Keys.BotRespondToDiscordImpersonation, + Description = "Whether to respond to Bossman impersonations", + Default = "true", + ValueType = SettingValueType.Boolean, + Regex = "(true|false)" } ]; @@ -1032,5 +1040,6 @@ public static class BuiltIn public static string KiwiPeerTubeEnforceWhitelist = "KiwiPeerTube.EnforceWhitelist"; public static string BotDeadBotDetectionInterval = "Bot.DeadBotDetectionInterval"; public static string BotExitOnDeath = "Bot.ExitOnDeath"; + public static string BotRespondToDiscordImpersonation = "Bot.RespondToDiscordImpersonation"; } } \ No newline at end of file