From 26fbff082dee3c816ec36418874b75b21b5ef62c Mon Sep 17 00:00:00 2001 From: JohnHolmesII Date: Fri, 11 Oct 2019 20:44:52 +0000 Subject: [PATCH 1/2] Update EmpathySimulationHandler.cs Adds a little spice, since people are starting to catch on. --- CompatBot/EventHandlers/EmpathySimulationHandler.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CompatBot/EventHandlers/EmpathySimulationHandler.cs b/CompatBot/EventHandlers/EmpathySimulationHandler.cs index fa536bd5..cecb9433 100644 --- a/CompatBot/EventHandlers/EmpathySimulationHandler.cs +++ b/CompatBot/EventHandlers/EmpathySimulationHandler.cs @@ -42,7 +42,8 @@ public static async Task OnMessageCreated(MessageCreateEventArgs args) return; var similarList = queue.Where(msg => content.Equals(msg.Content, StringComparison.InvariantCultureIgnoreCase)).ToList(); - if (similarList.Count > 2 && similarList.Select(msg => msg.Author.Id).Distinct().Count() > 2) + var rng = new Random(); + if (similarList.Count > rng.Next(2, 5) && similarList.Select(msg => msg.Author.Id).Distinct().Count() > 2) { Throttling.Set(args.Channel.Id, similarList, ThrottleDuration); var botMsg = await args.Channel.SendMessageAsync(content.ToLowerInvariant()).ConfigureAwait(false); From dc82982b3c3a990c705ada226b14e4b8b1e4ccc2 Mon Sep 17 00:00:00 2001 From: JohnHolmesII Date: Fri, 11 Oct 2019 21:13:02 +0000 Subject: [PATCH 2/2] Update EmpathySimulationHandler.cs --- CompatBot/EventHandlers/EmpathySimulationHandler.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CompatBot/EventHandlers/EmpathySimulationHandler.cs b/CompatBot/EventHandlers/EmpathySimulationHandler.cs index cecb9433..17451b12 100644 --- a/CompatBot/EventHandlers/EmpathySimulationHandler.cs +++ b/CompatBot/EventHandlers/EmpathySimulationHandler.cs @@ -42,8 +42,7 @@ public static async Task OnMessageCreated(MessageCreateEventArgs args) return; var similarList = queue.Where(msg => content.Equals(msg.Content, StringComparison.InvariantCultureIgnoreCase)).ToList(); - var rng = new Random(); - if (similarList.Count > rng.Next(2, 5) && similarList.Select(msg => msg.Author.Id).Distinct().Count() > 2) + if (similarList.Count > 2 && similarList.Select(msg => msg.Author.Id).Distinct().Count() > new Random().Next(2, 5)) { Throttling.Set(args.Channel.Id, similarList, ThrottleDuration); var botMsg = await args.Channel.SendMessageAsync(content.ToLowerInvariant()).ConfigureAwait(false);