Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public static GuildSetting GetSettings(this Discord.Commands.ICommandContext Context)
 {
     return(Global.GuildSettings.GetSettings(Context.Guild != null ? Context.Guild.Id : Context.Message.Author.Id));
 }
Ejemplo n.º 3
0
 public static Models.Language.Language GetLanguage(this Discord.Commands.ICommandContext Context)
 {
     return(Global.LanguageHandler.GetLanguage(Context.GetSettings().LanguageId));
 }