Make opinions always the same for the same parameter, made opinions about bans random
This commit is contained in:
parent
865f8a5083
commit
50b5a9f735
|
@ -8,10 +8,10 @@ namespace DeukBot4.Utilities
|
||||||
{
|
{
|
||||||
public static async Task<string> GetOpinion(CommandRequest request)
|
public static async Task<string> GetOpinion(CommandRequest request)
|
||||||
{
|
{
|
||||||
var random = new Random();
|
var extend = request.Parameters[0].AsString().ToLowerInvariant();
|
||||||
|
var random = new Random(extend.GetHashCode());
|
||||||
var positive = random.Next(-20, 80) < (int) request.RequestPermissions;
|
var positive = random.Next(-20, 80) < (int) request.RequestPermissions;
|
||||||
|
|
||||||
var extend = request.Parameters[0].AsString().ToLowerInvariant();
|
|
||||||
if (extend.Contains("kill") || extend.Contains("suicide"))
|
if (extend.Contains("kill") || extend.Contains("suicide"))
|
||||||
{
|
{
|
||||||
return "That sounds like a bad idea to me";
|
return "That sounds like a bad idea to me";
|
||||||
|
@ -24,7 +24,7 @@ namespace DeukBot4.Utilities
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return "Absolutely, ban the fucker!";
|
return BanOpinions.Choice(random);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue