Users can no longer submit multiple sentences in acrophobia

This commit is contained in:
Kwoth 2017-01-26 08:08:40 +01:00
parent 5d5a67b477
commit f40dbc7bec

View File

@ -69,6 +69,7 @@ namespace NadekoBot.Modules.Games
private readonly ConcurrentDictionary<string, IGuildUser> submissions = new ConcurrentDictionary<string, IGuildUser>();
public IReadOnlyDictionary<string, IGuildUser> Submissions => submissions;
private readonly ConcurrentHashSet<ulong> usersWhoSubmitted = new ConcurrentHashSet<ulong>();
private readonly ConcurrentHashSet<ulong> usersWhoVoted = new ConcurrentHashSet<ulong>();
private int spamCount = 0;
@ -191,8 +192,7 @@ namespace NadekoBot.Modules.Games
catch { }
}
//user didn't input something already
IGuildUser throwaway;
if (submissions.TryGetValue(input, out throwaway))
if (!usersWhoSubmitted.Add(guildUser.Id))
return;
var inputWords = input.Split(' '); //get all words