示例#1
0
        private string FormatReplyPost(SearchResults result, string postTitle)
        {
            CrewData[] crew = { _botHelper.GetCrew(result.crew1.symbol), _botHelper.GetCrew(result.crew2.symbol), _botHelper.GetCrew(result.crew3.symbol) };

            if ((crew[0] == null) || (crew[1] == null) || (crew[2] == null))
            {
                return(string.Empty);
            }

            string title;
            var    best = BeholdFormatter.GetBest(result, crew, out title);

            var c1s = CrewFormatter.FormatCrewStats(crew[0], false);
            var c2s = CrewFormatter.FormatCrewStats(crew[1], false);
            var c3s = CrewFormatter.FormatCrewStats(crew[2], false);

            DateTime FutureDate = new DateTime(2020, 3, 1);
            DateTime TodayDate  = DateTime.Now;
            int      days       = (FutureDate - TodayDate).Days;

            if (days <= 0)
            {
                return(string.Empty);
            }

            if (postTitle.StartsWith("Behold", StringComparison.CurrentCultureIgnoreCase) && (postTitle.Split(',').Length > 1))
            {
                // Appears to have correct title format
                Func <int, string> perCrewFormat = index =>
                {
                    var mainRanks = $@"Voyage #{crew[index].ranks.voyRank} | Gauntlet #{crew[index].ranks.gauntletRank}";
                    var statLine  = string.Join(" | ", CrewFormatter.FormatCrewStats(crew[index], true));
                    return($@"# [{crew[index].name}]({_datacoreURL}crew/{crew[index].symbol})

Big Book {(crew[index].bigbook_tier.HasValue ? $"**Tier {crew[index].bigbook_tier.Value}**" : "unranked")} | {mainRanks} | {CrewFormatter.FormatCrewCoolRanks(crew[index], false, " | ")} | {crew[index].collections.Length} collection(s) | {(crew[index].events.HasValue ? $"{crew[index].events.Value} event(s)" : "No events")}

{statLine}

{crew[index].markdownContent}");
                };

                return($@"{title} (but read the [detailed comparison]({_datacoreURL}behold/?crew={crew[0].symbol}&crew={crew[1].symbol}&crew={crew[2].symbol}) to see what makes sense for your roster).

{perCrewFormat(0)}

{perCrewFormat(1)}

{perCrewFormat(2)}

Talk to TemporalAgent7 if you have questions or comments!

**The bot will stop replying in {days} days. Please use [Discord](https://discord.gg/8Du7ZtJ); read [here](https://www.reddit.com/r/StarTrekTimelines/comments/eryf5l/reddit_behold_bot_retiring/) for details.**
");
            }

            return($@"This post appears to be a behold, but it doesn't follow the [subreddit rule](https://www.reddit.com/r/StarTrekTimelines/comments/cgf25y/new_subreddit_rule_regarding_behold_posts/) for Behold posts; your post title should be `Behold! {crew[0].name}, {crew[1].name}, {crew[2].name}`. You can delete it and repost if you want me to reply with details. I'll stop replying in {days} days.");
        }
示例#2
0
 private static string FormatCrewStatsWithEmotes(SocketUserMessage message, CrewData crew, int raritySearch = 0, bool forGauntlet = false)
 {
     return(string.Join(" ", CrewFormatter.FormatCrewStats(crew, true, raritySearch, forGauntlet).Select(s => $"{s.Replace("^", " ")}"))
            .Replace("SCI", GetEmoteOrString(message, "sci", "SCI"))
            .Replace("SEC", GetEmoteOrString(message, "sec", "SEC"))
            .Replace("ENG", GetEmoteOrString(message, "eng", "ENG"))
            .Replace("DIP", GetEmoteOrString(message, "dip", "DIP"))
            .Replace("CMD", GetEmoteOrString(message, "cmd", "CMD"))
            .Replace("MED", GetEmoteOrString(message, "med", "MED")));
 }