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 GetStartedMessageBuilder : IMessageBuilder> { public ResponseType ResponseType => ResponseType.Succeeded; public IEnumerable BuildMessages(Tuple data) { var user = data.Item1; var country = data.Item2; IEnumerable texts; if (country == null) { texts = new[] { $"Hi {user.first_name}! ", "I'm the Sony Chart Bot. " + "You can ask me for the current daily chart position of any artist by just writing its name and the name of the country you want charts from. ", "If you write \"Beyonce in United States\" - or any other country with a chart - I will give current chart positions for that country.", "You can also write \"Beyonce worldwide\" to get global chart positions" + "(For some users I can automatically pick up what country they are from, and use that country for chart lookups, but I couldn't do that in your case.)" }; } else { var exampleCountry = country.CountryCode.ToLowerInvariant() != "us" ? "United States" : "United Kingdom"; texts = new[] { $"Hi {user.first_name}! ", "I'm the Sony Chart Bot. " + "You can ask me for the current daily chart position of any artist by just writing its name. ", "If you write \"Beyonce\", I'll give you Beyoncé chart positions for your country " + $"(which I picked up to be {country.EnglishName} from your Facebook information). ", $"If you add \"in {exampleCountry}\" - or any other country with a chart - I'll give you chart positions for that country instead." + "You can also write \"Beyonce worldwide\" to get global chart positions" }; } return texts.Select(t => new MessageToSend { text = t }); } } }