Skip to content

Commit

Permalink
Update EmpathySimulationHandler.cs
Browse files Browse the repository at this point in the history
Adds a little spice, since people are starting to catch on.
  • Loading branch information
JohnHolmesII authored Oct 11, 2019
1 parent 02308af commit 26fbff0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CompatBot/EventHandlers/EmpathySimulationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 26fbff0

Please sign in to comment.