using System; using System.Collections.Generic; using System.Linq; using Sony.ChartBot.Entities.MessengerApi; using Sony.ChartBot.Entities.Storage; namespace Sony.ChartBot.Messages.MessageBuilders { public class UnsupportedInputMessageBuilder : IMessageBuilder { public ResponseType ResponseType => ResponseType.GeneralError; public IEnumerable BuildMessages(NotSupportedException data) { var text = "Huh? Sorry, I didn't understand that. " + "Could you try phrasing yourself differently? "; var messages = new List { new MessageToSend { text = text } }; #if DEBUG var exceptionText = data.ToString(); exceptionText = data.ToString().Length > 300 ? exceptionText.Substring(0, 300) : exceptionText; messages.Add(new MessageToSend { text = exceptionText }); #endif return messages; } } }