public Message ToSlackMessage(BuildCompletionNotification notification, BotElement bot, string channel) { var lines = notification.ToMessage(bot, s => s); var color = notification.IsSuccessful ? bot.GetSetting("successColor") : bot.GetSetting("errorColor"); return(SlackHelper.CreateSlackMessage(lines, bot, channel, color)); }
public Message ToSlackMessage(BuildCompletionNotification notification, BotElement bot, string channel) { var lines = notification.ToMessage(bot, s => s); var color = notification.IsSuccessful ? bot.GetSetting("successColor") : bot.GetSetting("errorColor"); return SlackHelper.CreateSlackMessage(lines, bot, channel, color); }
internal static Message CreateMsTeamsMessage(BuildCompletionNotification notification, BotElement bot) { var lines = notification.ToMessage(bot, s => s); if (lines == null || !lines.Any()) { return(null); } string color = notification.IsPartiallySucceeded ? bot.GetSetting("partiallySucceededColor") : (notification.IsSuccessful ? bot.GetSetting("successColor") : bot.GetSetting("errorColor")); return(CreateMsTeamsMessage(lines[0], new[] { new Fact(bot.Text.BuildStatus, $"**{lines[1]}**") }, color)); }