dev: Renamed some classes, making the new string model work

This commit is contained in:
Kwoth
2024-05-07 22:55:56 +00:00
parent 3e71d9f1ba
commit 577d62a1c1
6 changed files with 31 additions and 9 deletions

View File

@@ -1,3 +1,4 @@
using NadekoBot.Common.Yml;
using YamlDotNet.Serialization;
namespace NadekoBot.Common.Attributes;
@@ -15,6 +16,14 @@ public static class CommandNameLoadHelper
return _deserializer.Deserialize<Dictionary<string, string[]>>(text);
}
public static Dictionary<string, CommandStrings> LoadCommandStrings(
string commandsFilePath = "data/strings/commands.yml")
{
var text = File.ReadAllText(commandsFilePath);
return Yaml.Deserializer.Deserialize<Dictionary<string, CommandStrings>>(text);
}
public static string[] GetAliasesFor(string methodName)
=> _lazyCommandAliases.Value.TryGetValue(methodName.ToLowerInvariant(), out var aliases) && aliases.Length > 1
? aliases.ToArray()