diff --git a/ChaosBot/Database/Repository/RaffleRepository.cs b/ChaosBot/Database/Repository/RaffleRepository.cs index d53e825..3c3710f 100644 --- a/ChaosBot/Database/Repository/RaffleRepository.cs +++ b/ChaosBot/Database/Repository/RaffleRepository.cs @@ -11,7 +11,7 @@ namespace ChaosBot.Database.Repository { private static readonly string Table = "RaffleTable"; - public static Raffle[] all() + public static Raffle[] All() { DataTable dataTable = Controller.SelectQuery(Table); @@ -27,14 +27,14 @@ namespace ChaosBot.Database.Repository return raffles.ToArray(); } - public static int count() + public static int Count() { DataTable dataTable = Controller.SelectQuery(Table, "COUNT(*)"); return Convert.ToInt32(dataTable.Rows[0]["COUNT(*)"]); } - public static int count(string userId) + public static int Count(string userId) { Dictionary filterDict = new Dictionary(); filterDict.Add("userId", userId); @@ -63,7 +63,7 @@ namespace ChaosBot.Database.Repository return raffles.ToArray(); } - public static void insert(Raffle raffle) + public static void Insert(Raffle raffle) { Dictionary dict = new Dictionary(); @@ -72,7 +72,7 @@ namespace ChaosBot.Database.Repository Controller.InsertQuery(Table, dict); } - public static void massInsert(List raffles) + public static void MassInsert(List raffles) { foreach (var raf in raffles) { @@ -94,7 +94,7 @@ namespace ChaosBot.Database.Repository return new Raffle(idFetch, userIdFetch); } - public static int clearRaffle() + public static int ClearRaffle() { List cmds = new List(); @@ -103,7 +103,7 @@ namespace ChaosBot.Database.Repository return Controller.TransactionQuery(cmds); } - // public static void delete() + // public static void Delete() // { // // } diff --git a/ChaosBot/Discord/Modules/RaffleSystem.cs b/ChaosBot/Discord/Modules/RaffleSystem.cs index c0655bc..e638e26 100644 --- a/ChaosBot/Discord/Modules/RaffleSystem.cs +++ b/ChaosBot/Discord/Modules/RaffleSystem.cs @@ -17,8 +17,6 @@ namespace ChaosBot.Discord.Modules { private static Logger _logger = Program._logger; - private static Dictionary _currentPot = new Dictionary(); - [Command("raffle")] [Alias("raffle info")] [RequireUserPermission(GuildPermission.ManageGuild)] @@ -145,18 +143,18 @@ namespace ChaosBot.Discord.Modules for (int i = 0; i < amount; i++) raffles.Add(new Raffle(userId.ToString())); - RaffleRepository.massInsert(raffles); + RaffleRepository.MassInsert(raffles); } else { - RaffleRepository.insert(new Raffle(userId.ToString())); + RaffleRepository.Insert(new Raffle(userId.ToString())); } sb.AppendLine($"{Context.User.Mention} has added {amount} rafflepoints to <@{userId}>."); sb.AppendLine(); - sb.AppendLine($"<@{userId}> now has {RaffleRepository.count(userId.ToString())} rafflepoints!"); + sb.AppendLine($"<@{userId}> now has {RaffleRepository.Count(userId.ToString())} rafflepoints!"); } private void PickRaffle(StringBuilder sb) @@ -167,7 +165,7 @@ namespace ChaosBot.Discord.Modules private void ClearRaffle(StringBuilder sb, bool noOutput = false) { - int Removed = RaffleRepository.clearRaffle(); + int Removed = RaffleRepository.ClearRaffle(); sb.AppendLine($"{Context.User.Mention} has cleared all {Removed} rafflepoints"); } @@ -176,8 +174,8 @@ namespace ChaosBot.Discord.Modules { ulong userId = Convert.ToUInt64(user.Substring(3, user.Length-4)); - sb.AppendLine($"<@{userId}>, you have {RaffleRepository.count(userId.ToString())} rafflepoints."); - sb.AppendLine($"There is a total of {RaffleRepository.count()} rafflepoints."); + sb.AppendLine($"<@{userId}>, you have {RaffleRepository.Count(userId.ToString())} rafflepoints."); + sb.AppendLine($"There is a total of {RaffleRepository.Count()} rafflepoints."); } } } \ No newline at end of file