diff --git a/Geekbot.net/Commands/Roll.cs b/Geekbot.net/Commands/Roll.cs index 1ed8408..9d7b576 100644 --- a/Geekbot.net/Commands/Roll.cs +++ b/Geekbot.net/Commands/Roll.cs @@ -34,6 +34,13 @@ namespace Geekbot.net.Commands var transDict = _translation.GetDict(Context); if (guess <= 100 && guess > 0) { + var prevRoll = _redis.HashGet($"{Context.Guild.Id}:RollsPrevious", Context.Message.Author.Id); + if (!prevRoll.IsNullOrEmpty && prevRoll.ToString() == guess.ToString()) + { + await ReplyAsync(string.Format(transDict["NoPrevGuess"], Context.Message.Author.Mention)); + return; + } + _redis.HashSet($"{Context.Guild.Id}:RollsPrevious", new HashEntry[]{ new HashEntry(Context.Message.Author.Id, guess), }); await ReplyAsync(string.Format(transDict["Rolled"], Context.Message.Author.Mention, number, guess)); if (guess == number) { diff --git a/Geekbot.net/Storage/Translations.json b/Geekbot.net/Storage/Translations.json index 93a7421..2d3414e 100644 --- a/Geekbot.net/Storage/Translations.json +++ b/Geekbot.net/Storage/Translations.json @@ -91,6 +91,10 @@ "RolledNoGuess": { "EN": "{0}, you rolled {1}", "CHDE": "{0}, du hesch {1} grollt" + }, + "NoPrevGuess": { + "EN": ":red_circle: {0}, you can't guess the same number again", + "CHDE": ":red_circle: {0}, du chasch nid nomol es gliche rate" } } } \ No newline at end of file