Fixed some aliases and reworked namespaces

This commit is contained in:
Kwoth
2024-04-27 16:03:48 +00:00
parent e0819f760c
commit 812b865add
344 changed files with 3166 additions and 3314 deletions

View File

@@ -1,22 +1,10 @@
#nullable disable
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.DependencyInjection;
using Nadeko.Bot.Db;
using NadekoBot.Db;
using NadekoBot.Common.Configs;
using NadekoBot.Common.ModuleBehaviors;
using NadekoBot.Db;
using NadekoBot.Modules.Administration;
using NadekoBot.Modules.Gambling;
using NadekoBot.Modules.Help;
using NadekoBot.Modules.Music;
using NadekoBot.Modules.NadekoExpressions;
using NadekoBot.Modules.Patronage;
using NadekoBot.Modules.Permissions;
using NadekoBot.Modules.Searches;
using NadekoBot.Modules.Utility;
using NadekoBot.Modules.Xp;
using Nadeko.Bot.Db.Models;
using NadekoBot.Db.Models;
using Ninject;
using Ninject.Planning;
using System.Collections.Immutable;
@@ -98,12 +86,6 @@ public sealed class Bot : IBot
_loadedAssemblies = new[]
{
typeof(Bot).Assembly, // bot
typeof(Creds).Assembly, // bot.common
// modules
typeof(NadekoExpressions).Assembly, typeof(Administration).Assembly, typeof(Gambling).Assembly,
typeof(Help).Assembly, typeof(Music).Assembly, typeof(Patronage).Assembly, typeof(Permissions).Assembly,
typeof(Searches).Assembly, typeof(Utility).Assembly, typeof(Xp).Assembly,
};
}
@@ -145,6 +127,7 @@ public sealed class Bot : IBot
svcs.AddSingleton<IConfigSeria, YamlSeria>();
svcs.AddSingleton<IMemoryCache, MemoryCache>(new MemoryCache(new MemoryCacheOptions()));
svcs.AddSingleton<IBehaviorHandler, BehaviorHandler>();
svcs.AddSingleton<ILocalization, Localization>();
foreach (var a in _loadedAssemblies)

View File

@@ -1,7 +1,7 @@
#nullable disable
using LinqToDB.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Nadeko.Bot.Db.Models;
using NadekoBot.Db.Models;
namespace NadekoBot.Db;

View File

@@ -1,6 +1,6 @@
#nullable disable
using Microsoft.EntityFrameworkCore;
using Nadeko.Bot.Db.Models;
using NadekoBot.Db.Models;
namespace NadekoBot.Db;

View File

@@ -2,8 +2,6 @@
using Microsoft.EntityFrameworkCore;
using NadekoBot.Db.Models;
using Nadeko.Bot.Db.Models;
namespace NadekoBot.Db;
public static class GuildConfigExtensions

View File

@@ -1,7 +1,7 @@
#nullable disable
using LinqToDB;
using Microsoft.EntityFrameworkCore;
using Nadeko.Bot.Db.Models;
using NadekoBot.Db.Models;
namespace NadekoBot.Db;

View File

@@ -1,6 +1,6 @@
#nullable disable
using Microsoft.EntityFrameworkCore;
using Nadeko.Bot.Db.Models;
using NadekoBot.Db.Models;
namespace NadekoBot.Db;

View File

@@ -1,6 +1,6 @@
#nullable disable
using Microsoft.EntityFrameworkCore;
using Nadeko.Bot.Db.Models;
using NadekoBot.Db.Models;
namespace NadekoBot.Db;

View File

@@ -1,6 +1,6 @@
#nullable disable
using Microsoft.EntityFrameworkCore;
using Nadeko.Bot.Db.Models;
using NadekoBot.Db.Models;
namespace NadekoBot.Db;

View File

@@ -3,7 +3,7 @@ using LinqToDB;
using LinqToDB.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Nadeko.Bot.Db.Models;
using NadekoBot.Db.Models;
namespace NadekoBot.Db;

View File

@@ -1,6 +1,6 @@
#nullable disable
using Microsoft.EntityFrameworkCore;
using Nadeko.Bot.Db.Models;
using NadekoBot.Db.Models;
namespace NadekoBot.Db;

View File

@@ -1,6 +1,22 @@
namespace Nadeko.Bot.Db;
namespace NadekoBot.Db;
public enum ActivityType
public enum DbActivityType
{
/// <summary>The user is playing a game.</summary>
Playing,
/// <summary>The user is streaming online.</summary>
Streaming,
/// <summary>The user is listening to a song.</summary>
Listening,
/// <summary>The user is watching some form of media.</summary>
Watching,
/// <summary>The user has set a custom status.</summary>
CustomStatus,
/// <summary>The user is competing in a game.</summary>
Competing,
}

View File

@@ -1,4 +1,4 @@
namespace Nadeko.Bot.Db;
namespace NadekoBot.Db;
[Flags]
public enum GuildPerm : ulong

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class AutoCommand : DbEntity
{

View File

@@ -1,5 +1,3 @@
using Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class AutoPublishChannel : DbEntity

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class AutoTranslateChannel : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class AutoTranslateUser : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class BlacklistEntry : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class CommandAlias : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class CommandCooldown : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class CurrencyTransaction : DbEntity
{

View File

@@ -1,7 +1,7 @@
#nullable disable
using System.ComponentModel.DataAnnotations;
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class DelMsgOnCmdChannel : DbEntity
{

View File

@@ -1,7 +1,5 @@
#nullable disable
using Nadeko.Bot.Db;
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class DiscordPermOverride : DbEntity
{

View File

@@ -1,6 +1,4 @@
#nullable disable
using Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class CurrencyEvent
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class FeedSub : DbEntity
{

View File

@@ -1,6 +1,4 @@
#nullable disable
using Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class FollowedStream : DbEntity

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class GCChannelId : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class GamblingStats : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class GroupName : DbEntity
{

View File

@@ -1,7 +1,5 @@
#nullable disable
using NadekoBot.Db.Models;
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class GuildConfig : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class IgnoredLogItem : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class IgnoredVoicePresenceChannel : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class ImageOnlyChannel : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class LogSetting : DbEntity
{

View File

@@ -2,7 +2,7 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics;
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
[DebuggerDisplay("{PrimaryTarget}{SecondaryTarget} {SecondaryTargetName} {State} {PrimaryTargetId}")]
public class Permissionv2 : DbEntity, IIndexed

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class PlantedCurrency : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class PlaylistSong : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class Reminder : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class Repeater
{

View File

@@ -1,10 +1,8 @@
#nullable disable
using Nadeko.Bot.Db;
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class RotatingPlayingStatus : DbEntity
{
public string Status { get; set; }
public ActivityType Type { get; set; }
public DbActivityType Type { get; set; }
}

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public enum ShopEntryType
{

View File

@@ -1,6 +1,4 @@
#nullable disable
using Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class StreamOnlineMessage : DbEntity

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class StreamRoleSettings : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class VcRoleInfo : DbEntity
{

View File

@@ -1,5 +1,4 @@
#nullable disable
using Nadeko.Bot.Db.Models;
using NadekoBot.Db.Models;
namespace NadekoBot.Services.Database.Models;

View File

@@ -1,4 +1,4 @@
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class AntiAltSetting
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class AntiRaidSetting : DbEntity

View File

@@ -1,4 +1,4 @@
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class AntiSpamIgnore : DbEntity
{

View File

@@ -1,4 +1,4 @@
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
#nullable disable
public class AntiSpamSetting : DbEntity

View File

@@ -1,5 +1,4 @@
#nullable disable
using Nadeko.Bot.Db.Models;
using System.ComponentModel.DataAnnotations;
namespace NadekoBot.Db.Models;

View File

@@ -1,6 +1,4 @@
using Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
namespace NadekoBot.Db.Models;
public class BankUser : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class NadekoExpression : DbEntity
{

View File

@@ -1,7 +1,7 @@
#nullable disable
using System.ComponentModel.DataAnnotations;
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class Quote : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class FilterChannelId : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class FilterLinksChannelId : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class FilteredWord : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class BanTemplate : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class MutedUserId : DbEntity
{

View File

@@ -1,4 +1,4 @@
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public enum PunishmentAction
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public enum WarnExpireAction
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class Warning : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class WarningPunishment : DbEntity
{

View File

@@ -1,7 +1,7 @@
#nullable disable
using System.ComponentModel.DataAnnotations;
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class ReactionRoleV2 : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class SelfAssignedRole : DbEntity
{

View File

@@ -1,4 +1,4 @@
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
#nullable disable
public class StickyRole : DbEntity

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class SlowmodeIgnoredRole : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class SlowmodeIgnoredUser : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class RewardedUser : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class UnbanTimer : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class UnmuteTimer : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class UnroleTimer : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class UserXpStats : DbEntity
{

View File

@@ -1,5 +1,5 @@
#nullable disable
namespace Nadeko.Bot.Db.Models;
namespace NadekoBot.Db.Models;
public class XpSettings : DbEntity
{

View File

@@ -1,7 +1,7 @@
using Microsoft.EntityFrameworkCore;
using NadekoBot.Db.Models;
namespace Nadeko.Bot.Db;
namespace NadekoBot.Db;
public sealed class MysqlContext : NadekoContext
{

View File

@@ -2,11 +2,10 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using NadekoBot.Db.Models;
using Nadeko.Bot.Db.Models;
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace Nadeko.Bot.Db;
namespace NadekoBot.Db;
public abstract class NadekoContext : DbContext
{

View File

@@ -2,7 +2,7 @@
using LinqToDB.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
namespace Nadeko.Bot.Db;
namespace NadekoBot.Db;
public sealed class NadekoDbService : DbService
{

View File

@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
namespace Nadeko.Bot.Db;
namespace NadekoBot.Db;
public sealed class PostgreSqlContext : NadekoContext
{

View File

@@ -1,7 +1,7 @@
using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore;
namespace Nadeko.Bot.Db;
namespace NadekoBot.Db;
public sealed class SqliteContext : NadekoContext
{

View File

@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Nadeko.Bot.Db;
using NadekoBot.Db;
#nullable disable

View File

@@ -1,5 +1,4 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable

View File

@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Nadeko.Bot.Db;
using NadekoBot.Db;
#nullable disable

View File

@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Nadeko.Bot.Db;
using NadekoBot.Db;
#nullable disable

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,4 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,4 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,4 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Nadeko.Bot.Db;
using NadekoBot.Db;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable

View File

@@ -1,5 +1,4 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable

View File

@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Nadeko.Bot.Db;
using NadekoBot.Db;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable

View File

@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Nadeko.Bot.Db;
using NadekoBot.Db;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,4 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,4 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable

Some files were not shown because too many files have changed in this diff Show More