Some database stuff.
This commit is contained in:
		| @@ -12,12 +12,10 @@ using System.Linq; | ||||
| using System.Threading; | ||||
| using System.Threading.Tasks; | ||||
|  | ||||
| //todo DB | ||||
| namespace NadekoBot.Modules.Administration | ||||
| { | ||||
|     public partial class Administration | ||||
|     { | ||||
|  | ||||
|         [Group] | ||||
|         public class RepeatCommands | ||||
|         { | ||||
|   | ||||
| @@ -10,7 +10,7 @@ using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Text; | ||||
| using System.Threading.Tasks; | ||||
| //todo DB | ||||
|  | ||||
| namespace NadekoBot.Modules.Administration | ||||
| { | ||||
|     public partial class Administration | ||||
|   | ||||
| @@ -12,7 +12,6 @@ using NadekoBot.Services.Database.Models; | ||||
| using System.Linq; | ||||
| using NadekoBot.Services.Database; | ||||
|  | ||||
| //todo DB | ||||
| namespace NadekoBot.Modules.ClashOfClans | ||||
| { | ||||
|     [Module(",", AppendSpace = false)] | ||||
|   | ||||
| @@ -12,7 +12,6 @@ using NadekoBot.Services.Database; | ||||
| using NadekoBot.Services.Database.Models; | ||||
| using System.Collections.Generic; | ||||
|  | ||||
| //todo DB | ||||
| namespace NadekoBot.Modules.Gambling | ||||
| { | ||||
|     [Module("$", AppendSpace = false)] | ||||
| @@ -92,7 +91,6 @@ namespace NadekoBot.Modules.Gambling | ||||
|             await channel.SendMessageAsync($"{umsg.Author.Mention} successfully sent {amount} {Gambling.CurrencyPluralName}s to {receiver.Mention}!").ConfigureAwait(false); | ||||
|         } | ||||
|  | ||||
|         ////todo DB | ||||
|         ////todo owner only | ||||
|         //[LocalizedCommand, LocalizedDescription, LocalizedSummary] | ||||
|         //[RequireContext(ContextType.Guild)] | ||||
| @@ -114,7 +112,6 @@ namespace NadekoBot.Modules.Gambling | ||||
|         //} | ||||
|  | ||||
|         ////todo owner only | ||||
|         ////todo DB | ||||
|         //[LocalizedCommand, LocalizedDescription, LocalizedSummary] | ||||
|         //[RequireContext(ContextType.Guild)] | ||||
|         //public Task Take(IUserMessage umsg, long amount, [Remainder] IGuildUser user) => | ||||
| @@ -184,7 +181,6 @@ namespace NadekoBot.Modules.Gambling | ||||
|             await channel.SendMessageAsync(str).ConfigureAwait(false); | ||||
|         } | ||||
|  | ||||
|         //todo DB | ||||
|         [LocalizedCommand, LocalizedDescription, LocalizedSummary] | ||||
|         [RequireContext(ContextType.Guild)] | ||||
|         public async Task Leaderboard(IUserMessage umsg) | ||||
|   | ||||
| @@ -12,8 +12,7 @@ | ||||
| //using System.Threading; | ||||
| //using System.Threading.Tasks; | ||||
|  | ||||
| ////todo DI into partials | ||||
| ////todo DB | ||||
| ////todo rewrite | ||||
| //namespace NadekoBot.Modules.Games | ||||
| //{ | ||||
| //    /// <summary> | ||||
|   | ||||
| @@ -12,7 +12,6 @@ namespace NadekoBot.Modules.Games | ||||
| { | ||||
|     public partial class GamesModule | ||||
|     { | ||||
|         //todo DB in the future | ||||
|         public static ConcurrentDictionary<IGuild, Poll> ActivePolls = new ConcurrentDictionary<IGuild, Poll>(); | ||||
|  | ||||
|         [LocalizedCommand, LocalizedDescription, LocalizedSummary] | ||||
|   | ||||
| @@ -7,8 +7,7 @@ using System.Text; | ||||
| using System.Threading; | ||||
| using System.Threading.Tasks; | ||||
|  | ||||
| // todo rewrite? | ||||
| // todo DB | ||||
| // todo rewrite | ||||
| namespace NadekoBot.Modules.Games.Trivia | ||||
| { | ||||
|     public class TriviaGame | ||||
|   | ||||
| @@ -9,7 +9,6 @@ namespace NadekoBot.Modules.Games.Trivia | ||||
|     public class TriviaQuestionPool | ||||
|     { | ||||
|         public static TriviaQuestionPool Instance { get; } = new TriviaQuestionPool(); | ||||
|         //todo DB | ||||
|         public HashSet<TriviaQuestion> pool = new HashSet<TriviaQuestion>(); | ||||
|  | ||||
|         private Random rng { get; } = new Random(); | ||||
| @@ -30,7 +29,7 @@ namespace NadekoBot.Modules.Games.Trivia | ||||
|  | ||||
|         internal void Reload() | ||||
|         { | ||||
|             var arr = JArray.Parse(File.ReadAllText("data/questions.json")); | ||||
|             var arr = JArray.Parse(File.ReadAllText("data/triviaquestions.json")); | ||||
|  | ||||
|             foreach (var item in arr) | ||||
|             { | ||||
|   | ||||
| @@ -15,7 +15,6 @@ namespace NadekoBot.Modules.Games | ||||
|     [Module(">", AppendSpace = false)] | ||||
|     public partial class Games : DiscordModule | ||||
|     { | ||||
|         //todo DB | ||||
|         private IEnumerable<string> _8BallResponses { | ||||
|             get { | ||||
|                 using (var uow = DbHandler.UnitOfWork()) | ||||
|   | ||||
| @@ -13,6 +13,7 @@ using NadekoBot.Extensions; | ||||
| using System.Net.Http; | ||||
| using Newtonsoft.Json.Linq; | ||||
| using System.Collections.Generic; | ||||
| using NadekoBot.Services.Database; | ||||
|  | ||||
| namespace NadekoBot.Modules.Music | ||||
| { | ||||
| @@ -643,8 +644,11 @@ namespace NadekoBot.Modules.Music | ||||
|  | ||||
|             var musicPlayer = MusicPlayers.GetOrAdd(textCh.Guild.Id, server => | ||||
|             { | ||||
|                 //todo DB | ||||
|                 float vol = 1;// SpecificConfigurations.Default.Of(server.Id).DefaultMusicVolume; | ||||
|                 using (var uow = DbHandler.UnitOfWork()) | ||||
|                 { | ||||
|                     vol = uow.GuildConfigs.For(textCh.Guild.Id).DefaultMusicVolume; | ||||
|                 } | ||||
|                 var mp = new MusicPlayer(voiceCh, vol); | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -19,7 +19,6 @@ namespace NadekoBot.Modules.Searches | ||||
|         [Group] | ||||
|         public class JokeCommands | ||||
|         { | ||||
|             //todo DB | ||||
|             private List<WoWJoke> wowJokes = new List<WoWJoke>(); | ||||
|             private List<MagicItem> magicItems; | ||||
|             private Logger _log; | ||||
|   | ||||
| @@ -15,7 +15,6 @@ namespace NadekoBot.Modules.Searches | ||||
|         [Group] | ||||
|         public class PokemonSearchCommands | ||||
|         { | ||||
|             //todo DB | ||||
|             private static Dictionary<string, SearchPokemon> pokemons = new Dictionary<string, SearchPokemon>(); | ||||
|             private static Dictionary<string, SearchPokemonAbility> pokemonAbilities = new Dictionary<string, SearchPokemonAbility>(); | ||||
|  | ||||
|   | ||||
| @@ -31,5 +31,6 @@ namespace NadekoBot.Services.Database.Models | ||||
|         //self assignable roles | ||||
|         public bool ExclusiveSelfAssignedRoles { get; set; } | ||||
|         public bool AutoDeleteSelfAssignedRoleMessages { get; set; } | ||||
|         public float DefaultMusicVolume { get; set; } | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user