public override Task <Optional <string> > ConvertAsync(string value, CommandContext ctx) { if (LangController.Languages.Keys.Contains(value)) { return(Task.FromResult(new Optional <string>(value))); } foreach (var lang in LangController.Languages.Keys) { var aliases = LangController.Get("lang.aliases", lang).Split("|"); if (aliases.Contains(value)) { return(Task.FromResult(new Optional <string>(lang))); } } return(Task.FromResult(new Optional <string>())); }
public static string Lang(this KuvuGuild kuvuGuild, string term) { var lang = kuvuGuild.Lang; return(LangController.Get(term, lang)); }