Esempio n. 1
0
        public static EmbedBuilder SetPostEmbed(EmbedCollection embedType = EmbedCollection.Default, String title = null, String description = null, EmbedAuthorBuilder author = null, EmbedFooterBuilder footer = null, List <EmbedFieldBuilder> fields = null)
        {
            EmbedBuilder e = GetPostEmbed(embedType);

            if (Exists(title))
            {
                e.WithTitle(title);
            }
            if (Exists(description))
            {
                e.WithDescription(description);
            }
            return(e);
        }
Esempio n. 2
0
        private static EmbedBuilder GetPostEmbed(EmbedCollection embedType)
        {
            var embed  = new EmbedBuilder();
            var colors = GetColorPalette(ColorPaletteCollection.Default);

            switch (embedType)
            {
            case (EmbedCollection.Default):
                embed.WithColor(colors['g']);
                break;

            case (EmbedCollection.Yield):
                embed.WithColor(colors['y']);
                break;

            case (EmbedCollection.Error):
                embed.WithColor(colors['r']);
                break;
            }
            return(embed);
        }
Esempio n. 3
0
        public static Embed SetSPEmbed(String title = null, String description = null, EmbedAuthorBuilder author = null, EmbedFooterBuilder footer = null, List <EmbedFieldBuilder> fields = null, EmbedCollection embedType = EmbedCollection.Default)
        {
            EmbedBuilder e = GetPostEmbed(embedType);

            if (Exists(title))
            {
                e.WithTitle(title);
            }
            if (Exists(description))
            {
                e.WithDescription(description);
            }
            if (ExistsType(author, new EmbedAuthorBuilder()))
            {
                e.WithAuthor(author);
            }
            if (ExistsType(footer, new EmbedFooterBuilder()))
            {
                e.WithFooter(footer);
            }
            if (ExistsType(footer, new EmbedFooterBuilder()))
            {
                foreach (var field in fields)
                {
                    e.AddField(field);
                }
            }
            return(e.Build());
        }