Skip to content

Commit

Permalink
Update EmpathySimulationHandler.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHolmesII authored Oct 11, 2019
1 parent 26fbff0 commit dc82982
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions CompatBot/EventHandlers/EmpathySimulationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dc82982

Please sign in to comment.