Ask user what he wants an opinion about if nothing is given

This commit is contained in:
Deukhoofd 2018-03-30 16:52:05 +02:00
parent 50b5a9f735
commit 4407214a8e
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 4 additions and 0 deletions

View File

@ -9,6 +9,10 @@ namespace DeukBot4.Utilities
public static async Task<string> GetOpinion(CommandRequest request)
{
var extend = request.Parameters[0].AsString().ToLowerInvariant();
if (string.IsNullOrWhiteSpace(extend))
{
return "Think about what?";
}
var random = new Random(extend.GetHashCode());
var positive = random.Next(-20, 80) < (int) request.RequestPermissions;