From d24aac4f76e49bbeb715a1d89aa737ba240ae472 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Sun, 17 Jul 2016 18:09:11 +0200 Subject: [PATCH] ... what was i thinkng --- NadekoBot/Modules/Permissions/Classes/PermissionChecker.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/NadekoBot/Modules/Permissions/Classes/PermissionChecker.cs b/NadekoBot/Modules/Permissions/Classes/PermissionChecker.cs index 551ad193..a3268570 100644 --- a/NadekoBot/Modules/Permissions/Classes/PermissionChecker.cs +++ b/NadekoBot/Modules/Permissions/Classes/PermissionChecker.cs @@ -4,6 +4,7 @@ using Discord.Commands.Permissions; using NadekoBot.Classes.JSONModels; using System; using System.Collections.Concurrent; +using System.Collections.Generic; using System.Threading.Tasks; namespace NadekoBot.Modules.Permissions.Classes @@ -13,7 +14,7 @@ namespace NadekoBot.Modules.Permissions.Classes { public static PermissionChecker Instance { get; } = new PermissionChecker(); - private ConcurrentDictionary timeBlackList { get; } = new ConcurrentDictionary(); + private HashSet timeBlackList { get; } = new HashSet(); static PermissionChecker() { } private PermissionChecker() @@ -46,10 +47,10 @@ namespace NadekoBot.Modules.Permissions.Classes return false; } - if (timeBlackList.ContainsKey(user)) + if (timeBlackList.Contains(user.Id)) return false; - timeBlackList.TryAdd(user, DateTime.Now); + timeBlackList.Add(user.Id); if (!channel.IsPrivate && !channel.Server.CurrentUser.GetPermissions(channel).SendMessages) {