public static string Prepare(this Discord.Commands.ICommandContext Context, string Trivia) { var Text = Trivia; var Settings = Context.GetSettings(); Text = Text.Replace("%MENTION%", Context.User.Mention); Text = Text.Replace("%P%", Settings.Prefix); Text = Text.Replace("%PREFIX%", Settings.Prefix); Text = Text.Replace("%OWNER%", Global.Settings.OwnerName); if (Text.Contains("%LANGUAGES%") || Text.Contains("%LANGS%")) { var LangNames = string.Join(", ", Global.LanguageHandler.Languages.Select(langPair => langPair.Key + " - " + langPair.Value.Name)); Text = Text.Replace("%LANGUAGES%", LangNames); Text = Text.Replace("%LANGS%", LangNames); } return(Text); }
public static Models.Language.Language GetLanguage(this Discord.Commands.ICommandContext Context) { return(Global.LanguageHandler.GetLanguage(Context.GetSettings().LanguageId)); }