diff --git a/modules/Entertainment/Handler/Guess.cs b/modules/Entertainment/Handler/Guess.cs index fbef62f..b4726ca 100644 --- a/modules/Entertainment/Handler/Guess.cs +++ b/modules/Entertainment/Handler/Guess.cs @@ -2,7 +2,6 @@ using System.Collections.Concurrent; using System.Linq; using System.Threading.Tasks; -using BotFramework; using BotFramework.Attributes; using BotFramework.Enums; using Kruzya.TelegramBot.Core; @@ -31,8 +30,6 @@ public class Guess : CommonHandler [Command(InChat.Public, "guess", CommandParseMode.Both)] public async Task HandleGuess() { - var guessDict = _guessCache.GetOr(Chat.Id, new ConcurrentDictionary()); - var cooldownOption = await _db.UserValues.FindOrCreateOption(Chat.Id, From.Id, "guessCooldown"); var cooldown = cooldownOption.GetValue(); if (cooldown > DateTime.Now) @@ -41,6 +38,8 @@ public class Guess : CommonHandler return; } + var guessDict = _guessCache.GetOr(Chat.Id, new ConcurrentDictionary()); + var doesExist = guessDict.Any(pair => pair.Value.UserId == From.Id); if (doesExist) {