Added a settings toggle for the impersonation feature

This commit is contained in:
barelyprofessional
2025-07-27 01:39:37 -05:00
parent 1b29e85342
commit 92ed776e31
2 changed files with 13 additions and 3 deletions

View File

@@ -213,7 +213,8 @@ public class ChatBot
// Reset value to 0 as we've now successfully joined // Reset value to 0 as we've now successfully joined
if (_joinFailures > 0) _joinFailures = 0; if (_joinFailures > 0) _joinFailures = 0;
var settings = SettingsProvider.GetMultipleValuesAsync([BuiltIn.Keys.GambaSeshDetectEnabled, 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; .Result;
// Send messages if there are any to replay (Assuming we DC'd, and it's now the message flood) // 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) 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}); _seenMessages.Add(new SeenMessageMetadataModel {MessageId = message.MessageId, LastEdited = message.MessageEditDate});
} }
UpdateUserLastActivityAsync(message.Author.Id, WhoWasActivityType.Message).Wait(_cancellationToken); 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("discord16.png") ||
message.MessageRawHtmlDecoded.Contains("TwitchBossmanJack:", StringComparison.CurrentCultureIgnoreCase))) message.MessageRawHtmlDecoded.Contains("TwitchBossmanJack:", StringComparison.CurrentCultureIgnoreCase)))
{ {
SendChatMessage($"☝️ {message.Author.Username} is a faggot", true); SendChatMessage($"☝️ {message.Author.Username} is a nigger faggot", true);
} }
} }

View File

@@ -927,6 +927,14 @@ public static class BuiltIn
Default = "true", Default = "true",
ValueType = SettingValueType.Boolean, ValueType = SettingValueType.Boolean,
Regex = "(true|false)" 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 KiwiPeerTubeEnforceWhitelist = "KiwiPeerTube.EnforceWhitelist";
public static string BotDeadBotDetectionInterval = "Bot.DeadBotDetectionInterval"; public static string BotDeadBotDetectionInterval = "Bot.DeadBotDetectionInterval";
public static string BotExitOnDeath = "Bot.ExitOnDeath"; public static string BotExitOnDeath = "Bot.ExitOnDeath";
public static string BotRespondToDiscordImpersonation = "Bot.RespondToDiscordImpersonation";
} }
} }