public static DiscordEmbedBuilder AsEmbed(this PrInfo prInfo) { var state = prInfo.GetState(); var stateLabel = state.state == null ? null : $"[{state.state}] "; var title = $"{stateLabel}PR #{prInfo.Number} by {prInfo.User?.Login ?? "???"}"; return(new DiscordEmbedBuilder { Title = title, Url = prInfo.HtmlUrl, Description = prInfo.Title, Color = state.color }); }
public static DiscordEmbedBuilder AsEmbed(this PrInfo prInfo) { (string, DiscordColor)state = prInfo.GetState(); var stateLabel = state.Item1 == null ? null : $"[{state.Item1}] "; var pr = $"{stateLabel}PR #{prInfo.Number} by {prInfo.User?.Login ?? "???"}"; return(new DiscordEmbedBuilder { Title = pr, Url = prInfo.HtmlUrl, Description = prInfo.Title, Color = state.Item2 }); }