mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 17:58:26 -04:00
dev: Renamed some classes, making the new string model work
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user