diff --git a/src/Nadeko.Bot.Common/DbService.cs b/src/Nadeko.Bot.Common/DbService.cs index c139c8f0c..429fd66d4 100644 --- a/src/Nadeko.Bot.Common/DbService.cs +++ b/src/Nadeko.Bot.Common/DbService.cs @@ -2,7 +2,7 @@ using LinqToDB.Common; using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; -using NadekoBot.Services.Database; + namespace NadekoBot.Services; diff --git a/src/Nadeko.Bot.Common/Extensions/DbExtensions.cs b/src/Nadeko.Bot.Common/Extensions/DbExtensions.cs index fd2677298..06dc7bb85 100644 --- a/src/Nadeko.Bot.Common/Extensions/DbExtensions.cs +++ b/src/Nadeko.Bot.Common/Extensions/DbExtensions.cs @@ -1,8 +1,6 @@ using Microsoft.EntityFrameworkCore; using NadekoBot.Db; using NadekoBot.Db.Models; -// todo fix these namespaces. It should only be Nadeko.Bot.Db -using NadekoBot.Services.Database; namespace NadekoBot.Extensions; diff --git a/src/Nadeko.Bot.Common/GlobalUsings.cs b/src/Nadeko.Bot.Common/GlobalUsings.cs index 217849cb9..2d40b588f 100644 --- a/src/Nadeko.Bot.Common/GlobalUsings.cs +++ b/src/Nadeko.Bot.Common/GlobalUsings.cs @@ -12,7 +12,7 @@ global using Nadeko.Common; // new project global using NadekoBot.Common; // old + nadekobot specific things global using NadekoBot.Common.Attributes; global using NadekoBot.Extensions; -// global using Nadeko.Snake; +// global using Nadeko.Medusa; // discord global using Discord; diff --git a/src/Nadeko.Bot.Common/IBot.cs b/src/Nadeko.Bot.Common/IBot.cs index 2ad0078a7..5709d969e 100644 --- a/src/Nadeko.Bot.Common/IBot.cs +++ b/src/Nadeko.Bot.Common/IBot.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot; diff --git a/src/Nadeko.Bot.Common/ILogCommandService.cs b/src/Nadeko.Bot.Common/ILogCommandService.cs index 20b2b4139..64ce0314e 100644 --- a/src/Nadeko.Bot.Common/ILogCommandService.cs +++ b/src/Nadeko.Bot.Common/ILogCommandService.cs @@ -1,4 +1,4 @@ -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Common; diff --git a/src/Nadeko.Bot.Common/Medusa/IMedusaLoaderService.cs b/src/Nadeko.Bot.Common/Medusa/IMedusaLoaderService.cs index 06812a8e1..2219d91c5 100644 --- a/src/Nadeko.Bot.Common/Medusa/IMedusaLoaderService.cs +++ b/src/Nadeko.Bot.Common/Medusa/IMedusaLoaderService.cs @@ -1,6 +1,6 @@ using System.Globalization; -namespace Nadeko.Medusa; +namespace Nadeko.Common.Medusa; public interface IMedusaLoaderService { diff --git a/src/Nadeko.Bot.Common/Medusa/MedusaLoadResult.cs b/src/Nadeko.Bot.Common/Medusa/MedusaLoadResult.cs index 619450225..ab303cc51 100644 --- a/src/Nadeko.Bot.Common/Medusa/MedusaLoadResult.cs +++ b/src/Nadeko.Bot.Common/Medusa/MedusaLoadResult.cs @@ -1,4 +1,4 @@ -namespace Nadeko.Medusa; +namespace Nadeko.Common.Medusa; public enum MedusaLoadResult { diff --git a/src/Nadeko.Bot.Common/Medusa/MedusaUnloadResult.cs b/src/Nadeko.Bot.Common/Medusa/MedusaUnloadResult.cs index b8398bb12..4a829a2ec 100644 --- a/src/Nadeko.Bot.Common/Medusa/MedusaUnloadResult.cs +++ b/src/Nadeko.Bot.Common/Medusa/MedusaUnloadResult.cs @@ -1,4 +1,4 @@ -namespace Nadeko.Medusa; +namespace Nadeko.Common.Medusa; public enum MedusaUnloadResult { diff --git a/src/Nadeko.Bot.Common/Nadeko.Bot.Common.csproj b/src/Nadeko.Bot.Common/Nadeko.Bot.Common.csproj index c4eda4364..7250f219a 100644 --- a/src/Nadeko.Bot.Common/Nadeko.Bot.Common.csproj +++ b/src/Nadeko.Bot.Common/Nadeko.Bot.Common.csproj @@ -34,6 +34,8 @@ - + + responses.en-US.json + diff --git a/src/Nadeko.Bot.Common/NadekoModule.cs b/src/Nadeko.Bot.Common/NadekoModule.cs index f5811d484..d026fd756 100644 --- a/src/Nadeko.Bot.Common/NadekoModule.cs +++ b/src/Nadeko.Bot.Common/NadekoModule.cs @@ -79,9 +79,10 @@ public abstract class NadekoModule : ModuleBase public async Task PromptUserConfirmAsync(IEmbedBuilder embed) { - embed.WithPendingColor().WithFooter("yes/no"); + embed.WithPendingColor() + .WithFooter("yes/no"); - var msg = await ctx.Channel.EmbedAsync(embed); + var msg = await MessageChannelExtensions.EmbedAsync(ctx.Channel, embed); try { var input = await GetUserInputAsync(ctx.User.Id, ctx.Channel.Id); diff --git a/src/Nadeko.Bot.Common/Services/CommandHandler.cs b/src/Nadeko.Bot.Common/Services/CommandHandler.cs index 8fc9d6ac8..aa629c612 100644 --- a/src/Nadeko.Bot.Common/Services/CommandHandler.cs +++ b/src/Nadeko.Bot.Common/Services/CommandHandler.cs @@ -43,8 +43,8 @@ public class CommandHandler : INService, IReadyExecutor, ICommandHandler // InteractionService interactions, IServiceProvider services) { - _client = client; - _commandService = commandService; + _client = client; + _commandService = commandService; _bss = bss; _bot = bot; _behaviorHandler = behaviorHandler; diff --git a/src/Nadeko.Bot.Common/Services/Currency/DefaultWallet.cs b/src/Nadeko.Bot.Common/Services/Currency/DefaultWallet.cs index 93df5b96e..ac7584632 100644 --- a/src/Nadeko.Bot.Common/Services/Currency/DefaultWallet.cs +++ b/src/Nadeko.Bot.Common/Services/Currency/DefaultWallet.cs @@ -1,7 +1,7 @@ using LinqToDB; using LinqToDB.EntityFrameworkCore; using NadekoBot.Db.Models; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Services.Currency; diff --git a/src/Nadeko.Bot.Common/Services/Currency/GamblingTxTracker.cs b/src/Nadeko.Bot.Common/Services/Currency/GamblingTxTracker.cs index 3aa02ff20..635a7aac2 100644 --- a/src/Nadeko.Bot.Common/Services/Currency/GamblingTxTracker.cs +++ b/src/Nadeko.Bot.Common/Services/Currency/GamblingTxTracker.cs @@ -2,7 +2,7 @@ using LinqToDB; using LinqToDB.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Services.Currency; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Services; diff --git a/src/Nadeko.Bot.Common/Services/IRemindService.cs b/src/Nadeko.Bot.Common/Services/IRemindService.cs index 444d5237c..ee1f62255 100644 --- a/src/Nadeko.Bot.Common/Services/IRemindService.cs +++ b/src/Nadeko.Bot.Common/Services/IRemindService.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Utility.Services; diff --git a/src/Nadeko.Bot.Common/Services/Impl/BlacklistService.cs b/src/Nadeko.Bot.Common/Services/Impl/BlacklistService.cs index f8cc93760..d4c157455 100644 --- a/src/Nadeko.Bot.Common/Services/Impl/BlacklistService.cs +++ b/src/Nadeko.Bot.Common/Services/Impl/BlacklistService.cs @@ -5,7 +5,7 @@ using LinqToDB.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Db; using NadekoBot.Db.Models; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Permissions.Services; diff --git a/src/Nadeko.Bot.Common/Services/Impl/CommandsUtilityService.cs b/src/Nadeko.Bot.Common/Services/Impl/CommandsUtilityService.cs index f1259d512..48f77aef4 100644 --- a/src/Nadeko.Bot.Common/Services/Impl/CommandsUtilityService.cs +++ b/src/Nadeko.Bot.Common/Services/Impl/CommandsUtilityService.cs @@ -1,4 +1,5 @@ using CommandLine; +using Nadeko.Common.Medusa; namespace NadekoBot.Common; @@ -9,7 +10,7 @@ public sealed class CommandsUtilityService : ICommandsUtilityService, INService private readonly DiscordPermOverrideService _dpos; private readonly IEmbedBuilderService _eb; private readonly ILocalization _loc; - private readonly Nadeko.Medusa.IMedusaLoaderService _medusae; + private readonly IMedusaLoaderService _medusae; public CommandsUtilityService( CommandHandler ch, @@ -17,7 +18,7 @@ public sealed class CommandsUtilityService : ICommandsUtilityService, INService DiscordPermOverrideService dpos, IEmbedBuilderService eb, ILocalization loc, - Nadeko.Medusa.IMedusaLoaderService medusae) + IMedusaLoaderService medusae) { _ch = ch; _strings = strings; @@ -46,10 +47,9 @@ public sealed class CommandsUtilityService : ICommandsUtilityService, INService if (reqs.Any()) em.AddField(GetText(strs.requires, guild), string.Join("\n", reqs)); - em.AddField(_strings.GetText(strs.usage), - string.Join("\n", com.RealRemarksArr(_strings, _medusae, culture, prefix).Map(arg => Format.Code(arg)))) - .WithFooter(GetText(strs.module(com.Module.GetTopLevelModule().Name), guild)) - .WithOkColor(); + Extensions.Extensions.WithOkColor(em.AddField(_strings.GetText(strs.usage), + string.Join("\n", com.RealRemarksArr(_strings, _medusae, culture, prefix).Map(arg => Format.Code(arg)))) + .WithFooter(GetText(strs.module(com.Module.GetTopLevelModule().Name), guild))); var opt = GetNadekoOptionType(com.Attributes); if (opt is not null) diff --git a/src/Nadeko.Bot.Common/Services/Impl/DiscordPermOverrideService.cs b/src/Nadeko.Bot.Common/Services/Impl/DiscordPermOverrideService.cs index 72c8f7223..615dab2e2 100644 --- a/src/Nadeko.Bot.Common/Services/Impl/DiscordPermOverrideService.cs +++ b/src/Nadeko.Bot.Common/Services/Impl/DiscordPermOverrideService.cs @@ -1,7 +1,7 @@ #nullable disable using Microsoft.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Services; diff --git a/src/Nadeko.Bot.Common/_Extensions/Extensions.cs b/src/Nadeko.Bot.Common/_Extensions/Extensions.cs index 62f897d68..1592b6f33 100644 --- a/src/Nadeko.Bot.Common/_Extensions/Extensions.cs +++ b/src/Nadeko.Bot.Common/_Extensions/Extensions.cs @@ -3,7 +3,7 @@ using System.Diagnostics; using System.Globalization; using System.Text.Json; using System.Text.RegularExpressions; -using Nadeko.Medusa; +using Nadeko.Common.Medusa; namespace NadekoBot.Extensions; diff --git a/src/Nadeko.Bot.Common/_Extensions/IMessageChannelExtensions.cs b/src/Nadeko.Bot.Common/_Extensions/IMessageChannelExtensions.cs index fe9cb1346..092273194 100644 --- a/src/Nadeko.Bot.Common/_Extensions/IMessageChannelExtensions.cs +++ b/src/Nadeko.Bot.Common/_Extensions/IMessageChannelExtensions.cs @@ -1,3 +1,4 @@ + namespace NadekoBot.Extensions; public static class MessageChannelExtensions @@ -91,10 +92,6 @@ public static class MessageChannelExtensions return ch.EmbedAsync(builder, inter: inter); } - // regular send overloads - public static Task SendErrorAsync(this IMessageChannel ch, IEmbedBuilderService eb, string text) - => ch.SendAsync(eb, text, MsgType.Error); - public static Task SendConfirmAsync(this IMessageChannel ch, IEmbedBuilderService eb, string text) => ch.SendAsync(eb, text, MsgType.Ok); @@ -147,6 +144,10 @@ public static class MessageChannelExtensions string? url = null, string? footer = null) => ch.SendAsync(eb, MsgType.Error, title, text, url, footer); + + // regular send overloads + public static Task SendErrorAsync(this IMessageChannel ch, IEmbedBuilderService eb, string text) + => ch.SendAsync(eb, text, MsgType.Error); public static Task SendPaginatedConfirmAsync( this ICommandContext ctx, diff --git a/src/Nadeko.Bot.Common/_Extensions/SocketMessageComponentExtensions.cs b/src/Nadeko.Bot.Common/_Extensions/SocketMessageComponentExtensions.cs index a658eca6a..0f4444132 100644 --- a/src/Nadeko.Bot.Common/_Extensions/SocketMessageComponentExtensions.cs +++ b/src/Nadeko.Bot.Common/_Extensions/SocketMessageComponentExtensions.cs @@ -1,4 +1,5 @@ -namespace NadekoBot.Extensions; + +namespace NadekoBot.Extensions; public static class SocketMessageComponentExtensions { diff --git a/src/Nadeko.Bot.Db/Extensions/CurrencyTransactionExtensions.cs b/src/Nadeko.Bot.Db/Extensions/CurrencyTransactionExtensions.cs index 98cabb009..42d978de1 100644 --- a/src/Nadeko.Bot.Db/Extensions/CurrencyTransactionExtensions.cs +++ b/src/Nadeko.Bot.Db/Extensions/CurrencyTransactionExtensions.cs @@ -1,7 +1,7 @@ #nullable disable using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db; diff --git a/src/Nadeko.Bot.Db/Extensions/DbExtensions.cs b/src/Nadeko.Bot.Db/Extensions/DbExtensions.cs index c69f3e51b..da70d6625 100644 --- a/src/Nadeko.Bot.Db/Extensions/DbExtensions.cs +++ b/src/Nadeko.Bot.Db/Extensions/DbExtensions.cs @@ -1,6 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db; diff --git a/src/Nadeko.Bot.Db/Extensions/GuildConfigExtensions.cs b/src/Nadeko.Bot.Db/Extensions/GuildConfigExtensions.cs index 5db6b81c6..4fdf46385 100644 --- a/src/Nadeko.Bot.Db/Extensions/GuildConfigExtensions.cs +++ b/src/Nadeko.Bot.Db/Extensions/GuildConfigExtensions.cs @@ -1,8 +1,8 @@ #nullable disable using Microsoft.EntityFrameworkCore; using NadekoBot.Db.Models; -using NadekoBot.Services.Database; -using NadekoBot.Services.Database.Models; + +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db; diff --git a/src/Nadeko.Bot.Db/Extensions/NadekoExpressionExtensions.cs b/src/Nadeko.Bot.Db/Extensions/NadekoExpressionExtensions.cs index ffb25405d..a2a8e0757 100644 --- a/src/Nadeko.Bot.Db/Extensions/NadekoExpressionExtensions.cs +++ b/src/Nadeko.Bot.Db/Extensions/NadekoExpressionExtensions.cs @@ -1,7 +1,7 @@ #nullable disable using LinqToDB; using Microsoft.EntityFrameworkCore; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db; diff --git a/src/Nadeko.Bot.Db/Extensions/QuoteExtensions.cs b/src/Nadeko.Bot.Db/Extensions/QuoteExtensions.cs index 74edc6c28..b54880c5d 100644 --- a/src/Nadeko.Bot.Db/Extensions/QuoteExtensions.cs +++ b/src/Nadeko.Bot.Db/Extensions/QuoteExtensions.cs @@ -1,6 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db; @@ -29,10 +29,8 @@ public static class QuoteExtensions ulong guildId, string keyword) { - // todo figure shuffle out - return (await quotes.AsQueryable().Where(q => q.GuildId == guildId && q.Keyword == keyword).ToListAsync()) - .Shuffle() - .FirstOrDefault(); + return (await quotes.AsQueryable().Where(q => q.GuildId == guildId && q.Keyword == keyword).ToArrayAsync()) + .RandomOrDefault(); } public static async Task SearchQuoteKeywordTextAsync( @@ -41,15 +39,13 @@ public static class QuoteExtensions string keyword, string text) { - var rngk = new NadekoRandom(); return (await quotes.AsQueryable() .Where(q => q.GuildId == guildId && (keyword == null || q.Keyword == keyword) && (EF.Functions.Like(q.Text.ToUpper(), $"%{text.ToUpper()}%") || EF.Functions.Like(q.AuthorName, text))) - .ToListAsync()) - .OrderBy(_ => rngk.Next()) - .FirstOrDefault(); + .ToArrayAsync()) + .RandomOrDefault(); } public static void RemoveAllByKeyword(this DbSet quotes, ulong guildId, string keyword) diff --git a/src/Nadeko.Bot.Db/Extensions/ReminderExtensions.cs b/src/Nadeko.Bot.Db/Extensions/ReminderExtensions.cs index 312c642e9..ccdd13c30 100644 --- a/src/Nadeko.Bot.Db/Extensions/ReminderExtensions.cs +++ b/src/Nadeko.Bot.Db/Extensions/ReminderExtensions.cs @@ -1,6 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db; diff --git a/src/Nadeko.Bot.Db/Extensions/SelfAssignableRolesExtensions.cs b/src/Nadeko.Bot.Db/Extensions/SelfAssignableRolesExtensions.cs index 08a89bfae..06d7e6a5f 100644 --- a/src/Nadeko.Bot.Db/Extensions/SelfAssignableRolesExtensions.cs +++ b/src/Nadeko.Bot.Db/Extensions/SelfAssignableRolesExtensions.cs @@ -1,6 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db; diff --git a/src/Nadeko.Bot.Db/Extensions/UserXpExtensions.cs b/src/Nadeko.Bot.Db/Extensions/UserXpExtensions.cs index 3214a03b0..b5cb8048e 100644 --- a/src/Nadeko.Bot.Db/Extensions/UserXpExtensions.cs +++ b/src/Nadeko.Bot.Db/Extensions/UserXpExtensions.cs @@ -2,8 +2,8 @@ using LinqToDB; using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; -using NadekoBot.Services.Database; -using NadekoBot.Services.Database.Models; + +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db; diff --git a/src/Nadeko.Bot.Db/Extensions/WarningExtensions.cs b/src/Nadeko.Bot.Db/Extensions/WarningExtensions.cs index abaaea0d3..2c6ac33c3 100644 --- a/src/Nadeko.Bot.Db/Extensions/WarningExtensions.cs +++ b/src/Nadeko.Bot.Db/Extensions/WarningExtensions.cs @@ -1,6 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db; diff --git a/src/Nadeko.Bot.Db/GlobalUsings.cs b/src/Nadeko.Bot.Db/GlobalUsings.cs index d7366f6f0..ae4ac9ebd 100644 --- a/src/Nadeko.Bot.Db/GlobalUsings.cs +++ b/src/Nadeko.Bot.Db/GlobalUsings.cs @@ -7,12 +7,11 @@ // // // nadekobot global using NadekoBot; -global using NadekoBot.Services; global using Nadeko.Common; // global using NadekoBot.Common; // old + nadekobot specific things // global using NadekoBot.Common.Attributes; // global using NadekoBot.Extensions; -// global using Nadeko.Snake; +// global using Nadeko.Medusa; // // discord // global using Discord; diff --git a/src/Nadeko.Bot.Db/Models/AutoCommand.cs b/src/Nadeko.Bot.Db/Models/AutoCommand.cs index 7252a8207..e980d83e3 100644 --- a/src/Nadeko.Bot.Db/Models/AutoCommand.cs +++ b/src/Nadeko.Bot.Db/Models/AutoCommand.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class AutoCommand : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/AutoPublishChannel.cs b/src/Nadeko.Bot.Db/Models/AutoPublishChannel.cs index f74909427..2dd130e0a 100644 --- a/src/Nadeko.Bot.Db/Models/AutoPublishChannel.cs +++ b/src/Nadeko.Bot.Db/Models/AutoPublishChannel.cs @@ -1,4 +1,4 @@ -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db.Models; diff --git a/src/Nadeko.Bot.Db/Models/AutoTranslateChannel.cs b/src/Nadeko.Bot.Db/Models/AutoTranslateChannel.cs index a86a933b9..800832141 100644 --- a/src/Nadeko.Bot.Db/Models/AutoTranslateChannel.cs +++ b/src/Nadeko.Bot.Db/Models/AutoTranslateChannel.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class AutoTranslateChannel : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/AutoTranslateUser.cs b/src/Nadeko.Bot.Db/Models/AutoTranslateUser.cs index a040822a9..314db8279 100644 --- a/src/Nadeko.Bot.Db/Models/AutoTranslateUser.cs +++ b/src/Nadeko.Bot.Db/Models/AutoTranslateUser.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class AutoTranslateUser : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/BlacklistEntry.cs b/src/Nadeko.Bot.Db/Models/BlacklistEntry.cs index 8dfbec8c5..0200f7c6a 100644 --- a/src/Nadeko.Bot.Db/Models/BlacklistEntry.cs +++ b/src/Nadeko.Bot.Db/Models/BlacklistEntry.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class BlacklistEntry : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/CommandAlias.cs b/src/Nadeko.Bot.Db/Models/CommandAlias.cs index 1bbeb62e3..a5640a0ee 100644 --- a/src/Nadeko.Bot.Db/Models/CommandAlias.cs +++ b/src/Nadeko.Bot.Db/Models/CommandAlias.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class CommandAlias : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/CommandCooldown.cs b/src/Nadeko.Bot.Db/Models/CommandCooldown.cs index d54c8e1ca..ab55d59cc 100644 --- a/src/Nadeko.Bot.Db/Models/CommandCooldown.cs +++ b/src/Nadeko.Bot.Db/Models/CommandCooldown.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class CommandCooldown : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/CurrencyTransaction.cs b/src/Nadeko.Bot.Db/Models/CurrencyTransaction.cs index 6db9162f6..a17ccf54a 100644 --- a/src/Nadeko.Bot.Db/Models/CurrencyTransaction.cs +++ b/src/Nadeko.Bot.Db/Models/CurrencyTransaction.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class CurrencyTransaction : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/DbEntity.cs b/src/Nadeko.Bot.Db/Models/DbEntity.cs index 5e0882cf3..e91a34313 100644 --- a/src/Nadeko.Bot.Db/Models/DbEntity.cs +++ b/src/Nadeko.Bot.Db/Models/DbEntity.cs @@ -1,7 +1,7 @@ #nullable disable using System.ComponentModel.DataAnnotations; -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/DelMsgOnCmdChannel.cs b/src/Nadeko.Bot.Db/Models/DelMsgOnCmdChannel.cs index 32458cb24..e5fd7f4f6 100644 --- a/src/Nadeko.Bot.Db/Models/DelMsgOnCmdChannel.cs +++ b/src/Nadeko.Bot.Db/Models/DelMsgOnCmdChannel.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class DelMsgOnCmdChannel : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/DiscordPemOverride.cs b/src/Nadeko.Bot.Db/Models/DiscordPemOverride.cs index 3a5caf48d..522685416 100644 --- a/src/Nadeko.Bot.Db/Models/DiscordPemOverride.cs +++ b/src/Nadeko.Bot.Db/Models/DiscordPemOverride.cs @@ -1,7 +1,7 @@ #nullable disable using Nadeko.Bot.Db; -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class DiscordPermOverride : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/DiscordUser.cs b/src/Nadeko.Bot.Db/Models/DiscordUser.cs index 61622a53c..b8969d00f 100644 --- a/src/Nadeko.Bot.Db/Models/DiscordUser.cs +++ b/src/Nadeko.Bot.Db/Models/DiscordUser.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db.Models; diff --git a/src/Nadeko.Bot.Db/Models/Event.cs b/src/Nadeko.Bot.Db/Models/Event.cs index bb3c00eec..cfacf9ee8 100644 --- a/src/Nadeko.Bot.Db/Models/Event.cs +++ b/src/Nadeko.Bot.Db/Models/Event.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class CurrencyEvent { diff --git a/src/Nadeko.Bot.Db/Models/FeedSub.cs b/src/Nadeko.Bot.Db/Models/FeedSub.cs index 0ff17208f..bd02e85f1 100644 --- a/src/Nadeko.Bot.Db/Models/FeedSub.cs +++ b/src/Nadeko.Bot.Db/Models/FeedSub.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class FeedSub : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/FollowedStream.cs b/src/Nadeko.Bot.Db/Models/FollowedStream.cs index ea4e40b47..6cc380132 100644 --- a/src/Nadeko.Bot.Db/Models/FollowedStream.cs +++ b/src/Nadeko.Bot.Db/Models/FollowedStream.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db.Models; diff --git a/src/Nadeko.Bot.Db/Models/GCChannelId.cs b/src/Nadeko.Bot.Db/Models/GCChannelId.cs index bed2198b5..e86ccdeb1 100644 --- a/src/Nadeko.Bot.Db/Models/GCChannelId.cs +++ b/src/Nadeko.Bot.Db/Models/GCChannelId.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class GCChannelId : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/GamblingStats.cs b/src/Nadeko.Bot.Db/Models/GamblingStats.cs index 8fd741743..81da9ee80 100644 --- a/src/Nadeko.Bot.Db/Models/GamblingStats.cs +++ b/src/Nadeko.Bot.Db/Models/GamblingStats.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class GamblingStats : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/GroupName.cs b/src/Nadeko.Bot.Db/Models/GroupName.cs index 893bac755..e69311bae 100644 --- a/src/Nadeko.Bot.Db/Models/GroupName.cs +++ b/src/Nadeko.Bot.Db/Models/GroupName.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class GroupName : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/GuildConfig.cs b/src/Nadeko.Bot.Db/Models/GuildConfig.cs index 221f4cdd1..364a3a925 100644 --- a/src/Nadeko.Bot.Db/Models/GuildConfig.cs +++ b/src/Nadeko.Bot.Db/Models/GuildConfig.cs @@ -1,7 +1,7 @@ #nullable disable using NadekoBot.Db.Models; -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class GuildConfig : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/IgnoredLogItem.cs b/src/Nadeko.Bot.Db/Models/IgnoredLogItem.cs index a157e4e88..3dc48194a 100644 --- a/src/Nadeko.Bot.Db/Models/IgnoredLogItem.cs +++ b/src/Nadeko.Bot.Db/Models/IgnoredLogItem.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class IgnoredLogItem : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/IgnoredVoicePresenceChannel.cs b/src/Nadeko.Bot.Db/Models/IgnoredVoicePresenceChannel.cs index 0b1eefe94..4a949cfbb 100644 --- a/src/Nadeko.Bot.Db/Models/IgnoredVoicePresenceChannel.cs +++ b/src/Nadeko.Bot.Db/Models/IgnoredVoicePresenceChannel.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class IgnoredVoicePresenceChannel : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/ImageOnlyChannel.cs b/src/Nadeko.Bot.Db/Models/ImageOnlyChannel.cs index 12cda8578..d02442ae9 100644 --- a/src/Nadeko.Bot.Db/Models/ImageOnlyChannel.cs +++ b/src/Nadeko.Bot.Db/Models/ImageOnlyChannel.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class ImageOnlyChannel : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/LogSetting.cs b/src/Nadeko.Bot.Db/Models/LogSetting.cs index eae24a619..b1613a249 100644 --- a/src/Nadeko.Bot.Db/Models/LogSetting.cs +++ b/src/Nadeko.Bot.Db/Models/LogSetting.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class LogSetting : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/NsfwBlacklistedTag.cs b/src/Nadeko.Bot.Db/Models/NsfwBlacklistedTag.cs index 46f9af5c9..ae614ada9 100644 --- a/src/Nadeko.Bot.Db/Models/NsfwBlacklistedTag.cs +++ b/src/Nadeko.Bot.Db/Models/NsfwBlacklistedTag.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class NsfwBlacklistedTag : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/Permission.cs b/src/Nadeko.Bot.Db/Models/Permission.cs index 05fa4b727..63c80d564 100644 --- a/src/Nadeko.Bot.Db/Models/Permission.cs +++ b/src/Nadeko.Bot.Db/Models/Permission.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations.Schema; using System.Diagnostics; -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; [DebuggerDisplay("{PrimaryTarget}{SecondaryTarget} {SecondaryTargetName} {State} {PrimaryTargetId}")] public class Permissionv2 : DbEntity, IIndexed diff --git a/src/Nadeko.Bot.Db/Models/PlantedCurrency.cs b/src/Nadeko.Bot.Db/Models/PlantedCurrency.cs index 911d6ac22..d571fb999 100644 --- a/src/Nadeko.Bot.Db/Models/PlantedCurrency.cs +++ b/src/Nadeko.Bot.Db/Models/PlantedCurrency.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class PlantedCurrency : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/PlaylistSong.cs b/src/Nadeko.Bot.Db/Models/PlaylistSong.cs index a538b3409..9c54e110c 100644 --- a/src/Nadeko.Bot.Db/Models/PlaylistSong.cs +++ b/src/Nadeko.Bot.Db/Models/PlaylistSong.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class PlaylistSong : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/Poll.cs b/src/Nadeko.Bot.Db/Models/Poll.cs index 6649217f6..6d84a32c3 100644 --- a/src/Nadeko.Bot.Db/Models/Poll.cs +++ b/src/Nadeko.Bot.Db/Models/Poll.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class Poll : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/PollVote.cs b/src/Nadeko.Bot.Db/Models/PollVote.cs index d0fdb056c..479a0d947 100644 --- a/src/Nadeko.Bot.Db/Models/PollVote.cs +++ b/src/Nadeko.Bot.Db/Models/PollVote.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class PollVote : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/ReactionRole.cs b/src/Nadeko.Bot.Db/Models/ReactionRole.cs index 4a623be8f..442cfb3fb 100644 --- a/src/Nadeko.Bot.Db/Models/ReactionRole.cs +++ b/src/Nadeko.Bot.Db/Models/ReactionRole.cs @@ -1,7 +1,7 @@ #nullable disable using System.ComponentModel.DataAnnotations; -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class ReactionRoleV2 : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/Reminder.cs b/src/Nadeko.Bot.Db/Models/Reminder.cs index 7610e7c2b..0278f556f 100644 --- a/src/Nadeko.Bot.Db/Models/Reminder.cs +++ b/src/Nadeko.Bot.Db/Models/Reminder.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class Reminder : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/Repeater.cs b/src/Nadeko.Bot.Db/Models/Repeater.cs index 0957871b3..ceb8cbaa0 100644 --- a/src/Nadeko.Bot.Db/Models/Repeater.cs +++ b/src/Nadeko.Bot.Db/Models/Repeater.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class Repeater { diff --git a/src/Nadeko.Bot.Db/Models/RotatingPlayingStatus.cs b/src/Nadeko.Bot.Db/Models/RotatingPlayingStatus.cs index db09d3753..3da83dcce 100644 --- a/src/Nadeko.Bot.Db/Models/RotatingPlayingStatus.cs +++ b/src/Nadeko.Bot.Db/Models/RotatingPlayingStatus.cs @@ -1,7 +1,7 @@ #nullable disable using Nadeko.Bot.Db; -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class RotatingPlayingStatus : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/SelfAssignableRole.cs b/src/Nadeko.Bot.Db/Models/SelfAssignableRole.cs index 8cdb88189..2f22eeb08 100644 --- a/src/Nadeko.Bot.Db/Models/SelfAssignableRole.cs +++ b/src/Nadeko.Bot.Db/Models/SelfAssignableRole.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class SelfAssignedRole : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/ShopEntry.cs b/src/Nadeko.Bot.Db/Models/ShopEntry.cs index 519456c77..585f48325 100644 --- a/src/Nadeko.Bot.Db/Models/ShopEntry.cs +++ b/src/Nadeko.Bot.Db/Models/ShopEntry.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public enum ShopEntryType { diff --git a/src/Nadeko.Bot.Db/Models/StreamOnlineMessage.cs b/src/Nadeko.Bot.Db/Models/StreamOnlineMessage.cs index 75873d1cc..c7719356f 100644 --- a/src/Nadeko.Bot.Db/Models/StreamOnlineMessage.cs +++ b/src/Nadeko.Bot.Db/Models/StreamOnlineMessage.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db.Models; diff --git a/src/Nadeko.Bot.Db/Models/StreamRoleSettings.cs b/src/Nadeko.Bot.Db/Models/StreamRoleSettings.cs index 4db2dade3..2ffd9e9a8 100644 --- a/src/Nadeko.Bot.Db/Models/StreamRoleSettings.cs +++ b/src/Nadeko.Bot.Db/Models/StreamRoleSettings.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class StreamRoleSettings : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/VcRoleInfo.cs b/src/Nadeko.Bot.Db/Models/VcRoleInfo.cs index fdd825651..d1f5c93dd 100644 --- a/src/Nadeko.Bot.Db/Models/VcRoleInfo.cs +++ b/src/Nadeko.Bot.Db/Models/VcRoleInfo.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class VcRoleInfo : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/anti/AntiAltSetting.cs b/src/Nadeko.Bot.Db/Models/anti/AntiAltSetting.cs index b10ed0d56..cd6ee694d 100644 --- a/src/Nadeko.Bot.Db/Models/anti/AntiAltSetting.cs +++ b/src/Nadeko.Bot.Db/Models/anti/AntiAltSetting.cs @@ -1,4 +1,4 @@ -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class AntiAltSetting { diff --git a/src/Nadeko.Bot.Db/Models/anti/AntiRaidSetting.cs b/src/Nadeko.Bot.Db/Models/anti/AntiRaidSetting.cs index 4eb69bfa0..9a26577a2 100644 --- a/src/Nadeko.Bot.Db/Models/anti/AntiRaidSetting.cs +++ b/src/Nadeko.Bot.Db/Models/anti/AntiRaidSetting.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; // todo db required, nullable? diff --git a/src/Nadeko.Bot.Db/Models/anti/AntiSpamIgnore.cs b/src/Nadeko.Bot.Db/Models/anti/AntiSpamIgnore.cs index 304a6c871..b20c7b627 100644 --- a/src/Nadeko.Bot.Db/Models/anti/AntiSpamIgnore.cs +++ b/src/Nadeko.Bot.Db/Models/anti/AntiSpamIgnore.cs @@ -1,4 +1,4 @@ -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class AntiSpamIgnore : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/anti/AntiSpamSetting.cs b/src/Nadeko.Bot.Db/Models/anti/AntiSpamSetting.cs index 43fe1aacb..ec130b214 100644 --- a/src/Nadeko.Bot.Db/Models/anti/AntiSpamSetting.cs +++ b/src/Nadeko.Bot.Db/Models/anti/AntiSpamSetting.cs @@ -1,4 +1,4 @@ -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class AntiSpamSetting : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/club/ClubInfo.cs b/src/Nadeko.Bot.Db/Models/club/ClubInfo.cs index 0581a3217..4da80bdbf 100644 --- a/src/Nadeko.Bot.Db/Models/club/ClubInfo.cs +++ b/src/Nadeko.Bot.Db/Models/club/ClubInfo.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.ComponentModel.DataAnnotations; namespace NadekoBot.Db.Models; diff --git a/src/Nadeko.Bot.Db/Models/currency/BankUser.cs b/src/Nadeko.Bot.Db/Models/currency/BankUser.cs index b2c89de6a..cfd0fb1ce 100644 --- a/src/Nadeko.Bot.Db/Models/currency/BankUser.cs +++ b/src/Nadeko.Bot.Db/Models/currency/BankUser.cs @@ -1,4 +1,4 @@ -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db.Models; diff --git a/src/Nadeko.Bot.Db/Models/expr/NadekoExpression.cs b/src/Nadeko.Bot.Db/Models/expr/NadekoExpression.cs index 807d2c56d..dbd1a397b 100644 --- a/src/Nadeko.Bot.Db/Models/expr/NadekoExpression.cs +++ b/src/Nadeko.Bot.Db/Models/expr/NadekoExpression.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class NadekoExpression : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/expr/Quote.cs b/src/Nadeko.Bot.Db/Models/expr/Quote.cs index 0caf0cc8e..1e9162b93 100644 --- a/src/Nadeko.Bot.Db/Models/expr/Quote.cs +++ b/src/Nadeko.Bot.Db/Models/expr/Quote.cs @@ -1,7 +1,7 @@ #nullable disable using System.ComponentModel.DataAnnotations; -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class Quote : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/filter/FilterChannelId.cs b/src/Nadeko.Bot.Db/Models/filter/FilterChannelId.cs index 07135aec4..a1a056feb 100644 --- a/src/Nadeko.Bot.Db/Models/filter/FilterChannelId.cs +++ b/src/Nadeko.Bot.Db/Models/filter/FilterChannelId.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class FilterChannelId : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/filter/FilterLinksChannelId.cs b/src/Nadeko.Bot.Db/Models/filter/FilterLinksChannelId.cs index 7dad917d8..78fe69c09 100644 --- a/src/Nadeko.Bot.Db/Models/filter/FilterLinksChannelId.cs +++ b/src/Nadeko.Bot.Db/Models/filter/FilterLinksChannelId.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class FilterLinksChannelId : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/filter/FilteredWord.cs b/src/Nadeko.Bot.Db/Models/filter/FilteredWord.cs index af8d3b5c0..e6e2eb444 100644 --- a/src/Nadeko.Bot.Db/Models/filter/FilteredWord.cs +++ b/src/Nadeko.Bot.Db/Models/filter/FilteredWord.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class FilteredWord : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/punish/BanTemplate.cs b/src/Nadeko.Bot.Db/Models/punish/BanTemplate.cs index 87c06fbc8..16e559268 100644 --- a/src/Nadeko.Bot.Db/Models/punish/BanTemplate.cs +++ b/src/Nadeko.Bot.Db/Models/punish/BanTemplate.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class BanTemplate : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/punish/MutedUserId.cs b/src/Nadeko.Bot.Db/Models/punish/MutedUserId.cs index 9c399f632..61d9197dc 100644 --- a/src/Nadeko.Bot.Db/Models/punish/MutedUserId.cs +++ b/src/Nadeko.Bot.Db/Models/punish/MutedUserId.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class MutedUserId : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/punish/PunishmentAction.cs b/src/Nadeko.Bot.Db/Models/punish/PunishmentAction.cs index 160145e84..c9ac664ee 100644 --- a/src/Nadeko.Bot.Db/Models/punish/PunishmentAction.cs +++ b/src/Nadeko.Bot.Db/Models/punish/PunishmentAction.cs @@ -1,4 +1,4 @@ -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public enum PunishmentAction { diff --git a/src/Nadeko.Bot.Db/Models/punish/WarnExpireAction.cs b/src/Nadeko.Bot.Db/Models/punish/WarnExpireAction.cs index b8d9e5b36..142ccb1ba 100644 --- a/src/Nadeko.Bot.Db/Models/punish/WarnExpireAction.cs +++ b/src/Nadeko.Bot.Db/Models/punish/WarnExpireAction.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public enum WarnExpireAction { diff --git a/src/Nadeko.Bot.Db/Models/punish/Warning.cs b/src/Nadeko.Bot.Db/Models/punish/Warning.cs index 6ecf6620f..428d4b3ef 100644 --- a/src/Nadeko.Bot.Db/Models/punish/Warning.cs +++ b/src/Nadeko.Bot.Db/Models/punish/Warning.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class Warning : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/punish/WarningPunishment.cs b/src/Nadeko.Bot.Db/Models/punish/WarningPunishment.cs index 8c78afce6..49b569449 100644 --- a/src/Nadeko.Bot.Db/Models/punish/WarningPunishment.cs +++ b/src/Nadeko.Bot.Db/Models/punish/WarningPunishment.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class WarningPunishment : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/slowmode/SlowmodeIgnoredRole.cs b/src/Nadeko.Bot.Db/Models/slowmode/SlowmodeIgnoredRole.cs index 13dee800c..7f7e6beca 100644 --- a/src/Nadeko.Bot.Db/Models/slowmode/SlowmodeIgnoredRole.cs +++ b/src/Nadeko.Bot.Db/Models/slowmode/SlowmodeIgnoredRole.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class SlowmodeIgnoredRole : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/slowmode/SlowmodeIgnoredUser.cs b/src/Nadeko.Bot.Db/Models/slowmode/SlowmodeIgnoredUser.cs index 2972749b7..f1b3468eb 100644 --- a/src/Nadeko.Bot.Db/Models/slowmode/SlowmodeIgnoredUser.cs +++ b/src/Nadeko.Bot.Db/Models/slowmode/SlowmodeIgnoredUser.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class SlowmodeIgnoredUser : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/support/RewardedUser.cs b/src/Nadeko.Bot.Db/Models/support/RewardedUser.cs index 13f5b9997..58df14614 100644 --- a/src/Nadeko.Bot.Db/Models/support/RewardedUser.cs +++ b/src/Nadeko.Bot.Db/Models/support/RewardedUser.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class RewardedUser : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/untimer/UnbanTimer.cs b/src/Nadeko.Bot.Db/Models/untimer/UnbanTimer.cs index 3c6a5d984..8724619a8 100644 --- a/src/Nadeko.Bot.Db/Models/untimer/UnbanTimer.cs +++ b/src/Nadeko.Bot.Db/Models/untimer/UnbanTimer.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class UnbanTimer : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/untimer/UnmuteTimer.cs b/src/Nadeko.Bot.Db/Models/untimer/UnmuteTimer.cs index e99ef02f0..5ad9bc035 100644 --- a/src/Nadeko.Bot.Db/Models/untimer/UnmuteTimer.cs +++ b/src/Nadeko.Bot.Db/Models/untimer/UnmuteTimer.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class UnmuteTimer : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/untimer/UnroleTimer.cs b/src/Nadeko.Bot.Db/Models/untimer/UnroleTimer.cs index c037ca1ff..e20754d27 100644 --- a/src/Nadeko.Bot.Db/Models/untimer/UnroleTimer.cs +++ b/src/Nadeko.Bot.Db/Models/untimer/UnroleTimer.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class UnroleTimer : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/xp/UserXpStats.cs b/src/Nadeko.Bot.Db/Models/xp/UserXpStats.cs index 0e99eaba9..8ca8735b6 100644 --- a/src/Nadeko.Bot.Db/Models/xp/UserXpStats.cs +++ b/src/Nadeko.Bot.Db/Models/xp/UserXpStats.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class UserXpStats : DbEntity { diff --git a/src/Nadeko.Bot.Db/Models/xp/XpSettings.cs b/src/Nadeko.Bot.Db/Models/xp/XpSettings.cs index d1887ad94..cc389b0cb 100644 --- a/src/Nadeko.Bot.Db/Models/xp/XpSettings.cs +++ b/src/Nadeko.Bot.Db/Models/xp/XpSettings.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class XpSettings : DbEntity { diff --git a/src/Nadeko.Bot.Modules.Administration/AdministrationService.cs b/src/Nadeko.Bot.Modules.Administration/AdministrationService.cs index 1641b351b..823f2ba95 100644 --- a/src/Nadeko.Bot.Modules.Administration/AdministrationService.cs +++ b/src/Nadeko.Bot.Modules.Administration/AdministrationService.cs @@ -1,7 +1,7 @@ #nullable disable using Microsoft.EntityFrameworkCore; using NadekoBot.Db; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Administration.Services; diff --git a/src/Nadeko.Bot.Modules.Administration/AutoAssignableRoles/AutoAssignRoleService.cs b/src/Nadeko.Bot.Modules.Administration/AutoAssignableRoles/AutoAssignRoleService.cs index 00d58d070..f2e8cdcb5 100644 --- a/src/Nadeko.Bot.Modules.Administration/AutoAssignableRoles/AutoAssignRoleService.cs +++ b/src/Nadeko.Bot.Modules.Administration/AutoAssignableRoles/AutoAssignRoleService.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.Net; using System.Threading.Channels; using LinqToDB; diff --git a/src/Nadeko.Bot.Modules.Administration/DangerousCommands/DangerousCommandsService.cs b/src/Nadeko.Bot.Modules.Administration/DangerousCommands/DangerousCommandsService.cs index 979106f6f..730f4bb53 100644 --- a/src/Nadeko.Bot.Modules.Administration/DangerousCommands/DangerousCommandsService.cs +++ b/src/Nadeko.Bot.Modules.Administration/DangerousCommands/DangerousCommandsService.cs @@ -3,7 +3,7 @@ using LinqToDB; using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using NadekoBot.Db.Models; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Administration.Services; diff --git a/src/Nadeko.Bot.Modules.Administration/GlobalUsings.cs b/src/Nadeko.Bot.Modules.Administration/GlobalUsings.cs index f754e6165..a6363f20f 100644 --- a/src/Nadeko.Bot.Modules.Administration/GlobalUsings.cs +++ b/src/Nadeko.Bot.Modules.Administration/GlobalUsings.cs @@ -13,7 +13,7 @@ global using Nadeko.Common; // new project global using NadekoBot.Common; // old + nadekobot specific things global using NadekoBot.Common.Attributes; global using NadekoBot.Extensions; -// global using Nadeko.Snake; +// global using Nadeko.Medusa; // discord global using Discord; diff --git a/src/Nadeko.Bot.Modules.Administration/GreetBye/GreetService.cs b/src/Nadeko.Bot.Modules.Administration/GreetBye/GreetService.cs index 2a1b2edf8..7a52ded84 100644 --- a/src/Nadeko.Bot.Modules.Administration/GreetBye/GreetService.cs +++ b/src/Nadeko.Bot.Modules.Administration/GreetBye/GreetService.cs @@ -1,6 +1,6 @@ using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Db; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.Threading.Channels; namespace NadekoBot.Services; diff --git a/src/Nadeko.Bot.Modules.Administration/GreetBye/GreetSettings.cs b/src/Nadeko.Bot.Modules.Administration/GreetBye/GreetSettings.cs index 17d746cb3..d11a72c51 100644 --- a/src/Nadeko.Bot.Modules.Administration/GreetBye/GreetSettings.cs +++ b/src/Nadeko.Bot.Modules.Administration/GreetBye/GreetSettings.cs @@ -1,4 +1,4 @@ -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Services; diff --git a/src/Nadeko.Bot.Modules.Administration/ImageOnlyChannelService.cs b/src/Nadeko.Bot.Modules.Administration/ImageOnlyChannelService.cs index 9bf5f21cb..a433e1d79 100644 --- a/src/Nadeko.Bot.Modules.Administration/ImageOnlyChannelService.cs +++ b/src/Nadeko.Bot.Modules.Administration/ImageOnlyChannelService.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.Caching.Memory; using NadekoBot.Common.ModuleBehaviors; using System.Net; using System.Threading.Channels; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Administration.Services; diff --git a/src/Nadeko.Bot.Modules.Administration/Mute/MuteService.cs b/src/Nadeko.Bot.Modules.Administration/Mute/MuteService.cs index 872f50699..55b37668b 100644 --- a/src/Nadeko.Bot.Modules.Administration/Mute/MuteService.cs +++ b/src/Nadeko.Bot.Modules.Administration/Mute/MuteService.cs @@ -1,7 +1,7 @@ #nullable disable using Microsoft.EntityFrameworkCore; using NadekoBot.Db; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Administration.Services; diff --git a/src/Nadeko.Bot.Modules.Administration/PlayingRotate/PlayingRotateService.cs b/src/Nadeko.Bot.Modules.Administration/PlayingRotate/PlayingRotateService.cs index 2fb139dde..dc53645b3 100644 --- a/src/Nadeko.Bot.Modules.Administration/PlayingRotate/PlayingRotateService.cs +++ b/src/Nadeko.Bot.Modules.Administration/PlayingRotate/PlayingRotateService.cs @@ -1,7 +1,7 @@ #nullable disable using Microsoft.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Administration.Services; diff --git a/src/Nadeko.Bot.Modules.Administration/Protection/ProtectionCommands.cs b/src/Nadeko.Bot.Modules.Administration/Protection/ProtectionCommands.cs index eea1e9712..038fc1650 100644 --- a/src/Nadeko.Bot.Modules.Administration/Protection/ProtectionCommands.cs +++ b/src/Nadeko.Bot.Modules.Administration/Protection/ProtectionCommands.cs @@ -1,7 +1,7 @@ #nullable disable using NadekoBot.Common.TypeReaders.Models; using NadekoBot.Modules.Administration.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Administration; diff --git a/src/Nadeko.Bot.Modules.Administration/Protection/ProtectionService.cs b/src/Nadeko.Bot.Modules.Administration/Protection/ProtectionService.cs index bd03278f1..9bc09d7a4 100644 --- a/src/Nadeko.Bot.Modules.Administration/Protection/ProtectionService.cs +++ b/src/Nadeko.Bot.Modules.Administration/Protection/ProtectionService.cs @@ -1,7 +1,7 @@ #nullable disable using Microsoft.EntityFrameworkCore; using NadekoBot.Db; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.Threading.Channels; namespace NadekoBot.Modules.Administration.Services; diff --git a/src/Nadeko.Bot.Modules.Administration/Protection/ProtectionStats.cs b/src/Nadeko.Bot.Modules.Administration/Protection/ProtectionStats.cs index ce1ce310d..fa8936ec3 100644 --- a/src/Nadeko.Bot.Modules.Administration/Protection/ProtectionStats.cs +++ b/src/Nadeko.Bot.Modules.Administration/Protection/ProtectionStats.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Administration; diff --git a/src/Nadeko.Bot.Modules.Administration/Protection/PunishQueueItem.cs b/src/Nadeko.Bot.Modules.Administration/Protection/PunishQueueItem.cs index 3bfc43ba1..642b4eda1 100644 --- a/src/Nadeko.Bot.Modules.Administration/Protection/PunishQueueItem.cs +++ b/src/Nadeko.Bot.Modules.Administration/Protection/PunishQueueItem.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Administration; diff --git a/src/Nadeko.Bot.Modules.Administration/Role/IReactionRoleService.cs b/src/Nadeko.Bot.Modules.Administration/Role/IReactionRoleService.cs index 3966d91bd..dfcff1f3b 100644 --- a/src/Nadeko.Bot.Modules.Administration/Role/IReactionRoleService.cs +++ b/src/Nadeko.Bot.Modules.Administration/Role/IReactionRoleService.cs @@ -1,6 +1,6 @@ #nullable disable using NadekoBot.Modules.Patronage; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using OneOf; using OneOf.Types; diff --git a/src/Nadeko.Bot.Modules.Administration/Role/ReactionRolesService.cs b/src/Nadeko.Bot.Modules.Administration/Role/ReactionRolesService.cs index 9b35ab141..dba4e1f8e 100644 --- a/src/Nadeko.Bot.Modules.Administration/Role/ReactionRolesService.cs +++ b/src/Nadeko.Bot.Modules.Administration/Role/ReactionRolesService.cs @@ -4,7 +4,7 @@ using LinqToDB.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Db; using NadekoBot.Modules.Patronage; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using OneOf.Types; using OneOf; diff --git a/src/Nadeko.Bot.Modules.Administration/Self/SelfCommands.cs b/src/Nadeko.Bot.Modules.Administration/Self/SelfCommands.cs index fb81c86bd..17003a869 100644 --- a/src/Nadeko.Bot.Modules.Administration/Self/SelfCommands.cs +++ b/src/Nadeko.Bot.Modules.Administration/Self/SelfCommands.cs @@ -1,7 +1,7 @@ #nullable disable -using Nadeko.Medusa; using NadekoBot.Modules.Administration.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; +using Nadeko.Common.Medusa; namespace NadekoBot.Modules.Administration; diff --git a/src/Nadeko.Bot.Modules.Administration/Self/SelfService.cs b/src/Nadeko.Bot.Modules.Administration/Self/SelfService.cs index d5d4b265e..a29efd41c 100644 --- a/src/Nadeko.Bot.Modules.Administration/Self/SelfService.cs +++ b/src/Nadeko.Bot.Modules.Administration/Self/SelfService.cs @@ -1,7 +1,7 @@ #nullable disable using Microsoft.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.Collections.Immutable; namespace NadekoBot.Modules.Administration.Services; diff --git a/src/Nadeko.Bot.Modules.Administration/SelfAssignableRoles/SelfAssignedRolesService.cs b/src/Nadeko.Bot.Modules.Administration/SelfAssignableRoles/SelfAssignedRolesService.cs index 7483e9043..30e8cb109 100644 --- a/src/Nadeko.Bot.Modules.Administration/SelfAssignableRoles/SelfAssignedRolesService.cs +++ b/src/Nadeko.Bot.Modules.Administration/SelfAssignableRoles/SelfAssignedRolesService.cs @@ -1,7 +1,7 @@ #nullable disable using Microsoft.EntityFrameworkCore; using NadekoBot.Db; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Administration.Services; diff --git a/src/Nadeko.Bot.Modules.Administration/ServerLog/DummyLogCommandService.cs b/src/Nadeko.Bot.Modules.Administration/ServerLog/DummyLogCommandService.cs index 566593ea5..917124ef3 100644 --- a/src/Nadeko.Bot.Modules.Administration/ServerLog/DummyLogCommandService.cs +++ b/src/Nadeko.Bot.Modules.Administration/ServerLog/DummyLogCommandService.cs @@ -1,4 +1,4 @@ -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Administration; diff --git a/src/Nadeko.Bot.Modules.Administration/ServerLog/ServerLogCommandService.cs b/src/Nadeko.Bot.Modules.Administration/ServerLog/ServerLogCommandService.cs index f13a1815f..a0e22881e 100644 --- a/src/Nadeko.Bot.Modules.Administration/ServerLog/ServerLogCommandService.cs +++ b/src/Nadeko.Bot.Modules.Administration/ServerLog/ServerLogCommandService.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.Caching.Memory; using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Db; using NadekoBot.Modules.Administration.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Administration; diff --git a/src/Nadeko.Bot.Modules.Administration/ServerLog/ServerLogCommands.cs b/src/Nadeko.Bot.Modules.Administration/ServerLog/ServerLogCommands.cs index e597b71e0..e3197dbdd 100644 --- a/src/Nadeko.Bot.Modules.Administration/ServerLog/ServerLogCommands.cs +++ b/src/Nadeko.Bot.Modules.Administration/ServerLog/ServerLogCommands.cs @@ -1,5 +1,5 @@ using NadekoBot.Common.TypeReaders.Models; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Administration; diff --git a/src/Nadeko.Bot.Modules.Administration/Timezone/GuildTimezoneService.cs b/src/Nadeko.Bot.Modules.Administration/Timezone/GuildTimezoneService.cs index 7b6efd09b..f7dd83a5d 100644 --- a/src/Nadeko.Bot.Modules.Administration/Timezone/GuildTimezoneService.cs +++ b/src/Nadeko.Bot.Modules.Administration/Timezone/GuildTimezoneService.cs @@ -1,6 +1,6 @@ #nullable disable using NadekoBot.Db; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Administration.Services; diff --git a/src/Nadeko.Bot.Modules.Administration/UserPunish/UserPunishCommands.cs b/src/Nadeko.Bot.Modules.Administration/UserPunish/UserPunishCommands.cs index bdac03dba..c9e05d242 100644 --- a/src/Nadeko.Bot.Modules.Administration/UserPunish/UserPunishCommands.cs +++ b/src/Nadeko.Bot.Modules.Administration/UserPunish/UserPunishCommands.cs @@ -3,7 +3,7 @@ using CommandLine; using Humanizer.Localisation; using NadekoBot.Common.TypeReaders.Models; using NadekoBot.Modules.Administration.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Administration; diff --git a/src/Nadeko.Bot.Modules.Administration/UserPunish/UserPunishService.cs b/src/Nadeko.Bot.Modules.Administration/UserPunish/UserPunishService.cs index b3dcb0bc2..ffa3b99a6 100644 --- a/src/Nadeko.Bot.Modules.Administration/UserPunish/UserPunishService.cs +++ b/src/Nadeko.Bot.Modules.Administration/UserPunish/UserPunishService.cs @@ -6,7 +6,7 @@ using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Common.TypeReaders.Models; using NadekoBot.Db; using NadekoBot.Modules.Permissions.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using Newtonsoft.Json; namespace NadekoBot.Modules.Administration.Services; diff --git a/src/Nadeko.Bot.Modules.Administration/VcRole/VcRoleService.cs b/src/Nadeko.Bot.Modules.Administration/VcRole/VcRoleService.cs index adec30d3a..9ccdaa55e 100644 --- a/src/Nadeko.Bot.Modules.Administration/VcRole/VcRoleService.cs +++ b/src/Nadeko.Bot.Modules.Administration/VcRole/VcRoleService.cs @@ -1,7 +1,7 @@ #nullable disable using Microsoft.EntityFrameworkCore; using NadekoBot.Db; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Administration.Services; diff --git a/src/Nadeko.Bot.Modules.Expresssions/ExportedExpr.cs b/src/Nadeko.Bot.Modules.Expresssions/ExportedExpr.cs index b1b1383f8..448815fde 100644 --- a/src/Nadeko.Bot.Modules.Expresssions/ExportedExpr.cs +++ b/src/Nadeko.Bot.Modules.Expresssions/ExportedExpr.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.NadekoExpressions; diff --git a/src/Nadeko.Bot.Modules.Expresssions/GlobalUsings.cs b/src/Nadeko.Bot.Modules.Expresssions/GlobalUsings.cs index f23c88d19..0130a2113 100644 --- a/src/Nadeko.Bot.Modules.Expresssions/GlobalUsings.cs +++ b/src/Nadeko.Bot.Modules.Expresssions/GlobalUsings.cs @@ -12,7 +12,7 @@ global using Nadeko.Common; // new project global using NadekoBot.Common; // old + nadekobot specific things // global using NadekoBot.Common.Attributes; global using NadekoBot.Extensions; -// global using Nadeko.Snake; +// global using Nadeko.Medusa; // discord global using Discord; diff --git a/src/Nadeko.Bot.Modules.Expresssions/NadekoExpressionExtensions.cs b/src/Nadeko.Bot.Modules.Expresssions/NadekoExpressionExtensions.cs index 856733206..d1f3d5d26 100644 --- a/src/Nadeko.Bot.Modules.Expresssions/NadekoExpressionExtensions.cs +++ b/src/Nadeko.Bot.Modules.Expresssions/NadekoExpressionExtensions.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.Runtime.CompilerServices; namespace NadekoBot.Modules.NadekoExpressions; diff --git a/src/Nadeko.Bot.Modules.Expresssions/NadekoExpressionsService.cs b/src/Nadeko.Bot.Modules.Expresssions/NadekoExpressionsService.cs index f63630a2b..f8f7768d6 100644 --- a/src/Nadeko.Bot.Modules.Expresssions/NadekoExpressionsService.cs +++ b/src/Nadeko.Bot.Modules.Expresssions/NadekoExpressionsService.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Common.Yml; using NadekoBot.Db; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.Runtime.CompilerServices; using LinqToDB.EntityFrameworkCore; using Nadeko.Bot.Common; @@ -251,21 +251,8 @@ public sealed class NadekoExpressionsService : IExecOnMessage, IReadyExecutor // todo print error etc - // if (await _cmdCds.TryBlock(guild, msg.Author, expr.Trigger)) - // return false; - try { - // if (_gperm.BlockedModules.Contains("ACTUALEXPRESSIONS")) - // { - // Log.Information( - // "User {UserName} [{UserId}] tried to use an expression but 'ActualExpressions' are globally disabled", - // msg.Author.ToString(), - // msg.Author.Id); - // - // return true; - // } - // // if (guild is SocketGuild sg) // { // var pc = _perms.GetCacheFor(guild.Id); diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/CurrencyEventsCommands.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/CurrencyEventsCommands.cs index f05b247ce..c679c9c34 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/CurrencyEventsCommands.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/CurrencyEventsCommands.cs @@ -2,7 +2,7 @@ using NadekoBot.Modules.Gambling.Common; using NadekoBot.Modules.Gambling.Common.Events; using NadekoBot.Modules.Gambling.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Gambling; diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/CurrencyEventsService.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/CurrencyEventsService.cs index fe840b498..60494e93c 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/CurrencyEventsService.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/CurrencyEventsService.cs @@ -1,7 +1,7 @@ #nullable disable using NadekoBot.Modules.Gambling.Common; using NadekoBot.Modules.Gambling.Common.Events; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Gambling.Services; diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/GameStatusEvent.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/GameStatusEvent.cs index 08ba310be..d1de5cc15 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/GameStatusEvent.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/GameStatusEvent.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.Collections.Concurrent; namespace NadekoBot.Modules.Gambling.Common.Events; diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/ReactionEvent.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/ReactionEvent.cs index 3f5f24511..bc43193d5 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/ReactionEvent.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Events/ReactionEvent.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Gambling.Common.Events; diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Gambling.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Gambling.cs index 5fa2a8e09..0aca1322f 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Gambling.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Gambling.cs @@ -8,7 +8,7 @@ using NadekoBot.Modules.Gambling.Common; using NadekoBot.Modules.Gambling.Services; using NadekoBot.Modules.Utility.Services; using NadekoBot.Services.Currency; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.Collections.Immutable; using System.Globalization; using System.Text; diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/GamblingService.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/GamblingService.cs index 6c81e91fa..9340efc8a 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/GamblingService.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/GamblingService.cs @@ -6,7 +6,7 @@ using NadekoBot.Db; using NadekoBot.Db.Models; using NadekoBot.Modules.Gambling.Common; using NadekoBot.Modules.Gambling.Common.Connect4; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Gambling.Services; diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/GlobalUsings.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/GlobalUsings.cs index f36328bd4..fe71f464d 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/GlobalUsings.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/GlobalUsings.cs @@ -12,7 +12,6 @@ global using Nadeko.Common; // new project global using NadekoBot.Common; // old + nadekobot specific things global using NadekoBot.Common.Attributes; global using NadekoBot.Extensions; -global using Nadeko.Snake; // discord global using Discord; diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/PlantPick/PlantPickService.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/PlantPick/PlantPickService.cs index 820cb6a11..cf653fa57 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/PlantPick/PlantPickService.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/PlantPick/PlantPickService.cs @@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Db; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using SixLabors.Fonts; using SixLabors.ImageSharp; using SixLabors.ImageSharp.Drawing.Processing; diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Shop/ShopCommands.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Shop/ShopCommands.cs index 8a2aa42a2..91786e529 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Shop/ShopCommands.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Shop/ShopCommands.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; using NadekoBot.Db; using NadekoBot.Modules.Gambling.Common; using NadekoBot.Modules.Gambling.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Gambling; diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Shop/ShopService.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Shop/ShopService.cs index 7bd47d5a8..0a86c50a7 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Shop/ShopService.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Shop/ShopService.cs @@ -1,8 +1,8 @@ #nullable disable using Microsoft.EntityFrameworkCore; using NadekoBot.Db; -using NadekoBot.Services.Database; -using NadekoBot.Services.Database.Models; + +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Gambling.Services; diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/WaifuClaimCommands.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/WaifuClaimCommands.cs index 11589a18a..795649dfe 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/WaifuClaimCommands.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/WaifuClaimCommands.cs @@ -2,7 +2,7 @@ using NadekoBot.Modules.Gambling.Common; using NadekoBot.Modules.Gambling.Common.Waifu; using NadekoBot.Modules.Gambling.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Gambling; diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/WaifuService.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/WaifuService.cs index 4f36d8b88..85a8b937b 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/WaifuService.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/WaifuService.cs @@ -7,7 +7,7 @@ using NadekoBot.Db; using NadekoBot.Db.Models; using NadekoBot.Modules.Gambling.Common; using NadekoBot.Modules.Gambling.Common.Waifu; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Gambling.Services; diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/Waifu.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/Waifu.cs index 80c0429a4..63a82f8c0 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/Waifu.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/Waifu.cs @@ -1,7 +1,7 @@ #nullable disable using NadekoBot.Db.Models; -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class WaifuInfo : DbEntity { diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuExtensions.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuExtensions.cs index aafb09c31..61dc7f96b 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuExtensions.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuExtensions.cs @@ -3,8 +3,8 @@ using LinqToDB; using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using NadekoBot.Db.Models; -using NadekoBot.Services.Database; -using NadekoBot.Services.Database.Models; + +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db; diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuItem.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuItem.cs index e20e1d313..fb2eafcea 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuItem.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuItem.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class WaifuItem : DbEntity { diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuLbResult.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuLbResult.cs index 0bfe14b4f..6fcb7b3bb 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuLbResult.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuLbResult.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class WaifuLbResult { diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuUpdate.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuUpdate.cs index 357127bb4..fa72be42e 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuUpdate.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuUpdate.cs @@ -1,7 +1,7 @@ #nullable disable using NadekoBot.Db.Models; -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class WaifuUpdate : DbEntity { diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuUpdateType.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuUpdateType.cs index e5f9f7f1a..a05307b39 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuUpdateType.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/db/WaifuUpdateType.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public enum WaifuUpdateType { diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/_common/GamblingCleanupService.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/_common/GamblingCleanupService.cs index a10806284..a0e9ce72e 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/_common/GamblingCleanupService.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/_common/GamblingCleanupService.cs @@ -1,6 +1,6 @@ using LinqToDB; using NadekoBot.Db.Models; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace Nadeko.Bot.Modules.Gambling.Gambling._Common; diff --git a/src/Nadeko.Bot.Modules.Gambling/Games/ChatterBot/CleverBotCommands.cs b/src/Nadeko.Bot.Modules.Gambling/Games/ChatterBot/CleverBotCommands.cs index 3265529e2..fdbcfbc27 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Games/ChatterBot/CleverBotCommands.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Games/ChatterBot/CleverBotCommands.cs @@ -1,7 +1,7 @@ #nullable disable using NadekoBot.Db; using NadekoBot.Modules.Games.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Games; diff --git a/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollCommands.cs b/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollCommands.cs index 837792157..9ac9c1178 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollCommands.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollCommands.cs @@ -1,6 +1,6 @@ #nullable disable using NadekoBot.Modules.Games.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.Text; namespace NadekoBot.Modules.Games; diff --git a/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollExtensions.cs b/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollExtensions.cs index 40f7abedc..ce8b7c414 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollExtensions.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollExtensions.cs @@ -1,7 +1,7 @@ #nullable disable using Microsoft.EntityFrameworkCore; -using NadekoBot.Services.Database; -using NadekoBot.Services.Database.Models; + +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db; diff --git a/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollRunner.cs b/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollRunner.cs index 618efd487..86efb234e 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollRunner.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollRunner.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Games.Common; diff --git a/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollService.cs b/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollService.cs index efae39526..a7ccfa88e 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollService.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Games/Polls/PollService.cs @@ -2,7 +2,7 @@ using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Db; using NadekoBot.Modules.Games.Common; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Games.Services; diff --git a/src/Nadeko.Bot.Modules.Help/GlobalUsings.cs b/src/Nadeko.Bot.Modules.Help/GlobalUsings.cs index f754e6165..a6363f20f 100644 --- a/src/Nadeko.Bot.Modules.Help/GlobalUsings.cs +++ b/src/Nadeko.Bot.Modules.Help/GlobalUsings.cs @@ -13,7 +13,7 @@ global using Nadeko.Common; // new project global using NadekoBot.Common; // old + nadekobot specific things global using NadekoBot.Common.Attributes; global using NadekoBot.Extensions; -// global using Nadeko.Snake; +// global using Nadeko.Medusa; // discord global using Discord; diff --git a/src/Nadeko.Bot.Modules.Help/Help.cs b/src/Nadeko.Bot.Modules.Help/Help.cs index 7c71a9606..60e6e50bb 100644 --- a/src/Nadeko.Bot.Modules.Help/Help.cs +++ b/src/Nadeko.Bot.Modules.Help/Help.cs @@ -1,12 +1,12 @@ #nullable disable using Amazon.S3; -using Nadeko.Medusa; using NadekoBot.Modules.Help.Common; using NadekoBot.Modules.Help.Services; using Newtonsoft.Json; using System.Text; using System.Text.Json; using Nadeko.Bot.Common; +using Nadeko.Common.Medusa; using JsonSerializer = System.Text.Json.JsonSerializer; namespace NadekoBot.Modules.Help; diff --git a/src/Nadeko.Bot.Modules.Music/CleanupCommands.cs b/src/Nadeko.Bot.Modules.Music/CleanupCommands.cs index 1a2a847ee..d018a7d82 100644 --- a/src/Nadeko.Bot.Modules.Music/CleanupCommands.cs +++ b/src/Nadeko.Bot.Modules.Music/CleanupCommands.cs @@ -1,5 +1,5 @@ using LinqToDB; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Music; diff --git a/src/Nadeko.Bot.Modules.Music/GlobalUsings.cs b/src/Nadeko.Bot.Modules.Music/GlobalUsings.cs index f36328bd4..fe71f464d 100644 --- a/src/Nadeko.Bot.Modules.Music/GlobalUsings.cs +++ b/src/Nadeko.Bot.Modules.Music/GlobalUsings.cs @@ -12,7 +12,6 @@ global using Nadeko.Common; // new project global using NadekoBot.Common; // old + nadekobot specific things global using NadekoBot.Common.Attributes; global using NadekoBot.Extensions; -global using Nadeko.Snake; // discord global using Discord; diff --git a/src/Nadeko.Bot.Modules.Music/Music.cs b/src/Nadeko.Bot.Modules.Music/Music.cs index 20bf14a3e..20f1b8adc 100644 --- a/src/Nadeko.Bot.Modules.Music/Music.cs +++ b/src/Nadeko.Bot.Modules.Music/Music.cs @@ -1,6 +1,6 @@ #nullable disable using NadekoBot.Modules.Music.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Music; diff --git a/src/Nadeko.Bot.Modules.Music/PlaylistCommands.cs b/src/Nadeko.Bot.Modules.Music/PlaylistCommands.cs index 7f41570d8..20d3704e8 100644 --- a/src/Nadeko.Bot.Modules.Music/PlaylistCommands.cs +++ b/src/Nadeko.Bot.Modules.Music/PlaylistCommands.cs @@ -1,7 +1,7 @@ #nullable disable using NadekoBot.Db; using NadekoBot.Modules.Music.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Music; diff --git a/src/Nadeko.Bot.Modules.Music/Services/IMusicService.cs b/src/Nadeko.Bot.Modules.Music/Services/IMusicService.cs index c591f507a..bcc06050d 100644 --- a/src/Nadeko.Bot.Modules.Music/Services/IMusicService.cs +++ b/src/Nadeko.Bot.Modules.Music/Services/IMusicService.cs @@ -1,4 +1,4 @@ -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.Diagnostics.CodeAnalysis; namespace NadekoBot.Modules.Music.Services; diff --git a/src/Nadeko.Bot.Modules.Music/Services/MusicService.cs b/src/Nadeko.Bot.Modules.Music/Services/MusicService.cs index 968fd635f..5cc16dae7 100644 --- a/src/Nadeko.Bot.Modules.Music/Services/MusicService.cs +++ b/src/Nadeko.Bot.Modules.Music/Services/MusicService.cs @@ -1,5 +1,5 @@ using NadekoBot.Db; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.Diagnostics.CodeAnalysis; namespace NadekoBot.Modules.Music.Services; diff --git a/src/Nadeko.Bot.Modules.Music/_common/IMusicPlayer.cs b/src/Nadeko.Bot.Modules.Music/_common/IMusicPlayer.cs index e460242ff..672771341 100644 --- a/src/Nadeko.Bot.Modules.Music/_common/IMusicPlayer.cs +++ b/src/Nadeko.Bot.Modules.Music/_common/IMusicPlayer.cs @@ -1,4 +1,4 @@ -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Music; diff --git a/src/Nadeko.Bot.Modules.Music/_common/Impl/MusicPlayer.cs b/src/Nadeko.Bot.Modules.Music/_common/Impl/MusicPlayer.cs index 963c90270..4003e947b 100644 --- a/src/Nadeko.Bot.Modules.Music/_common/Impl/MusicPlayer.cs +++ b/src/Nadeko.Bot.Modules.Music/_common/Impl/MusicPlayer.cs @@ -1,5 +1,5 @@ using Ayu.Discord.Voice; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.ComponentModel; using System.Diagnostics; using System.Runtime.CompilerServices; diff --git a/src/Nadeko.Bot.Modules.Music/_common/db/MusicPlayerSettingsExtensions.cs b/src/Nadeko.Bot.Modules.Music/_common/db/MusicPlayerSettingsExtensions.cs index 68047b7e1..427abf17e 100644 --- a/src/Nadeko.Bot.Modules.Music/_common/db/MusicPlayerSettingsExtensions.cs +++ b/src/Nadeko.Bot.Modules.Music/_common/db/MusicPlayerSettingsExtensions.cs @@ -1,6 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db; diff --git a/src/Nadeko.Bot.Modules.Music/_common/db/MusicPlaylist.cs b/src/Nadeko.Bot.Modules.Music/_common/db/MusicPlaylist.cs index bbc0f3e80..d6069dbf0 100644 --- a/src/Nadeko.Bot.Modules.Music/_common/db/MusicPlaylist.cs +++ b/src/Nadeko.Bot.Modules.Music/_common/db/MusicPlaylist.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class MusicPlaylist : DbEntity { diff --git a/src/Nadeko.Bot.Modules.Music/_common/db/MusicPlaylistExtensions.cs b/src/Nadeko.Bot.Modules.Music/_common/db/MusicPlaylistExtensions.cs index 26d1da975..0a5dcd075 100644 --- a/src/Nadeko.Bot.Modules.Music/_common/db/MusicPlaylistExtensions.cs +++ b/src/Nadeko.Bot.Modules.Music/_common/db/MusicPlaylistExtensions.cs @@ -1,6 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db; diff --git a/src/Nadeko.Bot.Modules.Music/_common/db/MusicSettings.cs b/src/Nadeko.Bot.Modules.Music/_common/db/MusicSettings.cs index f43a4aceb..1167e9499 100644 --- a/src/Nadeko.Bot.Modules.Music/_common/db/MusicSettings.cs +++ b/src/Nadeko.Bot.Modules.Music/_common/db/MusicSettings.cs @@ -1,5 +1,5 @@ #nullable disable -namespace NadekoBot.Services.Database.Models; +namespace Nadeko.Bot.Db.Models; public class MusicPlayerSettings { diff --git a/src/Nadeko.Bot.Modules.Patronage/GlobalUsings.cs b/src/Nadeko.Bot.Modules.Patronage/GlobalUsings.cs index f36328bd4..fe71f464d 100644 --- a/src/Nadeko.Bot.Modules.Patronage/GlobalUsings.cs +++ b/src/Nadeko.Bot.Modules.Patronage/GlobalUsings.cs @@ -12,7 +12,6 @@ global using Nadeko.Common; // new project global using NadekoBot.Common; // old + nadekobot specific things global using NadekoBot.Common.Attributes; global using NadekoBot.Extensions; -global using Nadeko.Snake; // discord global using Discord; diff --git a/src/Nadeko.Bot.Modules.Patronage/Patronage/CurrencyRewardService.cs b/src/Nadeko.Bot.Modules.Patronage/Patronage/CurrencyRewardService.cs index 4c4812c38..564343585 100644 --- a/src/Nadeko.Bot.Modules.Patronage/Patronage/CurrencyRewardService.cs +++ b/src/Nadeko.Bot.Modules.Patronage/Patronage/CurrencyRewardService.cs @@ -4,7 +4,7 @@ using LinqToDB.EntityFrameworkCore; using NadekoBot.Modules.Gambling.Services; using NadekoBot.Modules.Patronage; using NadekoBot.Services.Currency; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Utility; diff --git a/src/Nadeko.Bot.Modules.Permisssions/Blacklist/BlacklistCommands.cs b/src/Nadeko.Bot.Modules.Permisssions/Blacklist/BlacklistCommands.cs index 025753b91..42826f9d2 100644 --- a/src/Nadeko.Bot.Modules.Permisssions/Blacklist/BlacklistCommands.cs +++ b/src/Nadeko.Bot.Modules.Permisssions/Blacklist/BlacklistCommands.cs @@ -1,6 +1,6 @@ #nullable disable using NadekoBot.Modules.Permissions.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Permissions; diff --git a/src/Nadeko.Bot.Modules.Permisssions/CommandCooldown/CmdCdsCommands.cs b/src/Nadeko.Bot.Modules.Permisssions/CommandCooldown/CmdCdsCommands.cs index b90c1dbf9..8b51f1d76 100644 --- a/src/Nadeko.Bot.Modules.Permisssions/CommandCooldown/CmdCdsCommands.cs +++ b/src/Nadeko.Bot.Modules.Permisssions/CommandCooldown/CmdCdsCommands.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; using NadekoBot.Common.TypeReaders; using NadekoBot.Db; using NadekoBot.Modules.Permissions.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Permissions; diff --git a/src/Nadeko.Bot.Modules.Permisssions/Filter/FilterCommands.cs b/src/Nadeko.Bot.Modules.Permisssions/Filter/FilterCommands.cs index 82dedd24e..4189a1e2c 100644 --- a/src/Nadeko.Bot.Modules.Permisssions/Filter/FilterCommands.cs +++ b/src/Nadeko.Bot.Modules.Permisssions/Filter/FilterCommands.cs @@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore; using NadekoBot.Db; using NadekoBot.Modules.Permissions.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Permissions; diff --git a/src/Nadeko.Bot.Modules.Permisssions/Filter/FilterService.cs b/src/Nadeko.Bot.Modules.Permisssions/Filter/FilterService.cs index c625c3c58..d65789bbf 100644 --- a/src/Nadeko.Bot.Modules.Permisssions/Filter/FilterService.cs +++ b/src/Nadeko.Bot.Modules.Permisssions/Filter/FilterService.cs @@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Db; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Permissions.Services; diff --git a/src/Nadeko.Bot.Modules.Permisssions/GlobalUsings.cs b/src/Nadeko.Bot.Modules.Permisssions/GlobalUsings.cs index f754e6165..a6363f20f 100644 --- a/src/Nadeko.Bot.Modules.Permisssions/GlobalUsings.cs +++ b/src/Nadeko.Bot.Modules.Permisssions/GlobalUsings.cs @@ -13,7 +13,7 @@ global using Nadeko.Common; // new project global using NadekoBot.Common; // old + nadekobot specific things global using NadekoBot.Common.Attributes; global using NadekoBot.Extensions; -// global using Nadeko.Snake; +// global using Nadeko.Medusa; // discord global using Discord; diff --git a/src/Nadeko.Bot.Modules.Permisssions/PermissionCache.cs b/src/Nadeko.Bot.Modules.Permisssions/PermissionCache.cs index 806146457..f459205e0 100644 --- a/src/Nadeko.Bot.Modules.Permisssions/PermissionCache.cs +++ b/src/Nadeko.Bot.Modules.Permisssions/PermissionCache.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Permissions.Common; diff --git a/src/Nadeko.Bot.Modules.Permisssions/PermissionExtensions.cs b/src/Nadeko.Bot.Modules.Permisssions/PermissionExtensions.cs index e6f96ab17..e23fc436b 100644 --- a/src/Nadeko.Bot.Modules.Permisssions/PermissionExtensions.cs +++ b/src/Nadeko.Bot.Modules.Permisssions/PermissionExtensions.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Permissions.Common; diff --git a/src/Nadeko.Bot.Modules.Permisssions/Permissions.cs b/src/Nadeko.Bot.Modules.Permisssions/Permissions.cs index 988ab4d9e..009fa96ea 100644 --- a/src/Nadeko.Bot.Modules.Permisssions/Permissions.cs +++ b/src/Nadeko.Bot.Modules.Permisssions/Permissions.cs @@ -4,7 +4,7 @@ using NadekoBot.Common.TypeReaders.Models; using NadekoBot.Db; using NadekoBot.Modules.Permissions.Common; using NadekoBot.Modules.Permissions.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Permissions; diff --git a/src/Nadeko.Bot.Modules.Permisssions/PermissionsService.cs b/src/Nadeko.Bot.Modules.Permisssions/PermissionsService.cs index 93fed41eb..866cef774 100644 --- a/src/Nadeko.Bot.Modules.Permisssions/PermissionsService.cs +++ b/src/Nadeko.Bot.Modules.Permisssions/PermissionsService.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Db; using NadekoBot.Modules.Permissions.Common; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Permissions.Services; diff --git a/src/Nadeko.Bot.Modules.Searches/Crypto/DefaultStockDataService.cs b/src/Nadeko.Bot.Modules.Searches/Crypto/DefaultStockDataService.cs index 8e47e104c..717b43caf 100644 --- a/src/Nadeko.Bot.Modules.Searches/Crypto/DefaultStockDataService.cs +++ b/src/Nadeko.Bot.Modules.Searches/Crypto/DefaultStockDataService.cs @@ -6,6 +6,7 @@ using System.Text.Json; namespace NadekoBot.Modules.Searches; +// todo fix stock/crypto public sealed class DefaultStockDataService : IStockDataService, INService { private readonly IHttpClientFactory _httpClientFactory; @@ -82,7 +83,6 @@ public sealed class DefaultStockDataService : IStockDataService, INService PrepareHeaderForMatch = args => args.Header.Humanize(LetterCasing.Title) }; - // todo replace .ToTimestamp() and remove google protobuf dependency // todo this needs testing public async Task> GetCandleDataAsync(string query) { diff --git a/src/Nadeko.Bot.Modules.Searches/Feeds/FeedsService.cs b/src/Nadeko.Bot.Modules.Searches/Feeds/FeedsService.cs index 22c31c10c..76f07e8a6 100644 --- a/src/Nadeko.Bot.Modules.Searches/Feeds/FeedsService.cs +++ b/src/Nadeko.Bot.Modules.Searches/Feeds/FeedsService.cs @@ -5,7 +5,7 @@ using LinqToDB; using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using NadekoBot.Db; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Searches.Services; diff --git a/src/Nadeko.Bot.Modules.Searches/GlobalUsings.cs b/src/Nadeko.Bot.Modules.Searches/GlobalUsings.cs index f754e6165..a6363f20f 100644 --- a/src/Nadeko.Bot.Modules.Searches/GlobalUsings.cs +++ b/src/Nadeko.Bot.Modules.Searches/GlobalUsings.cs @@ -13,7 +13,7 @@ global using Nadeko.Common; // new project global using NadekoBot.Common; // old + nadekobot specific things global using NadekoBot.Common.Attributes; global using NadekoBot.Extensions; -// global using Nadeko.Snake; +// global using Nadeko.Medusa; // discord global using Discord; diff --git a/src/Nadeko.Bot.Modules.Searches/Searches.cs b/src/Nadeko.Bot.Modules.Searches/Searches.cs index 44c5aa0c0..37b086740 100644 --- a/src/Nadeko.Bot.Modules.Searches/Searches.cs +++ b/src/Nadeko.Bot.Modules.Searches/Searches.cs @@ -10,6 +10,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; using System.Diagnostics.CodeAnalysis; using System.Net; +using System.Net.Http.Json; using Color = SixLabors.ImageSharp.Color; namespace NadekoBot.Modules.Searches; @@ -548,9 +549,7 @@ public partial class Searches : NadekoModule try { using var http = _httpFactory.CreateClient(); - var res = await http.GetStringAsync($"https://bible-api.com/{book} {chapterAndVerse}"); - - obj = JsonConvert.DeserializeObject(res); + obj = await http.GetFromJsonAsync($"https://bible-api.com/{book} {chapterAndVerse}"); } catch { diff --git a/src/Nadeko.Bot.Modules.Searches/StreamNotification/StreamNotificationService.cs b/src/Nadeko.Bot.Modules.Searches/StreamNotification/StreamNotificationService.cs index 7503cc52f..1ce0a2a79 100644 --- a/src/Nadeko.Bot.Modules.Searches/StreamNotification/StreamNotificationService.cs +++ b/src/Nadeko.Bot.Modules.Searches/StreamNotification/StreamNotificationService.cs @@ -5,7 +5,7 @@ using NadekoBot.Db; using NadekoBot.Db.Models; using NadekoBot.Modules.Searches.Common; using NadekoBot.Modules.Searches.Common.StreamNotifications; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Searches.Services; diff --git a/src/Nadeko.Bot.Modules.Searches/Translate/TranslateService.cs b/src/Nadeko.Bot.Modules.Searches/Translate/TranslateService.cs index f920b17e0..663031a8d 100644 --- a/src/Nadeko.Bot.Modules.Searches/Translate/TranslateService.cs +++ b/src/Nadeko.Bot.Modules.Searches/Translate/TranslateService.cs @@ -3,7 +3,7 @@ using LinqToDB; using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.Net; namespace NadekoBot.Modules.Searches; diff --git a/src/Nadeko.Bot.Modules.Searches/_common/AtlExtensions.cs b/src/Nadeko.Bot.Modules.Searches/_common/AtlExtensions.cs index ff80b450b..7f10a9c85 100644 --- a/src/Nadeko.Bot.Modules.Searches/_common/AtlExtensions.cs +++ b/src/Nadeko.Bot.Modules.Searches/_common/AtlExtensions.cs @@ -1,7 +1,7 @@ #nullable disable using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Searches; diff --git a/src/Nadeko.Bot.Modules.Searches/_common/BibleVerses.cs b/src/Nadeko.Bot.Modules.Searches/_common/BibleVerses.cs index 3892658b5..5b5509239 100644 --- a/src/Nadeko.Bot.Modules.Searches/_common/BibleVerses.cs +++ b/src/Nadeko.Bot.Modules.Searches/_common/BibleVerses.cs @@ -1,9 +1,9 @@ #nullable disable -using Newtonsoft.Json; + +using System.Text.Json.Serialization; namespace NadekoBot.Modules.Searches.Common; -// todo replace newtonsoft with json.text public class BibleVerses { public string Error { get; set; } @@ -12,7 +12,7 @@ public class BibleVerses public class BibleVerse { - [JsonProperty("book_name")] + [JsonPropertyName("book_name")] public string BookName { get; set; } public int Chapter { get; set; } diff --git a/src/Nadeko.Bot.Modules.Utility/Alias/AliasCommands.cs b/src/Nadeko.Bot.Modules.Utility/Alias/AliasCommands.cs index c66286633..1245d3ff3 100644 --- a/src/Nadeko.Bot.Modules.Utility/Alias/AliasCommands.cs +++ b/src/Nadeko.Bot.Modules.Utility/Alias/AliasCommands.cs @@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore; using NadekoBot.Db; using NadekoBot.Modules.Utility.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Utility; diff --git a/src/Nadeko.Bot.Modules.Utility/Alias/AliasService.cs b/src/Nadeko.Bot.Modules.Utility/Alias/AliasService.cs index e48c6a0c0..7ccfcb45e 100644 --- a/src/Nadeko.Bot.Modules.Utility/Alias/AliasService.cs +++ b/src/Nadeko.Bot.Modules.Utility/Alias/AliasService.cs @@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Db; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Utility.Services; diff --git a/src/Nadeko.Bot.Modules.Utility/GlobalUsings.cs b/src/Nadeko.Bot.Modules.Utility/GlobalUsings.cs index f754e6165..a6363f20f 100644 --- a/src/Nadeko.Bot.Modules.Utility/GlobalUsings.cs +++ b/src/Nadeko.Bot.Modules.Utility/GlobalUsings.cs @@ -13,7 +13,7 @@ global using Nadeko.Common; // new project global using NadekoBot.Common; // old + nadekobot specific things global using NadekoBot.Common.Attributes; global using NadekoBot.Extensions; -// global using Nadeko.Snake; +// global using Nadeko.Medusa; // discord global using Discord; diff --git a/src/Nadeko.Bot.Modules.Utility/Quote/QuoteCommands.cs b/src/Nadeko.Bot.Modules.Utility/Quote/QuoteCommands.cs index b820acaae..fa7893404 100644 --- a/src/Nadeko.Bot.Modules.Utility/Quote/QuoteCommands.cs +++ b/src/Nadeko.Bot.Modules.Utility/Quote/QuoteCommands.cs @@ -1,7 +1,7 @@ #nullable disable warnings using NadekoBot.Common.Yml; using NadekoBot.Db; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using YamlDotNet.Serialization; using YamlDotNet.Serialization.NamingConventions; diff --git a/src/Nadeko.Bot.Modules.Utility/Quote/QuoteService.cs b/src/Nadeko.Bot.Modules.Utility/Quote/QuoteService.cs index 1603d9381..0a38d35a9 100644 --- a/src/Nadeko.Bot.Modules.Utility/Quote/QuoteService.cs +++ b/src/Nadeko.Bot.Modules.Utility/Quote/QuoteService.cs @@ -1,7 +1,7 @@ #nullable disable warnings using LinqToDB; using LinqToDB.EntityFrameworkCore; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Utility; diff --git a/src/Nadeko.Bot.Modules.Utility/Remind/RemindCommands.cs b/src/Nadeko.Bot.Modules.Utility/Remind/RemindCommands.cs index 535f88886..02be487f5 100644 --- a/src/Nadeko.Bot.Modules.Utility/Remind/RemindCommands.cs +++ b/src/Nadeko.Bot.Modules.Utility/Remind/RemindCommands.cs @@ -2,7 +2,7 @@ using Humanizer.Localisation; using NadekoBot.Db; using NadekoBot.Modules.Utility.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Utility; diff --git a/src/Nadeko.Bot.Modules.Utility/Remind/RemindService.cs b/src/Nadeko.Bot.Modules.Utility/Remind/RemindService.cs index 07f7740fe..e82a8a77a 100644 --- a/src/Nadeko.Bot.Modules.Utility/Remind/RemindService.cs +++ b/src/Nadeko.Bot.Modules.Utility/Remind/RemindService.cs @@ -3,7 +3,7 @@ using System.Globalization; using LinqToDB; using LinqToDB.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.Text.RegularExpressions; namespace NadekoBot.Modules.Utility.Services; diff --git a/src/Nadeko.Bot.Modules.Utility/Repeater/RepeaterService.cs b/src/Nadeko.Bot.Modules.Utility/Repeater/RepeaterService.cs index a6f360a49..956be7c91 100644 --- a/src/Nadeko.Bot.Modules.Utility/Repeater/RepeaterService.cs +++ b/src/Nadeko.Bot.Modules.Utility/Repeater/RepeaterService.cs @@ -2,7 +2,7 @@ using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Utility.Services; diff --git a/src/Nadeko.Bot.Modules.Utility/Repeater/RunningRepeater.cs b/src/Nadeko.Bot.Modules.Utility/Repeater/RunningRepeater.cs index 97009da61..21d9a1796 100644 --- a/src/Nadeko.Bot.Modules.Utility/Repeater/RunningRepeater.cs +++ b/src/Nadeko.Bot.Modules.Utility/Repeater/RunningRepeater.cs @@ -1,5 +1,5 @@ #nullable disable -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Utility.Services; diff --git a/src/Nadeko.Bot.Modules.Utility/StreamRole/StreamRoleService.cs b/src/Nadeko.Bot.Modules.Utility/StreamRole/StreamRoleService.cs index fc69021b7..417438d66 100644 --- a/src/Nadeko.Bot.Modules.Utility/StreamRole/StreamRoleService.cs +++ b/src/Nadeko.Bot.Modules.Utility/StreamRole/StreamRoleService.cs @@ -2,7 +2,7 @@ using NadekoBot.Db; using NadekoBot.Modules.Utility.Common; using NadekoBot.Modules.Utility.Common.Exceptions; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using System.Net; namespace NadekoBot.Modules.Utility.Services; diff --git a/src/Nadeko.Bot.Modules.Xp/GlobalUsings.cs b/src/Nadeko.Bot.Modules.Xp/GlobalUsings.cs index f754e6165..a6363f20f 100644 --- a/src/Nadeko.Bot.Modules.Xp/GlobalUsings.cs +++ b/src/Nadeko.Bot.Modules.Xp/GlobalUsings.cs @@ -13,7 +13,7 @@ global using Nadeko.Common; // new project global using NadekoBot.Common; // old + nadekobot specific things global using NadekoBot.Common.Attributes; global using NadekoBot.Extensions; -// global using Nadeko.Snake; +// global using Nadeko.Medusa; // discord global using Discord; diff --git a/src/Nadeko.Bot.Modules.Xp/Xp.cs b/src/Nadeko.Bot.Modules.Xp/Xp.cs index be3e86c34..193adcd52 100644 --- a/src/Nadeko.Bot.Modules.Xp/Xp.cs +++ b/src/Nadeko.Bot.Modules.Xp/Xp.cs @@ -1,6 +1,6 @@ #nullable disable warnings using NadekoBot.Modules.Xp.Services; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using Nadeko.Bot.Common; using NadekoBot.Db; using NadekoBot.Db.Models; diff --git a/src/Nadeko.Bot.Modules.Xp/XpRewards.cs b/src/Nadeko.Bot.Modules.Xp/XpRewards.cs index 2bbc8ba41..fd919be71 100644 --- a/src/Nadeko.Bot.Modules.Xp/XpRewards.cs +++ b/src/Nadeko.Bot.Modules.Xp/XpRewards.cs @@ -126,7 +126,6 @@ public partial class Xp if (level < 1 || amount < 0) return; - // todo, shouldn't all amount + sign be N(amount) _service.SetCurrencyReward(ctx.Guild.Id, level, amount); if (amount == 0) await ReplyConfirmLocalizedAsync(strs.cur_reward_cleared(level, _cp.GetCurrencySign())); diff --git a/src/Nadeko.Bot.Modules.Xp/XpService.cs b/src/Nadeko.Bot.Modules.Xp/XpService.cs index 548c1d592..ea5d08ca4 100644 --- a/src/Nadeko.Bot.Modules.Xp/XpService.cs +++ b/src/Nadeko.Bot.Modules.Xp/XpService.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Db; using NadekoBot.Db.Models; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using Newtonsoft.Json; using SixLabors.Fonts; using SixLabors.ImageSharp; diff --git a/src/Nadeko.Bot.Modules.Xp/_common/FullUserStats.cs b/src/Nadeko.Bot.Modules.Xp/_common/FullUserStats.cs index 0b6901ef4..ac63142d5 100644 --- a/src/Nadeko.Bot.Modules.Xp/_common/FullUserStats.cs +++ b/src/Nadeko.Bot.Modules.Xp/_common/FullUserStats.cs @@ -1,7 +1,7 @@ #nullable disable using NadekoBot.Db; using NadekoBot.Db.Models; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Xp; diff --git a/src/Nadeko.Bot.Modules.Xp/_common/XpCleanupService.cs b/src/Nadeko.Bot.Modules.Xp/_common/XpCleanupService.cs index 642217599..a6a2635c6 100644 --- a/src/Nadeko.Bot.Modules.Xp/_common/XpCleanupService.cs +++ b/src/Nadeko.Bot.Modules.Xp/_common/XpCleanupService.cs @@ -1,6 +1,6 @@ using LinqToDB; using NadekoBot.Db.Models; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Modules.Xp; diff --git a/src/Nadeko.Bot.Modules.Xp/_common/db/XpShopOwnedItem.cs b/src/Nadeko.Bot.Modules.Xp/_common/db/XpShopOwnedItem.cs index 5cc59a680..105d3d821 100644 --- a/src/Nadeko.Bot.Modules.Xp/_common/db/XpShopOwnedItem.cs +++ b/src/Nadeko.Bot.Modules.Xp/_common/db/XpShopOwnedItem.cs @@ -1,5 +1,5 @@ #nullable disable warnings -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; namespace NadekoBot.Db.Models; diff --git a/src/Nadeko.Common/Extensions/ArrayExtensions.cs b/src/Nadeko.Common/Extensions/ArrayExtensions.cs index 5d25ed9cf..3e85ae887 100644 --- a/src/Nadeko.Common/Extensions/ArrayExtensions.cs +++ b/src/Nadeko.Common/Extensions/ArrayExtensions.cs @@ -1,4 +1,6 @@ -namespace Nadeko.Common; +using System.Security.Cryptography; + +namespace Nadeko.Common; // made for expressions because they almost never get added // and they get looped through constantly @@ -48,4 +50,13 @@ public static class ArrayExtensions return toReturn; } + + public static T? RandomOrDefault(this T[] data) + { + if (data.Length == 0) + return default; + + var index = RandomNumberGenerator.GetInt32(0, data.Length); + return data[index]; + } } \ No newline at end of file diff --git a/src/Nadeko.Common/Extensions/EnumerableExtensions.cs b/src/Nadeko.Common/Extensions/EnumerableExtensions.cs index 08e405386..10f5ff369 100644 --- a/src/Nadeko.Common/Extensions/EnumerableExtensions.cs +++ b/src/Nadeko.Common/Extensions/EnumerableExtensions.cs @@ -38,8 +38,6 @@ public static class EnumerableExtensions public static string Join(this IEnumerable data, string separator, Func? func = null) => string.Join(separator, data.Select(func ?? (x => x?.ToString() ?? string.Empty))); - - // todo have 2 different shuffles /// /// Randomize element order by performing the Fisher-Yates shuffle /// @@ -47,21 +45,11 @@ public static class EnumerableExtensions /// Items to shuffle public static IReadOnlyList Shuffle(this IEnumerable items) { - using var provider = RandomNumberGenerator.Create(); - var list = items.ToList(); - var n = list.Count; - while (n > 1) + var list = items.ToArray(); + var n = list.Length; + while (n-- > 1) { - var box = new byte[(n / byte.MaxValue) + 1]; - int boxSum; - do - { - provider.GetBytes(box); - boxSum = box.Sum(b => b); - } while (!(boxSum < n * (byte.MaxValue * box.Length / n))); - - var k = boxSum % n; - n--; + var k = RandomNumberGenerator.GetInt32(n); (list[k], list[n]) = (list[n], list[k]); } diff --git a/src/Nadeko.Common/NadekoRandom.cs b/src/Nadeko.Common/NadekoRandom.cs index da7688824..fa156be00 100644 --- a/src/Nadeko.Common/NadekoRandom.cs +++ b/src/Nadeko.Common/NadekoRandom.cs @@ -3,7 +3,7 @@ using System.Security.Cryptography; namespace Nadeko.Common; -public class NadekoRandom : Random +public sealed class NadekoRandom : Random { private readonly RandomNumberGenerator _rng; @@ -16,27 +16,25 @@ public class NadekoRandom : Random _rng.GetBytes(bytes); return Math.Abs(BitConverter.ToInt32(bytes, 0)); } - + + /// + /// Generates a random integer between 0 (inclusive) and + /// a specified exclusive upper bound using a cryptographically strong random number generator. + /// + /// Exclusive max value + /// A random number public override int Next(int maxValue) - { - if (maxValue <= 0) - throw new ArgumentOutOfRangeException(nameof(maxValue)); - var bytes = new byte[sizeof(int)]; - _rng.GetBytes(bytes); - return Math.Abs(BitConverter.ToInt32(bytes, 0)) % maxValue; - } + => RandomNumberGenerator.GetInt32(maxValue); + /// + /// Generates a random integer between a specified inclusive lower bound and a + /// specified exclusive upper bound using a cryptographically strong random number generator. + /// + /// Inclusive min value + /// Exclusive max value + /// A random number public override int Next(int minValue, int maxValue) - { - if (minValue > maxValue) - throw new ArgumentOutOfRangeException(nameof(maxValue)); - if (minValue == maxValue) - return minValue; - var bytes = new byte[sizeof(int)]; - _rng.GetBytes(bytes); - var sign = Math.Sign(BitConverter.ToInt32(bytes, 0)); - return (sign * BitConverter.ToInt32(bytes, 0) % (maxValue - minValue)) + minValue; - } + => RandomNumberGenerator.GetInt32(minValue, maxValue); public long NextLong(long minValue, long maxValue) { diff --git a/src/NadekoBot.Tests/IndexedCollectionTests.cs b/src/NadekoBot.Tests/IndexedCollectionTests.cs index faa4cc5f1..d04455a17 100644 --- a/src/NadekoBot.Tests/IndexedCollectionTests.cs +++ b/src/NadekoBot.Tests/IndexedCollectionTests.cs @@ -1,5 +1,5 @@ using Nadeko.Common; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; using NUnit.Framework; using System; using System.Collections.Generic; diff --git a/src/NadekoBot/Bot.cs b/src/NadekoBot/Bot.cs index 832d2afc0..de2c5871e 100644 --- a/src/NadekoBot/Bot.cs +++ b/src/NadekoBot/Bot.cs @@ -1,6 +1,7 @@ #nullable disable using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.DependencyInjection; +using Nadeko.Bot.Db; using NadekoBot.Common.Configs; using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Db; @@ -14,8 +15,8 @@ using NadekoBot.Modules.Permissions; using NadekoBot.Modules.Searches; using NadekoBot.Modules.Utility; using NadekoBot.Modules.Xp; -using NadekoBot.Services.Database; -using NadekoBot.Services.Database.Models; + +using Nadeko.Bot.Db.Models; using Ninject; using Ninject.Planning; using System.Collections.Immutable; @@ -34,8 +35,6 @@ public sealed class Bot : IBot private IKernel Services { get; set; } - // todo remove - public string Mention { get; private set; } public bool IsReady { get; private set; } public int ShardId { get; set; } @@ -293,8 +292,7 @@ public sealed class Bot : IBot var sw = Stopwatch.StartNew(); await LoginAsync(_creds.Token); - - Mention = Client.CurrentUser.Mention; + Log.Information("Shard {ShardId} loading services...", Client.ShardId); try { diff --git a/src/NadekoBot/Db/MysqlContext.cs b/src/NadekoBot/Db/MysqlContext.cs index 186324b89..e2489eaf9 100644 --- a/src/NadekoBot/Db/MysqlContext.cs +++ b/src/NadekoBot/Db/MysqlContext.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using NadekoBot.Db.Models; -namespace NadekoBot.Services.Database; +namespace Nadeko.Bot.Db; public sealed class MysqlContext : NadekoContext { diff --git a/src/NadekoBot/Db/NadekoContext.cs b/src/NadekoBot/Db/NadekoContext.cs index c7444bc27..c509ed1df 100644 --- a/src/NadekoBot/Db/NadekoContext.cs +++ b/src/NadekoBot/Db/NadekoContext.cs @@ -2,11 +2,11 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using NadekoBot.Db.Models; -using NadekoBot.Services.Database.Models; +using Nadeko.Bot.Db.Models; // ReSharper disable UnusedAutoPropertyAccessor.Global -namespace NadekoBot.Services.Database; +namespace Nadeko.Bot.Db; public abstract class NadekoContext : DbContext { diff --git a/src/NadekoBot/Db/NadekoDbService.cs b/src/NadekoBot/Db/NadekoDbService.cs index 0671eff07..a9975c769 100644 --- a/src/NadekoBot/Db/NadekoDbService.cs +++ b/src/NadekoBot/Db/NadekoDbService.cs @@ -2,7 +2,7 @@ using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; -namespace NadekoBot.Services.Database; +namespace Nadeko.Bot.Db; public sealed class NadekoDbService : DbService { diff --git a/src/NadekoBot/Db/PostgreSqlContext.cs b/src/NadekoBot/Db/PostgreSqlContext.cs index 08999a178..bc7298c8f 100644 --- a/src/NadekoBot/Db/PostgreSqlContext.cs +++ b/src/NadekoBot/Db/PostgreSqlContext.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -namespace NadekoBot.Services.Database; +namespace Nadeko.Bot.Db; public sealed class PostgreSqlContext : NadekoContext { diff --git a/src/NadekoBot/Db/SqliteContext.cs b/src/NadekoBot/Db/SqliteContext.cs index 3a2d4bf1e..017f85a66 100644 --- a/src/NadekoBot/Db/SqliteContext.cs +++ b/src/NadekoBot/Db/SqliteContext.cs @@ -1,7 +1,7 @@ using Microsoft.Data.Sqlite; using Microsoft.EntityFrameworkCore; -namespace NadekoBot.Services.Database; +namespace Nadeko.Bot.Db; public sealed class SqliteContext : NadekoContext { diff --git a/src/NadekoBot/Medusa/Adapters/ContextAdapterFactory.cs b/src/NadekoBot/Medusa/Adapters/ContextAdapterFactory.cs index 3f3be033c..dcbafe33c 100644 --- a/src/NadekoBot/Medusa/Adapters/ContextAdapterFactory.cs +++ b/src/NadekoBot/Medusa/Adapters/ContextAdapterFactory.cs @@ -1,4 +1,6 @@ -internal class ContextAdapterFactory +using Nadeko.Medusa; + +internal class ContextAdapterFactory { public static AnyContext CreateNew(ICommandContext context, IMedusaStrings strings, IServiceProvider services) => context.Guild is null diff --git a/src/NadekoBot/Medusa/MedusaLoaderService.cs b/src/NadekoBot/Medusa/MedusaLoaderService.cs index f2d5a8a63..6af5d2f43 100644 --- a/src/NadekoBot/Medusa/MedusaLoaderService.cs +++ b/src/NadekoBot/Medusa/MedusaLoaderService.cs @@ -1,5 +1,6 @@ using Discord.Commands.Builders; using Microsoft.Extensions.DependencyInjection; +using Nadeko.Common.Medusa; using Nadeko.Medusa.Adapters; using NadekoBot.Common.ModuleBehaviors; using Ninject; diff --git a/src/NadekoBot/Migrations/Mysql/20221122204432_feed-text.Designer.cs b/src/NadekoBot/Migrations/Mysql/20221122204432_feed-text.Designer.cs index f288b6fc2..f50c586e4 100644 --- a/src/NadekoBot/Migrations/Mysql/20221122204432_feed-text.Designer.cs +++ b/src/NadekoBot/Migrations/Mysql/20221122204432_feed-text.Designer.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NadekoBot.Services.Database; +using Nadeko.Bot.Db; #nullable disable diff --git a/src/NadekoBot/Migrations/Mysql/20230813113816_timely-reminder-type.Designer.cs b/src/NadekoBot/Migrations/Mysql/20230813113816_timely-reminder-type.Designer.cs index d9a3803f5..38dda87a5 100644 --- a/src/NadekoBot/Migrations/Mysql/20230813113816_timely-reminder-type.Designer.cs +++ b/src/NadekoBot/Migrations/Mysql/20230813113816_timely-reminder-type.Designer.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NadekoBot.Services.Database; +using Nadeko.Bot.Db; #nullable disable diff --git a/src/NadekoBot/Migrations/Mysql/20230903153202_clubinfo-name-index.Designer.cs b/src/NadekoBot/Migrations/Mysql/20230903153202_clubinfo-name-index.Designer.cs index 92c0b9e5a..b8793e562 100644 --- a/src/NadekoBot/Migrations/Mysql/20230903153202_clubinfo-name-index.Designer.cs +++ b/src/NadekoBot/Migrations/Mysql/20230903153202_clubinfo-name-index.Designer.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NadekoBot.Services.Database; +using Nadeko.Bot.Db; #nullable disable diff --git a/src/NadekoBot/Migrations/Mysql/MysqlContextModelSnapshot.cs b/src/NadekoBot/Migrations/Mysql/MysqlContextModelSnapshot.cs index f71dce94d..4a678d9f9 100644 --- a/src/NadekoBot/Migrations/Mysql/MysqlContextModelSnapshot.cs +++ b/src/NadekoBot/Migrations/Mysql/MysqlContextModelSnapshot.cs @@ -3,7 +3,7 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NadekoBot.Services.Database; +using Nadeko.Bot.Db; #nullable disable diff --git a/src/NadekoBot/Migrations/Postgresql/20221122204423_feed-text.Designer.cs b/src/NadekoBot/Migrations/Postgresql/20221122204423_feed-text.Designer.cs index 9d34cea0f..5ca6311cb 100644 --- a/src/NadekoBot/Migrations/Postgresql/20221122204423_feed-text.Designer.cs +++ b/src/NadekoBot/Migrations/Postgresql/20221122204423_feed-text.Designer.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NadekoBot.Services.Database; +using Nadeko.Bot.Db; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/NadekoBot/Migrations/Postgresql/20230813113832_timely-reminder-type.Designer.cs b/src/NadekoBot/Migrations/Postgresql/20230813113832_timely-reminder-type.Designer.cs index 0b816295f..d7d413730 100644 --- a/src/NadekoBot/Migrations/Postgresql/20230813113832_timely-reminder-type.Designer.cs +++ b/src/NadekoBot/Migrations/Postgresql/20230813113832_timely-reminder-type.Designer.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NadekoBot.Services.Database; +using Nadeko.Bot.Db; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/NadekoBot/Migrations/Postgresql/20230903154851_clubinfo-name-index.Designer.cs b/src/NadekoBot/Migrations/Postgresql/20230903154851_clubinfo-name-index.Designer.cs index 0ec092456..257296aec 100644 --- a/src/NadekoBot/Migrations/Postgresql/20230903154851_clubinfo-name-index.Designer.cs +++ b/src/NadekoBot/Migrations/Postgresql/20230903154851_clubinfo-name-index.Designer.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NadekoBot.Services.Database; +using Nadeko.Bot.Db; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/NadekoBot/Migrations/Postgresql/PostgreSqlContextModelSnapshot.cs b/src/NadekoBot/Migrations/Postgresql/PostgreSqlContextModelSnapshot.cs index 345a01eab..bce81e99a 100644 --- a/src/NadekoBot/Migrations/Postgresql/PostgreSqlContextModelSnapshot.cs +++ b/src/NadekoBot/Migrations/Postgresql/PostgreSqlContextModelSnapshot.cs @@ -3,7 +3,7 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NadekoBot.Services.Database; +using Nadeko.Bot.Db; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/NadekoBot/Migrations/Sqlite/20221122204324_feed-text.Designer.cs b/src/NadekoBot/Migrations/Sqlite/20221122204324_feed-text.Designer.cs index 1180f65c4..0ce230fcc 100644 --- a/src/NadekoBot/Migrations/Sqlite/20221122204324_feed-text.Designer.cs +++ b/src/NadekoBot/Migrations/Sqlite/20221122204324_feed-text.Designer.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NadekoBot.Services.Database; +using Nadeko.Bot.Db; #nullable disable diff --git a/src/NadekoBot/Migrations/Sqlite/20230813110732_timely-reminder-type.Designer.cs b/src/NadekoBot/Migrations/Sqlite/20230813110732_timely-reminder-type.Designer.cs index b0a5e9f00..735e88637 100644 --- a/src/NadekoBot/Migrations/Sqlite/20230813110732_timely-reminder-type.Designer.cs +++ b/src/NadekoBot/Migrations/Sqlite/20230813110732_timely-reminder-type.Designer.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NadekoBot.Services.Database; +using Nadeko.Bot.Db; #nullable disable diff --git a/src/NadekoBot/Migrations/Sqlite/20230903153230_clubinfo-name-index.Designer.cs b/src/NadekoBot/Migrations/Sqlite/20230903153230_clubinfo-name-index.Designer.cs index dfff99d56..81b03a600 100644 --- a/src/NadekoBot/Migrations/Sqlite/20230903153230_clubinfo-name-index.Designer.cs +++ b/src/NadekoBot/Migrations/Sqlite/20230903153230_clubinfo-name-index.Designer.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NadekoBot.Services.Database; +using Nadeko.Bot.Db; #nullable disable diff --git a/src/NadekoBot/Migrations/Sqlite/SqliteContextModelSnapshot.cs b/src/NadekoBot/Migrations/Sqlite/SqliteContextModelSnapshot.cs index ae7814b0d..cf25477e0 100644 --- a/src/NadekoBot/Migrations/Sqlite/SqliteContextModelSnapshot.cs +++ b/src/NadekoBot/Migrations/Sqlite/SqliteContextModelSnapshot.cs @@ -3,7 +3,7 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NadekoBot.Services.Database; +using Nadeko.Bot.Db; #nullable disable diff --git a/src/NadekoBot/Modules/Gambling/CurrencyProvider.cs b/src/NadekoBot/Modules/Gambling/CurrencyProvider.cs index cff259571..9739e3716 100644 --- a/src/NadekoBot/Modules/Gambling/CurrencyProvider.cs +++ b/src/NadekoBot/Modules/Gambling/CurrencyProvider.cs @@ -3,7 +3,6 @@ using NadekoBot.Modules.Gambling.Services; namespace NadekoBot.Modules.Gambling; -// todo do we need both currencyprovider and currencyservice public sealed class CurrencyProvider : ICurrencyProvider, INService { private readonly GamblingConfigService _cs; diff --git a/src/NadekoBot/Modules/Medusae/Medusa.cs b/src/NadekoBot/Modules/Medusae/Medusa.cs index fc3035407..b0894bdb0 100644 --- a/src/NadekoBot/Modules/Medusae/Medusa.cs +++ b/src/NadekoBot/Modules/Medusae/Medusa.cs @@ -1,4 +1,4 @@ -using Nadeko.Medusa; +using Nadeko.Common.Medusa; namespace NadekoBot.Modules; diff --git a/src/NadekoBot/NadekoBot.csproj b/src/NadekoBot/NadekoBot.csproj index ef3eff33b..d8801158c 100644 --- a/src/NadekoBot/NadekoBot.csproj +++ b/src/NadekoBot/NadekoBot.csproj @@ -130,6 +130,9 @@ Always + + + 5.0.0 diff --git a/src/NadekoBot/PermissionChecker.cs b/src/NadekoBot/PermissionChecker.cs index 9e3612222..e526a936f 100644 --- a/src/NadekoBot/PermissionChecker.cs +++ b/src/NadekoBot/PermissionChecker.cs @@ -11,12 +11,20 @@ public sealed class PermissionChecker : IPermissionChecker, INService private readonly PermissionService _perms; private readonly GlobalPermissionService _gperm; private readonly CmdCdService _cmdCds; + private readonly IEmbedBuilderService _ebs; + private readonly CommandHandler _ch; - public PermissionChecker(PermissionService perms, GlobalPermissionService gperm, CmdCdService cmdCds) + // todo .GetPrefix should be in a different place + public PermissionChecker(PermissionService perms, + GlobalPermissionService gperm, CmdCdService cmdCds, + IEmbedBuilderService ebs, + CommandHandler ch) { _perms = perms; _gperm = gperm; _cmdCds = cmdCds; + _ebs = ebs; + _ch = ch; } public async Task>> CheckAsync( @@ -44,26 +52,29 @@ public sealed class PermissionChecker : IPermissionChecker, INService return new Success(); } + // todo check if this even works if (guild is SocketGuild sg) { var pc = _perms.GetCacheFor(guild.Id); - if (!pc.Permissions.CheckPermissions(author, channel, cmd, "ACTUALEXPRESSIONS", out var index)) + if (!pc.Permissions.CheckPermissions(author, channel, cmd, module, out var index)) { if (pc.Verbose) { // todo fix - // var permissionMessage = strs.perm_prevent(index + 1, - // Format.Bold(pc.Permissions[index].GetCommand(_cmd.GetPrefix(guild), sg))); - // - // try - // { - // await msg.Channel.SendErrorAsync(_eb, permissionMessage); - // } - // catch - // { - // } - // - // Log.Information("{PermissionMessage}", permissionMessage); + var permissionMessage = strs.perm_prevent(index + 1, + Format.Bold(pc.Permissions[index].GetCommand(_ch.GetPrefix(guild), sg))); + + try + { + // await channel.SendErrorAsync(_ebs, + // title: null, + // text: GettextpermissionMessage); + } + catch + { + } + + Log.Information("{PermissionMessage}", permissionMessage); } // todo add proper string