diff --git a/NadekoBot.sln b/NadekoBot.sln index 805b062d0..4bb1b3a29 100644 --- a/NadekoBot.sln +++ b/NadekoBot.sln @@ -41,6 +41,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nadeko.Bot.Db", "src\Nadeko EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nadeko.Bot.Common", "src\Nadeko.Bot.Common\Nadeko.Bot.Common.csproj", "{02ABC10E-3323-4698-A388-C61D7D03797E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nadeko.Bot.Generators.Cloneable", "src\Nadeko.Bot.Generators.Cloneable\Nadeko.Bot.Generators.Cloneable.csproj", "{A5E71EE3-786E-438C-95C0-5BC558FCECCF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -120,6 +122,12 @@ Global {02ABC10E-3323-4698-A388-C61D7D03797E}.GlobalNadeko|Any CPU.Build.0 = Debug|Any CPU {02ABC10E-3323-4698-A388-C61D7D03797E}.Release|Any CPU.ActiveCfg = Release|Any CPU {02ABC10E-3323-4698-A388-C61D7D03797E}.Release|Any CPU.Build.0 = Release|Any CPU + {A5E71EE3-786E-438C-95C0-5BC558FCECCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5E71EE3-786E-438C-95C0-5BC558FCECCF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5E71EE3-786E-438C-95C0-5BC558FCECCF}.GlobalNadeko|Any CPU.ActiveCfg = Debug|Any CPU + {A5E71EE3-786E-438C-95C0-5BC558FCECCF}.GlobalNadeko|Any CPU.Build.0 = Debug|Any CPU + {A5E71EE3-786E-438C-95C0-5BC558FCECCF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5E71EE3-786E-438C-95C0-5BC558FCECCF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -138,6 +146,7 @@ Global {92E239B9-C230-4475-9506-BED20174FD20} = {04929013-5BAB-42B0-B9B2-8F2BB8F16AF2} {02499E3E-3B04-4BC8-9B3C-D9494661F78E} = {04929013-5BAB-42B0-B9B2-8F2BB8F16AF2} {02ABC10E-3323-4698-A388-C61D7D03797E} = {04929013-5BAB-42B0-B9B2-8F2BB8F16AF2} + {A5E71EE3-786E-438C-95C0-5BC558FCECCF} = {04929013-5BAB-42B0-B9B2-8F2BB8F16AF2} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5F3F555C-855F-4BE8-B526-D062D3E8ACA4} diff --git a/src/Nadeko.Bot.Common/Abstractions/creds/IBotCredentials.cs b/src/Nadeko.Bot.Common/Abstractions/creds/IBotCredentials.cs index e833f7128..530bdce02 100644 --- a/src/Nadeko.Bot.Common/Abstractions/creds/IBotCredentials.cs +++ b/src/Nadeko.Bot.Common/Abstractions/creds/IBotCredentials.cs @@ -5,7 +5,7 @@ public interface IBotCredentials { string Token { get; } string GoogleApiKey { get; } - ICollection OwnerIds { get; } + ICollection OwnerIds { get; set; } bool UsePrivilegedIntents { get; } string RapidApiKey { get; } diff --git a/src/Nadeko.Bot.Common/Abstractions/strings/CommandStrings.cs b/src/Nadeko.Bot.Common/Abstractions/strings/CommandStrings.cs new file mode 100644 index 000000000..4da36af9e --- /dev/null +++ b/src/Nadeko.Bot.Common/Abstractions/strings/CommandStrings.cs @@ -0,0 +1,13 @@ +#nullable disable +using YamlDotNet.Serialization; + +namespace NadekoBot.Services; + +public sealed class CommandStrings +{ + [YamlMember(Alias = "desc")] + public string Desc { get; set; } + + [YamlMember(Alias = "args")] + public string[] Args { get; set; } +} \ No newline at end of file diff --git a/src/Nadeko.Bot.Common/Abstractions/strings/IBotStrings.cs b/src/Nadeko.Bot.Common/Abstractions/strings/IBotStrings.cs index 09bc896d7..3720ec642 100644 --- a/src/Nadeko.Bot.Common/Abstractions/strings/IBotStrings.cs +++ b/src/Nadeko.Bot.Common/Abstractions/strings/IBotStrings.cs @@ -12,6 +12,6 @@ public interface IBotStrings string GetText(string key, ulong? guildId = null, params object[] data); string GetText(string key, CultureInfo locale, params object[] data); void Reload(); - ICommandStrings GetCommandStrings(string commandName, ulong? guildId = null); - ICommandStrings GetCommandStrings(string commandName, CultureInfo cultureInfo); + CommandStrings GetCommandStrings(string commandName, ulong? guildId = null); + CommandStrings GetCommandStrings(string commandName, CultureInfo cultureInfo); } \ No newline at end of file diff --git a/src/Nadeko.Bot.Common/Abstractions/strings/IBotStringsProvider.cs b/src/Nadeko.Bot.Common/Abstractions/strings/IBotStringsProvider.cs index 8491071b6..628923ac3 100644 --- a/src/Nadeko.Bot.Common/Abstractions/strings/IBotStringsProvider.cs +++ b/src/Nadeko.Bot.Common/Abstractions/strings/IBotStringsProvider.cs @@ -24,5 +24,5 @@ public interface IBotStringsProvider /// /// Language name /// Command name - ICommandStrings GetCommandStrings(string localeName, string commandName); + CommandStrings GetCommandStrings(string localeName, string commandName); } \ No newline at end of file diff --git a/src/Nadeko.Bot.Common/Abstractions/strings/ICommandStrings.cs b/src/Nadeko.Bot.Common/Abstractions/strings/ICommandStrings.cs deleted file mode 100644 index b092523f9..000000000 --- a/src/Nadeko.Bot.Common/Abstractions/strings/ICommandStrings.cs +++ /dev/null @@ -1,8 +0,0 @@ -#nullable disable -namespace NadekoBot.Services; - -public interface ICommandStrings -{ - string Desc { get; set; } - string[] Args { get; set; } -} \ No newline at end of file diff --git a/src/Nadeko.Bot.Common/Abstractions/strings/IStringsSource.cs b/src/Nadeko.Bot.Common/Abstractions/strings/IStringsSource.cs index 693168661..a801c01ea 100644 --- a/src/Nadeko.Bot.Common/Abstractions/strings/IStringsSource.cs +++ b/src/Nadeko.Bot.Common/Abstractions/strings/IStringsSource.cs @@ -1,4 +1,5 @@ #nullable disable + namespace NadekoBot.Services; /// @@ -12,5 +13,5 @@ public interface IStringsSource /// Dictionary(localename, Dictionary(key, response)) Dictionary> GetResponseStrings(); - Dictionary> GetCommandStrings(); + Dictionary> GetCommandStrings(); } \ No newline at end of file diff --git a/src/Nadeko.Bot.Common/Abstractions/strings/LocStr.cs b/src/Nadeko.Bot.Common/Abstractions/strings/LocStr.cs index 6518265d6..4f1822e87 100644 --- a/src/Nadeko.Bot.Common/Abstractions/strings/LocStr.cs +++ b/src/Nadeko.Bot.Common/Abstractions/strings/LocStr.cs @@ -1,13 +1,13 @@ -namespace NadekoBot.Common; - -public readonly struct LocStr -{ - public readonly string Key; - public readonly object[] Params; - - public LocStr(string key, params object[] data) - { - Key = key; - Params = data; - } -} \ No newline at end of file +// namespace NadekoBot.Common; +// +// public readonly struct LocStr +// { +// public readonly string Key; +// public readonly object[] Params; +// +// public LocStr(string key, params object[] data) +// { +// Key = key; +// Params = data; +// } +// } \ No newline at end of file diff --git a/src/Nadeko.Bot.Common/Configs/BotConfig.cs b/src/Nadeko.Bot.Common/Configs/BotConfig.cs index d9c508428..5df5572c9 100644 --- a/src/Nadeko.Bot.Common/Configs/BotConfig.cs +++ b/src/Nadeko.Bot.Common/Configs/BotConfig.cs @@ -4,7 +4,6 @@ using Cloneable; using NadekoBot.Common.Yml; using SixLabors.ImageSharp.PixelFormats; using System.Globalization; -using Microsoft.EntityFrameworkCore; using YamlDotNet.Core; using YamlDotNet.Serialization; diff --git a/src/NadekoBot/Modules/Administration/Self/DoAsUserMessage.cs b/src/Nadeko.Bot.Common/DoAsUserMessage.cs similarity index 100% rename from src/NadekoBot/Modules/Administration/Self/DoAsUserMessage.cs rename to src/Nadeko.Bot.Common/DoAsUserMessage.cs diff --git a/src/Nadeko.Bot.Common/Extensions/DbExtensions.cs b/src/Nadeko.Bot.Common/Extensions/DbExtensions.cs index 105617667..1731b5157 100644 --- a/src/Nadeko.Bot.Common/Extensions/DbExtensions.cs +++ b/src/Nadeko.Bot.Common/Extensions/DbExtensions.cs @@ -7,6 +7,6 @@ namespace NadekoBot.Extensions; public static class DbExtensions { - public static DiscordUser GetOrCreateUser(this NadekoContext ctx, IUser original, Func, IQueryable> includes = null) + public static DiscordUser GetOrCreateUser(this NadekoContext ctx, IUser original, Func, IQueryable>? includes = null) => ctx.GetOrCreateUser(original.Id, original.Username, original.Discriminator, original.AvatarId, includes); } \ No newline at end of file diff --git a/src/NadekoBot/Common/IPlaceholderProvider.cs b/src/Nadeko.Bot.Common/IPlaceholderProvider.cs similarity index 100% rename from src/NadekoBot/Common/IPlaceholderProvider.cs rename to src/Nadeko.Bot.Common/IPlaceholderProvider.cs diff --git a/src/Nadeko.Bot.Common/Nadeko.Bot.Common.csproj b/src/Nadeko.Bot.Common/Nadeko.Bot.Common.csproj index b1b0144ec..e5ce4812d 100644 --- a/src/Nadeko.Bot.Common/Nadeko.Bot.Common.csproj +++ b/src/Nadeko.Bot.Common/Nadeko.Bot.Common.csproj @@ -4,7 +4,6 @@ net7.0 enable enable - false @@ -25,5 +24,14 @@ True + + + + + + + PreserveNewest + + diff --git a/src/Nadeko.Bot.Common/Replacements/ReplacementBuilder.cs b/src/Nadeko.Bot.Common/Replacements/ReplacementBuilder.cs index 5a68d34a1..9b467bec6 100644 --- a/src/Nadeko.Bot.Common/Replacements/ReplacementBuilder.cs +++ b/src/Nadeko.Bot.Common/Replacements/ReplacementBuilder.cs @@ -1,6 +1,6 @@ #nullable disable -using NadekoBot.Modules.Administration.Services; using System.Text.RegularExpressions; +using NonBlocking; namespace NadekoBot.Common; @@ -59,19 +59,20 @@ public class ReplacementBuilder _reps.TryAdd("%server.members%", () => g is { } sg ? sg.MemberCount.ToString() : "?"); _reps.TryAdd("%server.boosters%", () => g.PremiumSubscriptionCount.ToString()); _reps.TryAdd("%server.boost_level%", () => ((int)g.PremiumTier).ToString()); - _reps.TryAdd("%server.time%", - () => - { - var to = TimeZoneInfo.Local; - if (g is not null) - { - if (GuildTimezoneService.AllServices.TryGetValue(client.CurrentUser.Id, out var tz)) - to = tz.GetTimeZoneOrDefault(g.Id) ?? TimeZoneInfo.Local; - } - - return TimeZoneInfo.ConvertTime(DateTime.UtcNow, TimeZoneInfo.Utc, to).ToString("HH:mm ") - + to.StandardName.GetInitials(); - }); + // todo fix + // _reps.TryAdd("%server.time%", + // () => + // { + // var to = TimeZoneInfo.Local; + // if (g is not null) + // { + // if (GuildTimezoneService.AllServices.TryGetValue(client.CurrentUser.Id, out var tz)) + // to = tz.GetTimeZoneOrDefault(g.Id) ?? TimeZoneInfo.Local; + // } + // + // return TimeZoneInfo.ConvertTime(DateTime.UtcNow, TimeZoneInfo.Utc, to).ToString("HH:mm ") + // + to.StandardName.GetInitials(); + // }); return this; } diff --git a/src/Nadeko.Bot.Common/Services/ICommandHandler.cs b/src/Nadeko.Bot.Common/Services/ICommandHandler.cs index affb45e3e..5a6b893a4 100644 --- a/src/Nadeko.Bot.Common/Services/ICommandHandler.cs +++ b/src/Nadeko.Bot.Common/Services/ICommandHandler.cs @@ -1,6 +1,15 @@ -namespace NadekoBot.Services; +using NadekoBot.Modules.Administration; +using NonBlocking; + +namespace NadekoBot.Services; public interface ICommandHandler { string GetPrefix(IGuild ctxGuild); + string GetPrefix(ulong? id = null); + string SetDefaultPrefix(string toSet); + string SetPrefix(IGuild ctxGuild, string toSet); + ConcurrentDictionary UserMessagesSent { get; } + + Task TryRunCommand(SocketGuild guild, ISocketMessageChannel channel, IUserMessage usrMsg); } \ No newline at end of file diff --git a/src/Nadeko.Bot.Common/Settings/ConfigServiceBase.cs b/src/Nadeko.Bot.Common/Settings/ConfigServiceBase.cs index d26b140c3..2f7fd5d1d 100644 --- a/src/Nadeko.Bot.Common/Settings/ConfigServiceBase.cs +++ b/src/Nadeko.Bot.Common/Settings/ConfigServiceBase.cs @@ -2,7 +2,6 @@ using NadekoBot.Common.Configs; using NadekoBot.Common.Yml; using System.Linq.Expressions; using System.Reflection; -using Microsoft.EntityFrameworkCore; using NadekoBot.Common; namespace NadekoBot.Services; diff --git a/src/Nadeko.Bot.Common/TypeReaders/CommandOrExprInfo.cs b/src/Nadeko.Bot.Common/TypeReaders/CommandOrExprInfo.cs new file mode 100644 index 000000000..2db432312 --- /dev/null +++ b/src/Nadeko.Bot.Common/TypeReaders/CommandOrExprInfo.cs @@ -0,0 +1,23 @@ +#nullable disable +namespace NadekoBot.Common.TypeReaders; + +public class CommandOrExprInfo +{ + public enum Type + { + Normal, + Custom + } + + public string Name { get; set; } + public Type CmdType { get; set; } + + public bool IsCustom + => CmdType == Type.Custom; + + public CommandOrExprInfo(string input, Type type) + { + Name = input; + CmdType = type; + } +} \ No newline at end of file diff --git a/src/NadekoBot/Common/Yml/CommentAttribute.cs b/src/Nadeko.Bot.Common/Yml/CommentAttribute.cs similarity index 100% rename from src/NadekoBot/Common/Yml/CommentAttribute.cs rename to src/Nadeko.Bot.Common/Yml/CommentAttribute.cs diff --git a/src/NadekoBot/Common/Yml/CommentGatheringTypeInspector.cs b/src/Nadeko.Bot.Common/Yml/CommentGatheringTypeInspector.cs similarity index 100% rename from src/NadekoBot/Common/Yml/CommentGatheringTypeInspector.cs rename to src/Nadeko.Bot.Common/Yml/CommentGatheringTypeInspector.cs diff --git a/src/NadekoBot/Common/Yml/CommentsObjectDescriptor.cs b/src/Nadeko.Bot.Common/Yml/CommentsObjectDescriptor.cs similarity index 100% rename from src/NadekoBot/Common/Yml/CommentsObjectDescriptor.cs rename to src/Nadeko.Bot.Common/Yml/CommentsObjectDescriptor.cs diff --git a/src/NadekoBot/Common/Yml/CommentsObjectGraphVisitor.cs b/src/Nadeko.Bot.Common/Yml/CommentsObjectGraphVisitor.cs similarity index 100% rename from src/NadekoBot/Common/Yml/CommentsObjectGraphVisitor.cs rename to src/Nadeko.Bot.Common/Yml/CommentsObjectGraphVisitor.cs diff --git a/src/NadekoBot/Common/Yml/MultilineScalarFlowStyleEmitter.cs b/src/Nadeko.Bot.Common/Yml/MultilineScalarFlowStyleEmitter.cs similarity index 100% rename from src/NadekoBot/Common/Yml/MultilineScalarFlowStyleEmitter.cs rename to src/Nadeko.Bot.Common/Yml/MultilineScalarFlowStyleEmitter.cs diff --git a/src/NadekoBot/Common/Yml/Rgba32Converter.cs b/src/Nadeko.Bot.Common/Yml/Rgba32Converter.cs similarity index 100% rename from src/NadekoBot/Common/Yml/Rgba32Converter.cs rename to src/Nadeko.Bot.Common/Yml/Rgba32Converter.cs diff --git a/src/NadekoBot/Common/Yml/UriConverter.cs b/src/Nadeko.Bot.Common/Yml/UriConverter.cs similarity index 100% rename from src/NadekoBot/Common/Yml/UriConverter.cs rename to src/Nadeko.Bot.Common/Yml/UriConverter.cs diff --git a/src/NadekoBot/Common/Yml/Yaml.cs b/src/Nadeko.Bot.Common/Yml/Yaml.cs similarity index 100% rename from src/NadekoBot/Common/Yml/Yaml.cs rename to src/Nadeko.Bot.Common/Yml/Yaml.cs diff --git a/src/Nadeko.Bot.Common/_Extensions/ReflectionExtensions.cs b/src/Nadeko.Bot.Common/_Extensions/ReflectionExtensions.cs index c85aeec79..39f2c30c6 100644 --- a/src/Nadeko.Bot.Common/_Extensions/ReflectionExtensions.cs +++ b/src/Nadeko.Bot.Common/_Extensions/ReflectionExtensions.cs @@ -15,7 +15,7 @@ public static class ReflectionExtensions if (givenType.IsGenericType && givenType.GetGenericTypeDefinition() == genericType) return true; - Type baseType = givenType.BaseType; + var baseType = givenType.BaseType; if (baseType == null) return false; return IsAssignableToGenericType(baseType, genericType); diff --git a/src/NadekoBot/data/aliases.yml b/src/Nadeko.Bot.Common/data/aliases.yml similarity index 100% rename from src/NadekoBot/data/aliases.yml rename to src/Nadeko.Bot.Common/data/aliases.yml diff --git a/src/NadekoBot/data/bot.yml b/src/Nadeko.Bot.Common/data/bot.yml similarity index 100% rename from src/NadekoBot/data/bot.yml rename to src/Nadeko.Bot.Common/data/bot.yml diff --git a/src/NadekoBot/data/fonts/NotoSans-Bold.ttf b/src/Nadeko.Bot.Common/data/fonts/NotoSans-Bold.ttf similarity index 100% rename from src/NadekoBot/data/fonts/NotoSans-Bold.ttf rename to src/Nadeko.Bot.Common/data/fonts/NotoSans-Bold.ttf diff --git a/src/NadekoBot/data/fonts/Symbola-10.24.ttf b/src/Nadeko.Bot.Common/data/fonts/Symbola-10.24.ttf similarity index 100% rename from src/NadekoBot/data/fonts/Symbola-10.24.ttf rename to src/Nadeko.Bot.Common/data/fonts/Symbola-10.24.ttf diff --git a/src/NadekoBot/data/fonts/Uni Sans.ttf b/src/Nadeko.Bot.Common/data/fonts/Uni Sans.ttf similarity index 100% rename from src/NadekoBot/data/fonts/Uni Sans.ttf rename to src/Nadeko.Bot.Common/data/fonts/Uni Sans.ttf diff --git a/src/NadekoBot/data/fonts/dotty.ttf b/src/Nadeko.Bot.Common/data/fonts/dotty.ttf similarity index 100% rename from src/NadekoBot/data/fonts/dotty.ttf rename to src/Nadeko.Bot.Common/data/fonts/dotty.ttf diff --git a/src/NadekoBot/data/gambling.yml b/src/Nadeko.Bot.Common/data/gambling.yml similarity index 100% rename from src/NadekoBot/data/gambling.yml rename to src/Nadeko.Bot.Common/data/gambling.yml diff --git a/src/NadekoBot/data/games.yml b/src/Nadeko.Bot.Common/data/games.yml similarity index 100% rename from src/NadekoBot/data/games.yml rename to src/Nadeko.Bot.Common/data/games.yml diff --git a/src/NadekoBot/data/hangman/animals.yml b/src/Nadeko.Bot.Common/data/hangman/animals.yml similarity index 100% rename from src/NadekoBot/data/hangman/animals.yml rename to src/Nadeko.Bot.Common/data/hangman/animals.yml diff --git a/src/NadekoBot/data/hangman/anime.yml b/src/Nadeko.Bot.Common/data/hangman/anime.yml similarity index 100% rename from src/NadekoBot/data/hangman/anime.yml rename to src/Nadeko.Bot.Common/data/hangman/anime.yml diff --git a/src/NadekoBot/data/hangman/countries.yml b/src/Nadeko.Bot.Common/data/hangman/countries.yml similarity index 100% rename from src/NadekoBot/data/hangman/countries.yml rename to src/Nadeko.Bot.Common/data/hangman/countries.yml diff --git a/src/NadekoBot/data/hangman/movies.yml b/src/Nadeko.Bot.Common/data/hangman/movies.yml similarity index 100% rename from src/NadekoBot/data/hangman/movies.yml rename to src/Nadeko.Bot.Common/data/hangman/movies.yml diff --git a/src/NadekoBot/data/hangman/things.yml b/src/Nadeko.Bot.Common/data/hangman/things.yml similarity index 100% rename from src/NadekoBot/data/hangman/things.yml rename to src/Nadeko.Bot.Common/data/hangman/things.yml diff --git a/src/NadekoBot/data/images.yml b/src/Nadeko.Bot.Common/data/images.yml similarity index 100% rename from src/NadekoBot/data/images.yml rename to src/Nadeko.Bot.Common/data/images.yml diff --git a/src/NadekoBot/data/images/cards/ace_of_clubs.jpg b/src/Nadeko.Bot.Common/data/images/cards/ace_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/ace_of_clubs.jpg rename to src/Nadeko.Bot.Common/data/images/cards/ace_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/ace_of_diamonds.jpg b/src/Nadeko.Bot.Common/data/images/cards/ace_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/ace_of_diamonds.jpg rename to src/Nadeko.Bot.Common/data/images/cards/ace_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/ace_of_hearts.jpg b/src/Nadeko.Bot.Common/data/images/cards/ace_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/ace_of_hearts.jpg rename to src/Nadeko.Bot.Common/data/images/cards/ace_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/ace_of_spades.jpg b/src/Nadeko.Bot.Common/data/images/cards/ace_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/ace_of_spades.jpg rename to src/Nadeko.Bot.Common/data/images/cards/ace_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/black_joker.jpg b/src/Nadeko.Bot.Common/data/images/cards/black_joker.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/black_joker.jpg rename to src/Nadeko.Bot.Common/data/images/cards/black_joker.jpg diff --git a/src/NadekoBot/data/images/cards/eight_of_clubs.jpg b/src/Nadeko.Bot.Common/data/images/cards/eight_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/eight_of_clubs.jpg rename to src/Nadeko.Bot.Common/data/images/cards/eight_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/eight_of_diamonds.jpg b/src/Nadeko.Bot.Common/data/images/cards/eight_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/eight_of_diamonds.jpg rename to src/Nadeko.Bot.Common/data/images/cards/eight_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/eight_of_hearts.jpg b/src/Nadeko.Bot.Common/data/images/cards/eight_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/eight_of_hearts.jpg rename to src/Nadeko.Bot.Common/data/images/cards/eight_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/eight_of_spades.jpg b/src/Nadeko.Bot.Common/data/images/cards/eight_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/eight_of_spades.jpg rename to src/Nadeko.Bot.Common/data/images/cards/eight_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/five_of_clubs.jpg b/src/Nadeko.Bot.Common/data/images/cards/five_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/five_of_clubs.jpg rename to src/Nadeko.Bot.Common/data/images/cards/five_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/five_of_diamonds.jpg b/src/Nadeko.Bot.Common/data/images/cards/five_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/five_of_diamonds.jpg rename to src/Nadeko.Bot.Common/data/images/cards/five_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/five_of_hearts.jpg b/src/Nadeko.Bot.Common/data/images/cards/five_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/five_of_hearts.jpg rename to src/Nadeko.Bot.Common/data/images/cards/five_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/five_of_spades.jpg b/src/Nadeko.Bot.Common/data/images/cards/five_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/five_of_spades.jpg rename to src/Nadeko.Bot.Common/data/images/cards/five_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/four_of_clubs.jpg b/src/Nadeko.Bot.Common/data/images/cards/four_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/four_of_clubs.jpg rename to src/Nadeko.Bot.Common/data/images/cards/four_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/four_of_diamonds.jpg b/src/Nadeko.Bot.Common/data/images/cards/four_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/four_of_diamonds.jpg rename to src/Nadeko.Bot.Common/data/images/cards/four_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/four_of_hearts.jpg b/src/Nadeko.Bot.Common/data/images/cards/four_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/four_of_hearts.jpg rename to src/Nadeko.Bot.Common/data/images/cards/four_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/four_of_spades.jpg b/src/Nadeko.Bot.Common/data/images/cards/four_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/four_of_spades.jpg rename to src/Nadeko.Bot.Common/data/images/cards/four_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/jack_of_clubs.jpg b/src/Nadeko.Bot.Common/data/images/cards/jack_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/jack_of_clubs.jpg rename to src/Nadeko.Bot.Common/data/images/cards/jack_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/jack_of_diamonds.jpg b/src/Nadeko.Bot.Common/data/images/cards/jack_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/jack_of_diamonds.jpg rename to src/Nadeko.Bot.Common/data/images/cards/jack_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/jack_of_hearts.jpg b/src/Nadeko.Bot.Common/data/images/cards/jack_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/jack_of_hearts.jpg rename to src/Nadeko.Bot.Common/data/images/cards/jack_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/jack_of_spades.jpg b/src/Nadeko.Bot.Common/data/images/cards/jack_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/jack_of_spades.jpg rename to src/Nadeko.Bot.Common/data/images/cards/jack_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/king_of_clubs.jpg b/src/Nadeko.Bot.Common/data/images/cards/king_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/king_of_clubs.jpg rename to src/Nadeko.Bot.Common/data/images/cards/king_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/king_of_diamonds.jpg b/src/Nadeko.Bot.Common/data/images/cards/king_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/king_of_diamonds.jpg rename to src/Nadeko.Bot.Common/data/images/cards/king_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/king_of_hearts.jpg b/src/Nadeko.Bot.Common/data/images/cards/king_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/king_of_hearts.jpg rename to src/Nadeko.Bot.Common/data/images/cards/king_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/king_of_spades.jpg b/src/Nadeko.Bot.Common/data/images/cards/king_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/king_of_spades.jpg rename to src/Nadeko.Bot.Common/data/images/cards/king_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/nine_of_clubs.jpg b/src/Nadeko.Bot.Common/data/images/cards/nine_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/nine_of_clubs.jpg rename to src/Nadeko.Bot.Common/data/images/cards/nine_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/nine_of_diamonds.jpg b/src/Nadeko.Bot.Common/data/images/cards/nine_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/nine_of_diamonds.jpg rename to src/Nadeko.Bot.Common/data/images/cards/nine_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/nine_of_hearts.jpg b/src/Nadeko.Bot.Common/data/images/cards/nine_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/nine_of_hearts.jpg rename to src/Nadeko.Bot.Common/data/images/cards/nine_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/nine_of_spades.jpg b/src/Nadeko.Bot.Common/data/images/cards/nine_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/nine_of_spades.jpg rename to src/Nadeko.Bot.Common/data/images/cards/nine_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/queen_of_clubs.jpg b/src/Nadeko.Bot.Common/data/images/cards/queen_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/queen_of_clubs.jpg rename to src/Nadeko.Bot.Common/data/images/cards/queen_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/queen_of_diamonds.jpg b/src/Nadeko.Bot.Common/data/images/cards/queen_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/queen_of_diamonds.jpg rename to src/Nadeko.Bot.Common/data/images/cards/queen_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/queen_of_hearts.jpg b/src/Nadeko.Bot.Common/data/images/cards/queen_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/queen_of_hearts.jpg rename to src/Nadeko.Bot.Common/data/images/cards/queen_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/queen_of_spades.jpg b/src/Nadeko.Bot.Common/data/images/cards/queen_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/queen_of_spades.jpg rename to src/Nadeko.Bot.Common/data/images/cards/queen_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/red_joker.jpg b/src/Nadeko.Bot.Common/data/images/cards/red_joker.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/red_joker.jpg rename to src/Nadeko.Bot.Common/data/images/cards/red_joker.jpg diff --git a/src/NadekoBot/data/images/cards/seven_of_clubs.jpg b/src/Nadeko.Bot.Common/data/images/cards/seven_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/seven_of_clubs.jpg rename to src/Nadeko.Bot.Common/data/images/cards/seven_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/seven_of_diamonds.jpg b/src/Nadeko.Bot.Common/data/images/cards/seven_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/seven_of_diamonds.jpg rename to src/Nadeko.Bot.Common/data/images/cards/seven_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/seven_of_hearts.jpg b/src/Nadeko.Bot.Common/data/images/cards/seven_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/seven_of_hearts.jpg rename to src/Nadeko.Bot.Common/data/images/cards/seven_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/seven_of_spades.jpg b/src/Nadeko.Bot.Common/data/images/cards/seven_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/seven_of_spades.jpg rename to src/Nadeko.Bot.Common/data/images/cards/seven_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/six_of_clubs.jpg b/src/Nadeko.Bot.Common/data/images/cards/six_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/six_of_clubs.jpg rename to src/Nadeko.Bot.Common/data/images/cards/six_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/six_of_diamonds.jpg b/src/Nadeko.Bot.Common/data/images/cards/six_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/six_of_diamonds.jpg rename to src/Nadeko.Bot.Common/data/images/cards/six_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/six_of_hearts.jpg b/src/Nadeko.Bot.Common/data/images/cards/six_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/six_of_hearts.jpg rename to src/Nadeko.Bot.Common/data/images/cards/six_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/six_of_spades.jpg b/src/Nadeko.Bot.Common/data/images/cards/six_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/six_of_spades.jpg rename to src/Nadeko.Bot.Common/data/images/cards/six_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/ten_of_clubs.jpg b/src/Nadeko.Bot.Common/data/images/cards/ten_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/ten_of_clubs.jpg rename to src/Nadeko.Bot.Common/data/images/cards/ten_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/ten_of_diamonds.jpg b/src/Nadeko.Bot.Common/data/images/cards/ten_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/ten_of_diamonds.jpg rename to src/Nadeko.Bot.Common/data/images/cards/ten_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/ten_of_hearts.jpg b/src/Nadeko.Bot.Common/data/images/cards/ten_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/ten_of_hearts.jpg rename to src/Nadeko.Bot.Common/data/images/cards/ten_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/ten_of_spades.jpg b/src/Nadeko.Bot.Common/data/images/cards/ten_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/ten_of_spades.jpg rename to src/Nadeko.Bot.Common/data/images/cards/ten_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/three_of_clubs.jpg b/src/Nadeko.Bot.Common/data/images/cards/three_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/three_of_clubs.jpg rename to src/Nadeko.Bot.Common/data/images/cards/three_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/three_of_diamonds.jpg b/src/Nadeko.Bot.Common/data/images/cards/three_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/three_of_diamonds.jpg rename to src/Nadeko.Bot.Common/data/images/cards/three_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/three_of_hearts.jpg b/src/Nadeko.Bot.Common/data/images/cards/three_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/three_of_hearts.jpg rename to src/Nadeko.Bot.Common/data/images/cards/three_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/three_of_spades.jpg b/src/Nadeko.Bot.Common/data/images/cards/three_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/three_of_spades.jpg rename to src/Nadeko.Bot.Common/data/images/cards/three_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/two_of_clubs.jpg b/src/Nadeko.Bot.Common/data/images/cards/two_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/two_of_clubs.jpg rename to src/Nadeko.Bot.Common/data/images/cards/two_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/two_of_diamonds.jpg b/src/Nadeko.Bot.Common/data/images/cards/two_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/two_of_diamonds.jpg rename to src/Nadeko.Bot.Common/data/images/cards/two_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/two_of_hearts.jpg b/src/Nadeko.Bot.Common/data/images/cards/two_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/two_of_hearts.jpg rename to src/Nadeko.Bot.Common/data/images/cards/two_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/two_of_spades.jpg b/src/Nadeko.Bot.Common/data/images/cards/two_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/two_of_spades.jpg rename to src/Nadeko.Bot.Common/data/images/cards/two_of_spades.jpg diff --git a/src/NadekoBot/data/images/frame_gold.png b/src/Nadeko.Bot.Common/data/images/frame_gold.png similarity index 100% rename from src/NadekoBot/data/images/frame_gold.png rename to src/Nadeko.Bot.Common/data/images/frame_gold.png diff --git a/src/NadekoBot/data/images/frame_silver.png b/src/Nadeko.Bot.Common/data/images/frame_silver.png similarity index 100% rename from src/NadekoBot/data/images/frame_silver.png rename to src/Nadeko.Bot.Common/data/images/frame_silver.png diff --git a/src/Nadeko.Bot.Common/data/last_known_version.txt b/src/Nadeko.Bot.Common/data/last_known_version.txt new file mode 100644 index 000000000..d18c8f478 --- /dev/null +++ b/src/Nadeko.Bot.Common/data/last_known_version.txt @@ -0,0 +1 @@ +4.3.13 \ No newline at end of file diff --git a/src/NadekoBot/data/lib/libopus.so b/src/Nadeko.Bot.Common/data/lib/libopus.so similarity index 100% rename from src/NadekoBot/data/lib/libopus.so rename to src/Nadeko.Bot.Common/data/lib/libopus.so diff --git a/src/NadekoBot/data/lib/libsodium.dll b/src/Nadeko.Bot.Common/data/lib/libsodium.dll similarity index 100% rename from src/NadekoBot/data/lib/libsodium.dll rename to src/Nadeko.Bot.Common/data/lib/libsodium.dll diff --git a/src/NadekoBot/data/lib/libsodium.so b/src/Nadeko.Bot.Common/data/lib/libsodium.so similarity index 100% rename from src/NadekoBot/data/lib/libsodium.so rename to src/Nadeko.Bot.Common/data/lib/libsodium.so diff --git a/src/NadekoBot/data/lib/opus.dll b/src/Nadeko.Bot.Common/data/lib/opus.dll similarity index 100% rename from src/NadekoBot/data/lib/opus.dll rename to src/Nadeko.Bot.Common/data/lib/opus.dll diff --git a/src/NadekoBot/data/magicitems.json b/src/Nadeko.Bot.Common/data/magicitems.json similarity index 100% rename from src/NadekoBot/data/magicitems.json rename to src/Nadeko.Bot.Common/data/magicitems.json diff --git a/src/Nadeko.Bot.Common/data/medusae/NorthShirahebi/NorthShirahebi.deps.json b/src/Nadeko.Bot.Common/data/medusae/NorthShirahebi/NorthShirahebi.deps.json new file mode 100644 index 000000000..f83b4fdbe --- /dev/null +++ b/src/Nadeko.Bot.Common/data/medusae/NorthShirahebi/NorthShirahebi.deps.json @@ -0,0 +1,115 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v6.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v6.0": { + "NorthShirahebi/1.0.0": { + "dependencies": { + "Nadeko.Medusa": "4.3.10" + }, + "runtime": { + "NorthShirahebi.dll": {} + } + }, + "Discord.Net.Core/3.104.0": { + "dependencies": { + "Newtonsoft.Json": "13.0.1", + "System.Collections.Immutable": "5.0.0", + "System.Interactive.Async": "5.0.0", + "System.ValueTuple": "4.5.0" + } + }, + "Nadeko.Medusa/4.3.10": { + "dependencies": { + "Discord.Net.Core": "3.104.0", + "Serilog": "2.11.0", + "YamlDotNet": "11.2.1" + } + }, + "Newtonsoft.Json/13.0.1": {}, + "Serilog/2.11.0": {}, + "System.Collections.Immutable/5.0.0": {}, + "System.Interactive.Async/5.0.0": { + "dependencies": { + "System.Linq.Async": "5.0.0" + } + }, + "System.Linq.Async/5.0.0": {}, + "System.ValueTuple/4.5.0": {}, + "YamlDotNet/11.2.1": {} + } + }, + "libraries": { + "NorthShirahebi/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Discord.Net.Core/3.104.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kGCH8WA5C39oLGNb/4+r6M038BKnrxNFyjFZ0YPUiNXPki3CGCugMleSvPjUcUaz7UnvOFA9W8JzgN6KQWbuOQ==", + "path": "discord.net.core/3.104.0", + "hashPath": "discord.net.core.3.104.0.nupkg.sha512" + }, + "Nadeko.Medusa/4.3.10": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vwuTD/Gu+6SBU5wG+wnaijcbjkAiYiQK2oTKCiJnP5uqWtLD33pTAoXNkMMu0soQj1hetFVoDUUbMLeg/JLAKg==", + "path": "nadeko.medusa/4.3.10", + "hashPath": "nadeko.medusa.4.3.10.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==", + "path": "newtonsoft.json/13.0.1", + "hashPath": "newtonsoft.json.13.0.1.nupkg.sha512" + }, + "Serilog/2.11.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ysv+hBzTul6Dp+Hvm10FlhJO3yMQcFKSAleus+LpiIzvNstpeV4Z7gGuIZ1OPNfIMulSHOjmLuGAEDKzpnV8ZQ==", + "path": "serilog/2.11.0", + "hashPath": "serilog.2.11.0.nupkg.sha512" + }, + "System.Collections.Immutable/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FXkLXiK0sVVewcso0imKQoOxjoPAj42R8HtjjbSjVPAzwDfzoyoznWxgA3c38LDbN9SJux1xXoXYAhz98j7r2g==", + "path": "system.collections.immutable/5.0.0", + "hashPath": "system.collections.immutable.5.0.0.nupkg.sha512" + }, + "System.Interactive.Async/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QaqhQVDiULcu4vm6o89+iP329HcK44cETHOYgy/jfEjtzeFy0ZxmuM7nel9ocjnKxEM4yh1mli7hgh8Q9o+/Iw==", + "path": "system.interactive.async/5.0.0", + "hashPath": "system.interactive.async.5.0.0.nupkg.sha512" + }, + "System.Linq.Async/5.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-cPtIuuH8TIjVHSi2ewwReWGW1PfChPE0LxPIDlfwVcLuTM9GANFTXiMB7k3aC4sk3f0cQU25LNKzx+jZMxijqw==", + "path": "system.linq.async/5.0.0", + "hashPath": "system.linq.async.5.0.0.nupkg.sha512" + }, + "System.ValueTuple/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ==", + "path": "system.valuetuple/4.5.0", + "hashPath": "system.valuetuple.4.5.0.nupkg.sha512" + }, + "YamlDotNet/11.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tBt8K+korVfrjH9wyDEhiLKxbs8qoLCLIFwvYgkSUuMC9//w3z0cFQ8LQAI/5MCKq+BMil0cfRTRvPeE7eXhQw==", + "path": "yamldotnet/11.2.1", + "hashPath": "yamldotnet.11.2.1.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/src/Nadeko.Bot.Common/data/medusae/NorthShirahebi/NorthShirahebi.dll b/src/Nadeko.Bot.Common/data/medusae/NorthShirahebi/NorthShirahebi.dll new file mode 100644 index 000000000..8eaf4ca0a Binary files /dev/null and b/src/Nadeko.Bot.Common/data/medusae/NorthShirahebi/NorthShirahebi.dll differ diff --git a/src/Nadeko.Bot.Common/data/medusae/NorthShirahebi/NorthShirahebi.runtimeconfig.json b/src/Nadeko.Bot.Common/data/medusae/NorthShirahebi/NorthShirahebi.runtimeconfig.json new file mode 100644 index 000000000..32dca81c1 --- /dev/null +++ b/src/Nadeko.Bot.Common/data/medusae/NorthShirahebi/NorthShirahebi.runtimeconfig.json @@ -0,0 +1,10 @@ +{ + "runtimeOptions": { + "tfm": "net6.0", + "rollForward": "LatestMinor", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "6.0.0" + } + } +} \ No newline at end of file diff --git a/src/Nadeko.Bot.Common/data/medusae/NorthShirahebi/cmds.yml b/src/Nadeko.Bot.Common/data/medusae/NorthShirahebi/cmds.yml new file mode 100644 index 000000000..e682c1dec --- /dev/null +++ b/src/Nadeko.Bot.Common/data/medusae/NorthShirahebi/cmds.yml @@ -0,0 +1,70 @@ +hug: + desc: "Hug a friend!" + args: + - "" + - "@someone" + +kiss: + desc: "K-kiss someone s-special!" + args: + - "" + - "@someone" + +pat: + desc: "A good boy deserves pats." + args: + - "" + - "@someone" + +cuddle: + desc: "Cuddle your lover. ...Or yourself." + args: + - "" + - "@someone" + +wave: + desc: "Greet your friends with a friendly wave." + args: + - "" + - "@someone" + +catgirl: + desc: "Spawn a random catgirl!" + args: + - "" +Rain: + desc: "Spawn a random image with a rainy scenery." + args: + - "" +Weapon: + desc: "Spawn a random image featuring weapon(s)." + args: + - "" +Mountain: + desc: "Spawn a random image with a mountainous scenery." + args: + - "" +Swimmingpool: + desc: "Spawn a random image featuring a swimming pool(?)." + args: + - "" +Sportswear: + desc: "Spawn a random image with one or more characters wearing sportswear." + args: + - "" +Baggyclothes: + desc: "Spawn a random image with one or more characters wearing baggy clothes." + args: + - "" +Dress: + desc: "Spawn a random image with one or more characters wearing a dress" + args: + - "" +Tree: + desc: "Spawn a random image where one or more characters are in a tree." + args: + - "" +Screenshot: + desc: "Spawn image of a screenshot of the original source of the image. (ex. Screenshot of an anime scene)" + args: + - "" diff --git a/src/Nadeko.Bot.Common/data/medusae/NorthShirahebi/res.yml b/src/Nadeko.Bot.Common/data/medusae/NorthShirahebi/res.yml new file mode 100644 index 000000000..b05f47c09 --- /dev/null +++ b/src/Nadeko.Bot.Common/data/medusae/NorthShirahebi/res.yml @@ -0,0 +1 @@ +medusa.description: "Images and interactions module - For interacting with members and showing emotions." \ No newline at end of file diff --git a/src/NadekoBot/data/medusae/medusa.yml b/src/Nadeko.Bot.Common/data/medusae/medusa.yml similarity index 81% rename from src/NadekoBot/data/medusae/medusa.yml rename to src/Nadeko.Bot.Common/data/medusae/medusa.yml index 292b9ec51..feb66c83f 100644 --- a/src/NadekoBot/data/medusae/medusa.yml +++ b/src/Nadeko.Bot.Common/data/medusae/medusa.yml @@ -2,3 +2,4 @@ version: 1 # List of medusae automatically loaded at startup loaded: + - NorthShirahebi diff --git a/src/NadekoBot/data/patron.yml b/src/Nadeko.Bot.Common/data/patron.yml similarity index 100% rename from src/NadekoBot/data/patron.yml rename to src/Nadeko.Bot.Common/data/patron.yml diff --git a/src/NadekoBot/data/pokemon/LICENSE b/src/Nadeko.Bot.Common/data/pokemon/LICENSE similarity index 100% rename from src/NadekoBot/data/pokemon/LICENSE rename to src/Nadeko.Bot.Common/data/pokemon/LICENSE diff --git a/src/NadekoBot/data/pokemon/name-id_map.json b/src/Nadeko.Bot.Common/data/pokemon/name-id_map.json similarity index 100% rename from src/NadekoBot/data/pokemon/name-id_map.json rename to src/Nadeko.Bot.Common/data/pokemon/name-id_map.json diff --git a/src/NadekoBot/data/pokemon/pokemon_abilities.json b/src/Nadeko.Bot.Common/data/pokemon/pokemon_abilities.json similarity index 100% rename from src/NadekoBot/data/pokemon/pokemon_abilities.json rename to src/Nadeko.Bot.Common/data/pokemon/pokemon_abilities.json diff --git a/src/NadekoBot/data/pokemon/pokemon_list.json b/src/Nadeko.Bot.Common/data/pokemon/pokemon_list.json similarity index 100% rename from src/NadekoBot/data/pokemon/pokemon_list.json rename to src/Nadeko.Bot.Common/data/pokemon/pokemon_list.json diff --git a/src/NadekoBot/data/searches.yml b/src/Nadeko.Bot.Common/data/searches.yml similarity index 100% rename from src/NadekoBot/data/searches.yml rename to src/Nadeko.Bot.Common/data/searches.yml diff --git a/src/NadekoBot/data/strings/commands/commands.en-US.yml b/src/Nadeko.Bot.Common/data/strings/commands/commands.en-US.yml similarity index 100% rename from src/NadekoBot/data/strings/commands/commands.en-US.yml rename to src/Nadeko.Bot.Common/data/strings/commands/commands.en-US.yml diff --git a/src/NadekoBot/data/strings/responses/responses.ar.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.ar.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.ar.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.ar.json diff --git a/src/NadekoBot/data/strings/responses/responses.cs-CZ.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.cs-CZ.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.cs-CZ.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.cs-CZ.json diff --git a/src/NadekoBot/data/strings/responses/responses.da-DK.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.da-DK.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.da-DK.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.da-DK.json diff --git a/src/NadekoBot/data/strings/responses/responses.de-DE.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.de-DE.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.de-DE.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.de-DE.json diff --git a/src/NadekoBot/data/strings/responses/responses.en-US.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.en-US.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.en-US.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.en-US.json diff --git a/src/NadekoBot/data/strings/responses/responses.es-ES.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.es-ES.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.es-ES.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.es-ES.json diff --git a/src/NadekoBot/data/strings/responses/responses.fr-FR.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.fr-FR.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.fr-FR.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.fr-FR.json diff --git a/src/NadekoBot/data/strings/responses/responses.he-IL.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.he-IL.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.he-IL.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.he-IL.json diff --git a/src/NadekoBot/data/strings/responses/responses.hu-HU.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.hu-HU.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.hu-HU.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.hu-HU.json diff --git a/src/NadekoBot/data/strings/responses/responses.id-ID.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.id-ID.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.id-ID.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.id-ID.json diff --git a/src/NadekoBot/data/strings/responses/responses.it-IT.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.it-IT.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.it-IT.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.it-IT.json diff --git a/src/NadekoBot/data/strings/responses/responses.ja-JP.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.ja-JP.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.ja-JP.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.ja-JP.json diff --git a/src/NadekoBot/data/strings/responses/responses.ko-KR.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.ko-KR.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.ko-KR.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.ko-KR.json diff --git a/src/NadekoBot/data/strings/responses/responses.nb-NO.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.nb-NO.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.nb-NO.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.nb-NO.json diff --git a/src/NadekoBot/data/strings/responses/responses.nl-NL.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.nl-NL.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.nl-NL.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.nl-NL.json diff --git a/src/NadekoBot/data/strings/responses/responses.pl-PL.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.pl-PL.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.pl-PL.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.pl-PL.json diff --git a/src/NadekoBot/data/strings/responses/responses.pt-BR.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.pt-BR.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.pt-BR.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.pt-BR.json diff --git a/src/NadekoBot/data/strings/responses/responses.ro-RO.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.ro-RO.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.ro-RO.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.ro-RO.json diff --git a/src/NadekoBot/data/strings/responses/responses.ru-RU.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.ru-RU.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.ru-RU.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.ru-RU.json diff --git a/src/NadekoBot/data/strings/responses/responses.sr-cyrl-rs.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.sr-cyrl-rs.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.sr-cyrl-rs.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.sr-cyrl-rs.json diff --git a/src/NadekoBot/data/strings/responses/responses.sv-SE.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.sv-SE.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.sv-SE.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.sv-SE.json diff --git a/src/NadekoBot/data/strings/responses/responses.tr-TR.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.tr-TR.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.tr-TR.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.tr-TR.json diff --git a/src/NadekoBot/data/strings/responses/responses.ts-TS.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.ts-TS.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.ts-TS.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.ts-TS.json diff --git a/src/NadekoBot/data/strings/responses/responses.uk-UA.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.uk-UA.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.uk-UA.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.uk-UA.json diff --git a/src/NadekoBot/data/strings/responses/responses.zh-CN.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.zh-CN.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.zh-CN.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.zh-CN.json diff --git a/src/NadekoBot/data/strings/responses/responses.zh-TW.json b/src/Nadeko.Bot.Common/data/strings/responses/responses.zh-TW.json similarity index 100% rename from src/NadekoBot/data/strings/responses/responses.zh-TW.json rename to src/Nadeko.Bot.Common/data/strings/responses/responses.zh-TW.json diff --git a/src/NadekoBot/data/trivia_questions.json b/src/Nadeko.Bot.Common/data/trivia_questions.json similarity index 100% rename from src/NadekoBot/data/trivia_questions.json rename to src/Nadeko.Bot.Common/data/trivia_questions.json diff --git a/src/NadekoBot/data/typing_articles3.json b/src/Nadeko.Bot.Common/data/typing_articles3.json similarity index 100% rename from src/NadekoBot/data/typing_articles3.json rename to src/Nadeko.Bot.Common/data/typing_articles3.json diff --git a/src/NadekoBot/data/units.json b/src/Nadeko.Bot.Common/data/units.json similarity index 100% rename from src/NadekoBot/data/units.json rename to src/Nadeko.Bot.Common/data/units.json diff --git a/src/NadekoBot/data/urero.json b/src/Nadeko.Bot.Common/data/urero.json similarity index 100% rename from src/NadekoBot/data/urero.json rename to src/Nadeko.Bot.Common/data/urero.json diff --git a/src/NadekoBot/data/wowjokes.json b/src/Nadeko.Bot.Common/data/wowjokes.json similarity index 100% rename from src/NadekoBot/data/wowjokes.json rename to src/Nadeko.Bot.Common/data/wowjokes.json diff --git a/src/NadekoBot/data/xp.yml b/src/Nadeko.Bot.Common/data/xp.yml similarity index 100% rename from src/NadekoBot/data/xp.yml rename to src/Nadeko.Bot.Common/data/xp.yml diff --git a/src/NadekoBot/data/xp_template.json b/src/Nadeko.Bot.Common/data/xp_template.json similarity index 100% rename from src/NadekoBot/data/xp_template.json rename to src/Nadeko.Bot.Common/data/xp_template.json diff --git a/src/NadekoBot/data/yomama.txt b/src/Nadeko.Bot.Common/data/yomama.txt similarity index 100% rename from src/NadekoBot/data/yomama.txt rename to src/Nadeko.Bot.Common/data/yomama.txt diff --git a/src/Nadeko.Bot.Db/Nadeko.Bot.Db.csproj b/src/Nadeko.Bot.Db/Nadeko.Bot.Db.csproj index 6eac7839f..4453a756b 100644 --- a/src/Nadeko.Bot.Db/Nadeko.Bot.Db.csproj +++ b/src/Nadeko.Bot.Db/Nadeko.Bot.Db.csproj @@ -25,12 +25,7 @@ - - - - - diff --git a/src/NadekoBot.Generators/Cloneable/CloneableGenerator.cs b/src/Nadeko.Bot.Generators.Cloneable/CloneableGenerator.cs similarity index 100% rename from src/NadekoBot.Generators/Cloneable/CloneableGenerator.cs rename to src/Nadeko.Bot.Generators.Cloneable/CloneableGenerator.cs diff --git a/src/Nadeko.Bot.Generators.Cloneable/Nadeko.Bot.Generators.Cloneable.csproj b/src/Nadeko.Bot.Generators.Cloneable/Nadeko.Bot.Generators.Cloneable.csproj new file mode 100644 index 000000000..6836c6808 --- /dev/null +++ b/src/Nadeko.Bot.Generators.Cloneable/Nadeko.Bot.Generators.Cloneable.csproj @@ -0,0 +1,9 @@ + + + + net7.0 + enable + enable + + + diff --git a/src/NadekoBot.Generators/Cloneable/SymbolExtensions.cs b/src/Nadeko.Bot.Generators.Cloneable/SymbolExtensions.cs similarity index 100% rename from src/NadekoBot.Generators/Cloneable/SymbolExtensions.cs rename to src/Nadeko.Bot.Generators.Cloneable/SymbolExtensions.cs diff --git a/src/NadekoBot.Generators/Cloneable/SyntaxReceiver.cs b/src/Nadeko.Bot.Generators.Cloneable/SyntaxReceiver.cs similarity index 100% rename from src/NadekoBot.Generators/Cloneable/SyntaxReceiver.cs rename to src/Nadeko.Bot.Generators.Cloneable/SyntaxReceiver.cs diff --git a/src/NadekoBot.Generators/LocalizedStringsGenerator.cs b/src/NadekoBot.Generators/LocalizedStringsGenerator.cs index 4fe5cce09..52d2491bd 100644 --- a/src/NadekoBot.Generators/LocalizedStringsGenerator.cs +++ b/src/NadekoBot.Generators/LocalizedStringsGenerator.cs @@ -26,20 +26,20 @@ namespace NadekoBot.Generators [Generator] public class LocalizedStringsGenerator : ISourceGenerator { -// private const string LOC_STR_SOURCE = @"namespace NadekoBot -// { -// public readonly struct LocStr -// { -// public readonly string Key; -// public readonly object[] Params; -// -// public LocStr(string key, params object[] data) -// { -// Key = key; -// Params = data; -// } -// } -// }"; + private const string LOC_STR_SOURCE = @"namespace NadekoBot +{ + public readonly struct LocStr + { + public readonly string Key; + public readonly object[] Params; + + public LocStr(string key, params object[] data) + { + Key = key; + Params = data; + } + } +}"; public void Initialize(GeneratorInitializationContext context) { @@ -106,7 +106,7 @@ namespace NadekoBot.Generators context.AddSource("strs.g.cs", stringWriter.ToString()); } - // context.AddSource("LocStr.g.cs", LOC_STR_SOURCE); + context.AddSource("LocStr.g.cs", LOC_STR_SOURCE); } private List GetFields(string? dataText) diff --git a/src/NadekoBot.Modules.Expresssions/NadekoBot.Modules.Expresssions.csproj b/src/NadekoBot.Modules.Expresssions/NadekoBot.Modules.Expresssions.csproj index aaa592d84..57e4863e2 100644 --- a/src/NadekoBot.Modules.Expresssions/NadekoBot.Modules.Expresssions.csproj +++ b/src/NadekoBot.Modules.Expresssions/NadekoBot.Modules.Expresssions.csproj @@ -17,4 +17,8 @@ + + + + diff --git a/src/NadekoBot.Modules.Expresssions/NadekoExpressionsService.cs b/src/NadekoBot.Modules.Expresssions/NadekoExpressionsService.cs index 21683c562..f420ff00b 100644 --- a/src/NadekoBot.Modules.Expresssions/NadekoExpressionsService.cs +++ b/src/NadekoBot.Modules.Expresssions/NadekoExpressionsService.cs @@ -9,6 +9,7 @@ using NadekoBot.Services.Database.Models; using System.Runtime.CompilerServices; using LinqToDB.EntityFrameworkCore; using Nadeko.Common; +using NadekoBot.Services; using Serilog; using YamlDotNet.Serialization; using YamlDotNet.Serialization.NamingConventions; diff --git a/src/NadekoBot.Modules.Expresssions/TypeReaders/CommandOrExprTypeReader.cs b/src/NadekoBot.Modules.Expresssions/TypeReaders/CommandOrExprTypeReader.cs new file mode 100644 index 000000000..b22e265a2 --- /dev/null +++ b/src/NadekoBot.Modules.Expresssions/TypeReaders/CommandOrExprTypeReader.cs @@ -0,0 +1,31 @@ +#nullable disable +namespace NadekoBot.Common.TypeReaders; + +public sealed class CommandOrExprTypeReader : NadekoTypeReader +{ + private readonly CommandService _cmds; + private readonly CommandHandler _commandHandler; + private readonly NadekoExpressionsService _exprs; + + public CommandOrExprTypeReader(CommandService cmds, NadekoExpressionsService exprs, CommandHandler commandHandler) + { + _cmds = cmds; + _exprs = exprs; + _commandHandler = commandHandler; + } + + public override async ValueTask> ReadAsync(ICommandContext ctx, string input) + { + if (_exprs.ExpressionExists(ctx.Guild?.Id, input)) + return TypeReaderResult.FromSuccess(new CommandOrExprInfo(input, CommandOrExprInfo.Type.Custom)); + + var cmd = await new CommandTypeReader(_commandHandler, _cmds).ReadAsync(ctx, input); + if (cmd.IsSuccess) + { + return TypeReaderResult.FromSuccess(new CommandOrExprInfo(((CommandInfo)cmd.Values.First().Value).Name, + CommandOrExprInfo.Type.Normal)); + } + + return TypeReaderResult.FromError(CommandError.ParseFailed, "No such command or expression found."); + } +} \ No newline at end of file diff --git a/src/NadekoBot/Common/Medusa/IMedusaLoaderService.cs b/src/NadekoBot/Common/Medusa/IMedusaLoaderService.cs deleted file mode 100644 index 06812a8e1..000000000 --- a/src/NadekoBot/Common/Medusa/IMedusaLoaderService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Globalization; - -namespace Nadeko.Medusa; - -public interface IMedusaLoaderService -{ - Task LoadMedusaAsync(string medusaName); - Task UnloadMedusaAsync(string medusaName); - string GetCommandDescription(string medusaName, string commandName, CultureInfo culture); - string[] GetCommandExampleArgs(string medusaName, string commandName, CultureInfo culture); - Task ReloadStrings(); - IReadOnlyCollection GetAllMedusae(); - IReadOnlyCollection GetLoadedMedusae(CultureInfo? cultureInfo = null); -} - -public sealed record MedusaStats(string Name, - string? Description, - IReadOnlyCollection Sneks); - -public sealed record SnekStats(string Name, - string? Prefix, - IReadOnlyCollection Commands); - -public sealed record SnekCommandStats(string Name); \ No newline at end of file diff --git a/src/NadekoBot/Common/TypeReaders/BotCommandTypeReader.cs b/src/NadekoBot/Common/TypeReaders/BotCommandTypeReader.cs index 00b70c611..9a95ce854 100644 --- a/src/NadekoBot/Common/TypeReaders/BotCommandTypeReader.cs +++ b/src/NadekoBot/Common/TypeReaders/BotCommandTypeReader.cs @@ -1,6 +1,4 @@ #nullable disable -using NadekoBot.Modules.NadekoExpressions; - namespace NadekoBot.Common.TypeReaders; public sealed class CommandTypeReader : NadekoTypeReader @@ -29,54 +27,4 @@ public sealed class CommandTypeReader : NadekoTypeReader return new(TypeReaderResult.FromSuccess(cmd)); } -} - -public sealed class CommandOrExprTypeReader : NadekoTypeReader -{ - private readonly CommandService _cmds; - private readonly CommandHandler _commandHandler; - private readonly NadekoExpressionsService _exprs; - - public CommandOrExprTypeReader(CommandService cmds, NadekoExpressionsService exprs, CommandHandler commandHandler) - { - _cmds = cmds; - _exprs = exprs; - _commandHandler = commandHandler; - } - - public override async ValueTask> ReadAsync(ICommandContext ctx, string input) - { - if (_exprs.ExpressionExists(ctx.Guild?.Id, input)) - return TypeReaderResult.FromSuccess(new CommandOrExprInfo(input, CommandOrExprInfo.Type.Custom)); - - var cmd = await new CommandTypeReader(_commandHandler, _cmds).ReadAsync(ctx, input); - if (cmd.IsSuccess) - { - return TypeReaderResult.FromSuccess(new CommandOrExprInfo(((CommandInfo)cmd.Values.First().Value).Name, - CommandOrExprInfo.Type.Normal)); - } - - return TypeReaderResult.FromError(CommandError.ParseFailed, "No such command or expression found."); - } -} - -public class CommandOrExprInfo -{ - public enum Type - { - Normal, - Custom - } - - public string Name { get; set; } - public Type CmdType { get; set; } - - public bool IsCustom - => CmdType == Type.Custom; - - public CommandOrExprInfo(string input, Type type) - { - Name = input; - CmdType = type; - } } \ No newline at end of file diff --git a/src/NadekoBot/Modules/Administration/PermOverrides/DiscordPermOverrideCommands.cs b/src/NadekoBot/Modules/Administration/PermOverrides/DiscordPermOverrideCommands.cs index ec764550d..122236855 100644 --- a/src/NadekoBot/Modules/Administration/PermOverrides/DiscordPermOverrideCommands.cs +++ b/src/NadekoBot/Modules/Administration/PermOverrides/DiscordPermOverrideCommands.cs @@ -1,5 +1,6 @@ #nullable disable using Nadeko.Common; +using Nadeko.Bot.Db; using NadekoBot.Common.TypeReaders; using NadekoBot.Modules.Administration.Services; diff --git a/src/NadekoBot/Modules/Administration/PermOverrides/DiscordPermOverrideService.cs b/src/NadekoBot/Modules/Administration/PermOverrides/DiscordPermOverrideService.cs index b81ba5d65..e8e7774e5 100644 --- a/src/NadekoBot/Modules/Administration/PermOverrides/DiscordPermOverrideService.cs +++ b/src/NadekoBot/Modules/Administration/PermOverrides/DiscordPermOverrideService.cs @@ -25,7 +25,7 @@ public class DiscordPermOverrideService : INService, IExecPreCommand .ToConcurrent(); } - public bool TryGetOverrides(ulong guildId, string commandName, out GuildPerm? perm) + public bool TryGetOverrides(ulong guildId, string commandName, out Nadeko.Bot.Db.GuildPerm? perm) { commandName = commandName.ToLowerInvariant(); if (_overrides.TryGetValue((guildId, commandName), out var dpo)) @@ -62,12 +62,12 @@ public class DiscordPermOverrideService : INService, IExecPreCommand .Add(over = new() { Command = commandName, - Perm = perm, + Perm = (Nadeko.Bot.Db.GuildPerm)perm, GuildId = guildId }); } else - over.Perm = perm; + over.Perm = (Nadeko.Bot.Db.GuildPerm)perm; _overrides[(guildId, commandName)] = over; diff --git a/src/NadekoBot/Modules/Administration/PlayingRotate/PlayingRotateService.cs b/src/NadekoBot/Modules/Administration/PlayingRotate/PlayingRotateService.cs index 05bcf65f7..2f1fd7cbe 100644 --- a/src/NadekoBot/Modules/Administration/PlayingRotate/PlayingRotateService.cs +++ b/src/NadekoBot/Modules/Administration/PlayingRotate/PlayingRotateService.cs @@ -57,7 +57,7 @@ public sealed class PlayingRotateService : INService, IReadyExecutor : rotatingStatuses[index++]; var statusText = _rep.Replace(playingStatus.Status); - await _selfService.SetGameAsync(statusText, playingStatus.Type); + await _selfService.SetGameAsync(statusText, (ActivityType)playingStatus.Type); } catch (Exception ex) { @@ -82,13 +82,13 @@ public sealed class PlayingRotateService : INService, IReadyExecutor return toRemove.Status; } - public async Task AddPlaying(ActivityType t, string status) + public async Task AddPlaying(ActivityType activityType, string status) { await using var uow = _db.GetDbContext(); var toAdd = new RotatingPlayingStatus { Status = status, - Type = t + Type = (Nadeko.Bot.Db.ActivityType)activityType }; uow.Add(toAdd); await uow.SaveChangesAsync(); diff --git a/src/NadekoBot/Modules/Help/HelpService.cs b/src/NadekoBot/Modules/Help/HelpService.cs index 6c614ad79..bc2076952 100644 --- a/src/NadekoBot/Modules/Help/HelpService.cs +++ b/src/NadekoBot/Modules/Help/HelpService.cs @@ -77,7 +77,7 @@ public class HelpService : IExecNoCommand, INService .AddField(str, $"{com.RealSummary(_strings, _medusae, culture, prefix)}", true); _dpos.TryGetOverrides(guild?.Id ?? 0, com.Name, out var overrides); - var reqs = GetCommandRequirements(com, overrides); + var reqs = GetCommandRequirements(com, (GuildPermission?)overrides); if (reqs.Any()) em.AddField(GetText(strs.requires, guild), string.Join("\n", reqs)); diff --git a/src/NadekoBot/Modules/Searches/StreamNotification/StreamNotificationService.cs b/src/NadekoBot/Modules/Searches/StreamNotification/StreamNotificationService.cs index ed7896e82..8385c0db7 100644 --- a/src/NadekoBot/Modules/Searches/StreamNotification/StreamNotificationService.cs +++ b/src/NadekoBot/Modules/Searches/StreamNotification/StreamNotificationService.cs @@ -4,6 +4,7 @@ using Nadeko.Common; using NadekoBot.Common.ModuleBehaviors; using NadekoBot.Db; using NadekoBot.Db.Models; +using NadekoBot.Modules.Searches._Common; using NadekoBot.Modules.Searches.Common; using NadekoBot.Modules.Searches.Common.StreamNotifications; using NadekoBot.Services.Database.Models; diff --git a/src/NadekoBot/NadekoBot.csproj b/src/NadekoBot/NadekoBot.csproj index 34b9c5dc6..df791c02d 100644 --- a/src/NadekoBot/NadekoBot.csproj +++ b/src/NadekoBot/NadekoBot.csproj @@ -41,7 +41,7 @@ - + @@ -102,15 +102,12 @@ - + + - - - - - + @@ -119,24 +116,12 @@ PreserveNewest - + PreserveNewest Always - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - diff --git a/src/NadekoBot/Services/Impl/Localization.cs b/src/NadekoBot/Services/Impl/Localization.cs index ada2d1c92..6abd65671 100644 --- a/src/NadekoBot/Services/Impl/Localization.cs +++ b/src/NadekoBot/Services/Impl/Localization.cs @@ -11,7 +11,10 @@ public class Localization : ILocalization, INService JsonConvert.DeserializeObject>( File.ReadAllText("./data/strings/commands/commands.en-US.json")); - public ConcurrentDictionary GuildCultureInfos { get; } + private readonly ConcurrentDictionary _guildCultureInfos; + + public IDictionary GuildCultureInfos + => _guildCultureInfos; public CultureInfo DefaultCultureInfo => _bss.Data.DefaultLocale; @@ -26,21 +29,22 @@ public class Localization : ILocalization, INService var cultureInfoNames = bot.AllGuildConfigs.ToDictionary(x => x.GuildId, x => x.Locale); - GuildCultureInfos = new(cultureInfoNames.ToDictionary(x => x.Key, - x => - { - CultureInfo cultureInfo = null; - try - { - if (x.Value is null) - return null; - cultureInfo = new(x.Value); - } - catch { } + _guildCultureInfos = new(cultureInfoNames + .ToDictionary(x => x.Key, + x => + { + CultureInfo cultureInfo = null; + try + { + if (x.Value is null) + return null; + cultureInfo = new(x.Value); + } + catch { } - return cultureInfo; - }) - .Where(x => x.Value is not null)); + return cultureInfo; + }) + .Where(x => x.Value is not null)); } public void SetGuildCulture(IGuild guild, CultureInfo ci) @@ -61,7 +65,7 @@ public class Localization : ILocalization, INService uow.SaveChanges(); } - GuildCultureInfos.AddOrUpdate(guildId, ci, (_, _) => ci); + _guildCultureInfos.AddOrUpdate(guildId, ci, (_, _) => ci); } public void RemoveGuildCulture(IGuild guild) @@ -69,7 +73,7 @@ public class Localization : ILocalization, INService public void RemoveGuildCulture(ulong guildId) { - if (GuildCultureInfos.TryRemove(guildId, out _)) + if (_guildCultureInfos.TryRemove(guildId, out _)) { using var uow = _db.GetDbContext(); var gc = uow.GuildConfigsForId(guildId, set => set); diff --git a/src/NadekoBot/Services/strings/impl/BotStrings.cs b/src/NadekoBot/Services/strings/impl/BotStrings.cs index ef2be4608..5462dac96 100644 --- a/src/NadekoBot/Services/strings/impl/BotStrings.cs +++ b/src/NadekoBot/Services/strings/impl/BotStrings.cs @@ -1,6 +1,5 @@ #nullable disable using System.Globalization; -using YamlDotNet.Serialization; namespace NadekoBot.Services; @@ -80,7 +79,7 @@ public class BotStrings : IBotStrings Log.Warning("'{CommandName}' doesn't exist in 'en-US' command strings. Please report this", commandName); - return new() + return new CommandStrings() { Args = new[] { "" }, Desc = "?" @@ -99,15 +98,4 @@ public class BotStrings : IBotStrings public void Reload() => _stringsProvider.Reload(); -} - - -public sealed class CommandStrings - : ICommandStrings -{ - [YamlMember(Alias = "desc")] - public string Desc { get; set; } - - [YamlMember(Alias = "args")] - public string[] Args { get; set; } } \ No newline at end of file diff --git a/src/NadekoBot/Services/strings/impl/LocalFileStringsSource.cs b/src/NadekoBot/Services/strings/impl/LocalFileStringsSource.cs index a3fb28032..109fc553f 100644 --- a/src/NadekoBot/Services/strings/impl/LocalFileStringsSource.cs +++ b/src/NadekoBot/Services/strings/impl/LocalFileStringsSource.cs @@ -40,11 +40,11 @@ public class LocalFileStringsSource : IStringsSource return outputDict; } - public Dictionary> GetCommandStrings() + public Dictionary> GetCommandStrings() { var deserializer = new DeserializerBuilder().Build(); - var outputDict = new Dictionary>().; + var outputDict = new Dictionary>(); foreach (var file in Directory.GetFiles(_commandsPath)) { try diff --git a/src/NadekoBot/Services/strings/impl/MemoryBotStringsProvider.cs b/src/NadekoBot/Services/strings/impl/MemoryBotStringsProvider.cs index a0865e17e..b75b94cf0 100644 --- a/src/NadekoBot/Services/strings/impl/MemoryBotStringsProvider.cs +++ b/src/NadekoBot/Services/strings/impl/MemoryBotStringsProvider.cs @@ -27,7 +27,7 @@ public class MemoryBotStringsProvider : IBotStringsProvider commandStrings = _source.GetCommandStrings(); } - public ICommandStrings GetCommandStrings(string localeName, string commandName) + public CommandStrings GetCommandStrings(string localeName, string commandName) { if (commandStrings.TryGetValue(localeName, out var langStrings) && langStrings.TryGetValue(commandName, out var strings))