Limit dices to 120 sides and 60 total

This commit is contained in:
runebaas 2017-12-24 13:11:16 +01:00
parent 53debf9c9d
commit 98fedb4517
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6

View file

@ -50,6 +50,18 @@ namespace Geekbot.net.Commands
return; return;
} }
if (dices.Any(d => d.times > 20))
{
await ReplyAsync("You can't throw more than 20 dices");
return;
}
if (dices.Any(d => d.sides > 120))
{
await ReplyAsync("A dice can't have more than 120 sides");
return;
}
var rep = new StringBuilder(); var rep = new StringBuilder();
rep.AppendLine($":game_die: {Context.User.Mention}"); rep.AppendLine($":game_die: {Context.User.Mention}");
rep.Append("**Result:** "); rep.Append("**Result:** ");