mirror of
https://github.com/yawaflua/PL_JusticeBot.git
synced 2025-12-08 19:39:27 +02:00
21 lines
575 B
C#
21 lines
575 B
C#
using DiscordApp.Database.Tables;
|
|
|
|
namespace DiscordApp.Utilities
|
|
{
|
|
public class Utilities
|
|
{
|
|
public static void IdGenerator(out int id)
|
|
{
|
|
Random random = new();
|
|
id = random.Next(10000, 99999);
|
|
while (id.ToString().Length < 5) { id = random.Next(10000, 99999); }
|
|
return;
|
|
}
|
|
public static bool IsPassport(int id, out Passport passport)
|
|
{
|
|
passport = Startup.appDbContext.Passport.FirstOrDefault(x => x.Id == id);
|
|
return passport == null;
|
|
}
|
|
}
|
|
}
|