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
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);
}
}