diff --git a/Database.cs b/Database.cs index d4d53dc..517da9e 100644 --- a/Database.cs +++ b/Database.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using System.Collections.Generic; +using System.Security.Cryptography; using DSharpPlus; using MySqlConnector; @@ -10,8 +11,6 @@ public static class Database { private static string connectionString = ""; - private static readonly Random random = new Random(); - public static void SetConnectionString(string host, int port, string database, string username, string password) { connectionString = "server=" + host + @@ -455,7 +454,7 @@ public static class Database public static StaffMember GetRandomActiveStaff(params ulong[] ignoredUserIDs) { List staffMembers = GetActiveStaff(ignoredUserIDs); - return staffMembers.Any() ? staffMembers[random.Next(staffMembers.Count)] : null; + return staffMembers.Any() ? staffMembers[RandomNumberGenerator.GetInt32(staffMembers.Count)] : null; } public static List GetActiveStaff(params ulong[] ignoredUserIDs)