mirror of
https://gitlab.com/Deukhoofd/DeukBot4.git
synced 2025-09-03 08:07:19 +00:00
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)
|
||||
{
|
||||
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 extend = request.Parameters[0].AsString().ToLowerInvariant();
|
||||
if (extend.Contains("kill") || extend.Contains("suicide"))
|
||||
{
|
||||
return "That sounds like a bad idea to me";
|
||||
@ -24,11 +24,11 @@ namespace DeukBot4.Utilities
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Absolutely, ban the fucker!";
|
||||
return BanOpinions.Choice(random);
|
||||
}
|
||||
}
|
||||
|
||||
return positive ?PositiveOpinions.Choice(random) : NegativeOpinions.Choice(random);
|
||||
return positive ? PositiveOpinions.Choice(random) : NegativeOpinions.Choice(random);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user