Beispiel #1
0
        private EmbedBuilder BuildSuggestionsEmbed(List <List <TagData> > pages)
        {
            EmbedBuilder embed = null;

            if (pages.Count > 0)
            {
                List <EmbedFieldBuilder> fields      = new List <EmbedFieldBuilder>();
                List <string>            pageContent = TagParser.ToTagInfoList(pages[0]);
                int i = 1;

                foreach (string s in pageContent)
                {
                    fields.Add(new EmbedFieldBuilder()
                               .WithName($"{i}.")
                               .WithValue(s)
                               .WithIsInline(IsInline));

                    i++;
                }

                embed = new EmbedBuilder()
                        .WithTitle(SuggestionTitle)
                        .WithFields(fields)
                        .WithDescription(suggestionDescription)
                        .WithFooter($"Page 1 of {pages.Count}");
            }

            return(embed);
        }
Beispiel #2
0
        private EmbedBuilder UpdatePage(PageData pageData, string embedTitle)
        {
            List <EmbedFieldBuilder> fields      = new List <EmbedFieldBuilder>();
            List <string>            pageContent = TagParser.ToTagInfoList(pageData.Pages[pageData.PageNum]);
            int i = pageData.PageNum * EmbedBuilder.MaxFieldCount + 1;

            foreach (string s in pageContent)
            {
                fields.Add(new EmbedFieldBuilder()
                           .WithName($"{i}.")
                           .WithValue(s)
                           .WithIsInline(IsInline));

                i++;
            }

            return(new EmbedBuilder()
                   .WithTitle(embedTitle)
                   .WithFields(fields)
                   .WithDescription(suggestionDescription)
                   .WithFooter($"Page {pageData.PageNum + 1} of {pageData.Pages.Count}"));
        }