mirror of
				https://gitlab.com/Kwoth/nadekobot.git
				synced 2025-11-04 00:34:26 -05:00 
			
		
		
		
	Namespace changes to make them make sense
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -118,7 +118,7 @@ public class CryptoService : INService
 | 
			
		||||
 | 
			
		||||
        var nearest = cryptos
 | 
			
		||||
                      .Select(elem => (Elem: elem,
 | 
			
		||||
                          Distance: StringExtensions.LevenshteinDistance(elem.Name.ToUpperInvariant(), name)))
 | 
			
		||||
                          Distance: elem.Name.ToUpperInvariant().LevenshteinDistance(name)))
 | 
			
		||||
                      .OrderBy(x => x.Distance)
 | 
			
		||||
                      .FirstOrDefault(x => x.Distance <= 2);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -94,8 +94,7 @@ public sealed class ImagesharpStockChartDrawingService : IStockChartDrawingServi
 | 
			
		||||
        => image.Mutate(ctx =>
 | 
			
		||||
        {
 | 
			
		||||
            foreach (var data in drawData)
 | 
			
		||||
                DrawLineExtensions.DrawLines(ctx,
 | 
			
		||||
                    data.IsGreen
 | 
			
		||||
                ctx.DrawLines(data.IsGreen
 | 
			
		||||
                        ? _greenBrush
 | 
			
		||||
                        : _redBrush,
 | 
			
		||||
                    1,
 | 
			
		||||
@@ -104,8 +103,7 @@ public sealed class ImagesharpStockChartDrawingService : IStockChartDrawingServi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            foreach (var data in drawData)
 | 
			
		||||
                FillRectangleExtensions.Fill(ctx,
 | 
			
		||||
                    data.IsGreen
 | 
			
		||||
                ctx.Fill(data.IsGreen
 | 
			
		||||
                        ? _greenBrush
 | 
			
		||||
                        : _redBrush,
 | 
			
		||||
                    data.BodyRect);
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,7 @@ using Humanizer.Localisation;
 | 
			
		||||
using NadekoBot.Db;
 | 
			
		||||
using NadekoBot.Modules.Utility.Services;
 | 
			
		||||
using NadekoBot.Db.Models;
 | 
			
		||||
using System.Resources;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Modules.Utility;
 | 
			
		||||
 | 
			
		||||
@@ -43,7 +44,7 @@ public partial class Utility
 | 
			
		||||
                await ReplyErrorLocalizedAsync(strs.remind_invalid);
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
            ulong target;
 | 
			
		||||
            target = meorhere == MeOrHere.Me ? ctx.User.Id : ctx.Channel.Id;
 | 
			
		||||
            if (!await RemindInternal(target,
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,6 @@
 | 
			
		||||
        <Nullable>enable</Nullable>
 | 
			
		||||
        <ImplicitUsings>true</ImplicitUsings>
 | 
			
		||||
        <Version>5.0.0</Version>
 | 
			
		||||
        <VersionSuffix>beta1</VersionSuffix>
 | 
			
		||||
 | 
			
		||||
        <!-- Output/build -->
 | 
			
		||||
        <RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
 | 
			
		||||
@@ -76,7 +75,7 @@
 | 
			
		||||
        <PackageReference Include="SixLabors.Shapes" Version="1.0.0-beta0009" />
 | 
			
		||||
        <PackageReference Include="StackExchange.Redis" Version="2.7.33" />
 | 
			
		||||
        <PackageReference Include="YamlDotNet" Version="15.1.2" />
 | 
			
		||||
        <PackageReference Include="SharpToken" Version="1.2.14" />
 | 
			
		||||
        <PackageReference Include="SharpToken" Version="2.0.2" />
 | 
			
		||||
 | 
			
		||||
        <PackageReference Include="Humanizer" Version="2.14.1">
 | 
			
		||||
            <PrivateAssets>all</PrivateAssets>
 | 
			
		||||
@@ -110,9 +109,8 @@
 | 
			
		||||
    </ItemGroup>
 | 
			
		||||
 | 
			
		||||
    <ItemGroup>
 | 
			
		||||
        <ProjectReference Include="..\ayu\NadekoBot.Voice\NadekoBot.Voice.csproj" />
 | 
			
		||||
        <ProjectReference Include="..\Nadeko.Medusa\Nadeko.Medusa.csproj" />
 | 
			
		||||
 | 
			
		||||
        <ProjectReference Include="..\NadekoBot.Voice\NadekoBot.Voice.csproj" />
 | 
			
		||||
        <ProjectReference Include="..\NadekoBot.Generators\NadekoBot.Generators.csproj" OutputItemType="Analyzer" />
 | 
			
		||||
    </ItemGroup>
 | 
			
		||||
    <ItemGroup>
 | 
			
		||||
@@ -133,16 +131,6 @@
 | 
			
		||||
            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
			
		||||
        </None>
 | 
			
		||||
    </ItemGroup>
 | 
			
		||||
    <ItemGroup>
 | 
			
		||||
      <Folder Include="data\medusae\" />
 | 
			
		||||
      <Folder Include="_common\Extensions\" />
 | 
			
		||||
    </ItemGroup>
 | 
			
		||||
 | 
			
		||||
<!--    <PropertyGroup Condition=" '$(Version)' == '' ">-->
 | 
			
		||||
<!--        <VersionPrefix Condition=" '$(VersionPrefix)' == '' ">5.0.0</VersionPrefix>-->
 | 
			
		||||
<!--        <Version Condition=" '$(VersionSuffix)' != '' ">$(VersionPrefix).$(VersionSuffix)</Version>-->
 | 
			
		||||
<!--        <Version Condition=" '$(Version)' == '' ">$(VersionPrefix)</Version>-->
 | 
			
		||||
<!--    </PropertyGroup>-->
 | 
			
		||||
 | 
			
		||||
    <PropertyGroup Condition=" '$(Configuration)' == 'GlobalNadeko' ">
 | 
			
		||||
        <!-- Define trace doesn't seem to affect the build at all so I had to remove $(DefineConstants)-->
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,6 @@
 | 
			
		||||
using Humanizer.Localisation;
 | 
			
		||||
using System.Resources;
 | 
			
		||||
 | 
			
		||||
var pid = Environment.ProcessId;
 | 
			
		||||
 | 
			
		||||
var shardId = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@ public class YamlSeria : IConfigSeria
 | 
			
		||||
            me =>
 | 
			
		||||
            {
 | 
			
		||||
                var str = me.Groups["code"].Value;
 | 
			
		||||
                var newString = YamlHelper.UnescapeUnicodeCodePoint(str);
 | 
			
		||||
                var newString = str.UnescapeUnicodeCodePoint();
 | 
			
		||||
                return newString;
 | 
			
		||||
            });
 | 
			
		||||
        return output;
 | 
			
		||||
 
 | 
			
		||||
@@ -131,7 +131,7 @@ public static class StringExtensions
 | 
			
		||||
            me =>
 | 
			
		||||
            {
 | 
			
		||||
                var str = me.Groups["code"].Value;
 | 
			
		||||
                var newString = YamlHelper.UnescapeUnicodeCodePoint(str);
 | 
			
		||||
                var newString = str.UnescapeUnicodeCodePoint();
 | 
			
		||||
                return newString;
 | 
			
		||||
            });
 | 
			
		||||
}
 | 
			
		||||
@@ -1,6 +1,4 @@
 | 
			
		||||
#nullable enable
 | 
			
		||||
 | 
			
		||||
using Nadeko.Snake;
 | 
			
		||||
using NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
[DIIgnore]
 | 
			
		||||
public sealed class BehaviorAdapter : ICustomBehavior
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
using Nadeko.Snake;
 | 
			
		||||
using NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
internal class ContextAdapterFactory
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
using Microsoft.Extensions.DependencyInjection;
 | 
			
		||||
using Nadeko.Snake;
 | 
			
		||||
using NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
public sealed class DmContextAdapter : DmContext
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
using Nadeko.Snake;
 | 
			
		||||
using NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
namespace Nadeko.Medusa.Adapters;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
using Microsoft.Extensions.DependencyInjection;
 | 
			
		||||
using Nadeko.Snake;
 | 
			
		||||
using NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
public sealed class GuildContextAdapter : GuildContext
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
using Nadeko.Snake;
 | 
			
		||||
using NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
public sealed class ParamParserAdapter<T> : TypeReader
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
namespace Nadeko.Medusa;
 | 
			
		||||
namespace NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
/// Enum specifying in which context the command can be executed
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
namespace Nadeko.Medusa;
 | 
			
		||||
namespace NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
public interface IMedusaConfigService
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
using Cloneable;
 | 
			
		||||
using NadekoBot.Common.Yml;
 | 
			
		||||
 | 
			
		||||
namespace Nadeko.Medusa;
 | 
			
		||||
namespace NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
[Cloneable]
 | 
			
		||||
public sealed partial class MedusaConfig : ICloneable<MedusaConfig>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
using NadekoBot.Common.Configs;
 | 
			
		||||
 | 
			
		||||
namespace Nadeko.Medusa;
 | 
			
		||||
namespace NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
public sealed class MedusaConfigService : ConfigServiceBase<MedusaConfig>, IMedusaConfigService
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
using System.Reflection;
 | 
			
		||||
using System.Runtime.Loader;
 | 
			
		||||
 | 
			
		||||
namespace Nadeko.Medusa;
 | 
			
		||||
namespace NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
public class MedusaAssemblyLoadContext : AssemblyLoadContext
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
using Nadeko.Snake;
 | 
			
		||||
using System.Reflection;
 | 
			
		||||
using System.Reflection;
 | 
			
		||||
using Ninject;
 | 
			
		||||
using Ninject.Activation;
 | 
			
		||||
using Ninject.Activation.Caching;
 | 
			
		||||
@@ -7,7 +6,7 @@ using Ninject.Modules;
 | 
			
		||||
using Ninject.Planning;
 | 
			
		||||
using System.Text.Json;
 | 
			
		||||
 | 
			
		||||
namespace Nadeko.Medusa;
 | 
			
		||||
namespace NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
public sealed class MedusaNinjectModule : NinjectModule
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -10,9 +10,8 @@ using System.Diagnostics.CodeAnalysis;
 | 
			
		||||
using System.Globalization;
 | 
			
		||||
using System.Reflection;
 | 
			
		||||
using System.Runtime.CompilerServices;
 | 
			
		||||
using Nadeko.Snake;
 | 
			
		||||
 | 
			
		||||
namespace Nadeko.Medusa;
 | 
			
		||||
namespace NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
// ReSharper disable RedundantAssignment
 | 
			
		||||
public sealed class MedusaLoaderService : IMedusaLoaderService, IReadyExecutor, INService
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
namespace Nadeko.Medusa;
 | 
			
		||||
namespace NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
public sealed record ParamData(
 | 
			
		||||
    Type Type,
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
using Nadeko.Snake;
 | 
			
		||||
using NadekoBot.Medusa;
 | 
			
		||||
using Ninject.Modules;
 | 
			
		||||
using System.Collections.Immutable;
 | 
			
		||||
 | 
			
		||||
namespace Nadeko.Medusa;
 | 
			
		||||
namespace NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
public sealed record ResolvedMedusa(
 | 
			
		||||
    WeakReference<MedusaAssemblyLoadContext> LoadContext,
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,7 @@
 | 
			
		||||
using Nadeko.Snake;
 | 
			
		||||
using NadekoBot.Medusa;
 | 
			
		||||
using System.Reflection;
 | 
			
		||||
using CommandStrings = Nadeko.Snake.CommandStrings;
 | 
			
		||||
 | 
			
		||||
namespace Nadeko.Medusa;
 | 
			
		||||
namespace NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
public sealed class SnekCommandData
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,4 @@
 | 
			
		||||
using Nadeko.Snake;
 | 
			
		||||
 | 
			
		||||
namespace Nadeko.Medusa;
 | 
			
		||||
namespace NadekoBot.Medusa;
 | 
			
		||||
 | 
			
		||||
public sealed record SnekInfo(
 | 
			
		||||
    string Name,
 | 
			
		||||
 
 | 
			
		||||
@@ -86,7 +86,7 @@ public abstract class NadekoModule : ModuleBase
 | 
			
		||||
        embed.WithPendingColor()
 | 
			
		||||
            .WithFooter("yes/no");
 | 
			
		||||
 | 
			
		||||
        var msg = await MessageChannelExtensions.EmbedAsync(ctx.Channel, embed);
 | 
			
		||||
        var msg = await ctx.Channel.EmbedAsync(embed);
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            var input = await GetUserInputAsync(ctx.User.Id, ctx.Channel.Id);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user