Massive cleanup

- Removed GuildConfigs repository, moved to extensions
- Moved StreamSettings extension to GuildConfig extensions
- namespace NadekoBot.Core has been simplified to NadekoBot in many places (more to come)
- Replaced some raw delete queries with simple linqtodb queries
This commit is contained in:
Kwoth
2021-06-19 03:32:48 +02:00
parent c7ff982ec1
commit 15dac7e3ed
191 changed files with 563 additions and 571 deletions

View File

@@ -1,9 +1,11 @@
using Discord;
using Discord.Commands;
using NadekoBot.Core.Services;
using NadekoBot.Services;
using System;
using System.Threading.Tasks;
using NadekoBot.Common.Attributes;
using NadekoBot.Core.Services;
using NadekoBot.Modules.Administration;
using NadekoBot.Modules.Games.Services;
using NadekoBot.Modules.Games.Common.ChatterBot;
@@ -32,7 +34,7 @@ namespace NadekoBot.Modules.Games
{
using (var uow = _db.GetDbContext())
{
uow.GuildConfigs.SetCleverbotEnabled(ctx.Guild.Id, false);
uow._context.GuildConfigs.SetCleverbotEnabled(ctx.Guild.Id, false);
await uow.SaveChangesAsync();
}
await ReplyConfirmLocalizedAsync("cleverbot_disabled").ConfigureAwait(false);
@@ -43,7 +45,7 @@ namespace NadekoBot.Modules.Games
using (var uow = _db.GetDbContext())
{
uow.GuildConfigs.SetCleverbotEnabled(ctx.Guild.Id, true);
uow._context.GuildConfigs.SetCleverbotEnabled(ctx.Guild.Id, true);
await uow.SaveChangesAsync();
}

View File

@@ -1,10 +1,12 @@
using System.Threading.Tasks;
using Discord;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Core.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Services;
using System;
using System.Linq;
using System.Threading;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
namespace NadekoBot.Modules.Games.Common
{

View File

@@ -6,8 +6,10 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using CommandLine;
using NadekoBot.Common;
using NadekoBot.Core.Common;
using NadekoBot.Core.Services;
using NadekoBot.Services;
namespace NadekoBot.Modules.Games.Common
{

View File

@@ -10,7 +10,7 @@ using Discord.Net;
using Discord.WebSocket;
using NadekoBot.Extensions;
using NadekoBot.Core.Services;
using NadekoBot.Core.Modules.Games.Common.Trivia;
using NadekoBot.Modules.Games.Common.Trivia;
using NadekoBot.Modules.Games.Services;
using Serilog;

View File

@@ -1,7 +1,7 @@
using CommandLine;
using NadekoBot.Core.Common;
namespace NadekoBot.Core.Modules.Games.Common.Trivia
namespace NadekoBot.Modules.Games.Common.Trivia
{
public class TriviaOptions : INadekoCommandOptions
{

View File

@@ -7,8 +7,7 @@ using NadekoBot.Modules.Administration.Services;
using NadekoBot.Modules.Gambling.Services;
using System.Linq;
using System.Threading.Tasks;
using NadekoBot.Core.Modules.Gambling.Common;
using NadekoBot.Core.Modules.Gambling.Services;
using NadekoBot.Modules.Gambling.Common;
namespace NadekoBot.Modules.Games
{

View File

@@ -6,9 +6,11 @@ using Discord;
using Discord.WebSocket;
using NadekoBot.Common.ModuleBehaviors;
using NadekoBot.Modules.Games.Common;
using NadekoBot.Services;
using NadekoBot.Services.Database.Models;
using NadekoBot.Common.Collections;
using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Database.Models;
using NadekoBot.Common.Collections;
using NadekoBot.Extensions;
using Serilog;

View File

@@ -8,7 +8,6 @@ using NadekoBot.Common.Attributes;
using NadekoBot.Modules.Games.Common.Trivia;
using NadekoBot.Modules.Games.Services;
using NadekoBot.Core.Common;
using NadekoBot.Core.Modules.Games.Common.Trivia;
namespace NadekoBot.Modules.Games
{