public static BotMessageContent ApplyStyle(BotMessageContent content, BotMessageStyle style) { var styledText = content?.Text?.Length > 0 ? ApplyStyle(content.Text, style) : null; var styledEmbed = ApplyStyle(content?.Embed, style); return(new BotMessageContent(styledText, styledEmbed)); }
private static string ApplyStyle(string text, BotMessageStyle displayType) { return(displayType switch { BotMessageStyle.Warning => $"Warning: {text}", BotMessageStyle.Error => $"Error: {text}", BotMessageStyle.Exception => $"Exception: {text}", _ => text, });
public BotMessageBuilder WithDisplayType(BotMessageStyle displayType) { _displayType = displayType; return(this); }
public BotMessage(BotMessageContent content, BotMessageStyle style = BotMessageStyle.Default) { Content = BotMessageContentStyler.ApplyStyle(content, style); Style = style; }