/// <summary> /// POST: api/Messages /// Receive a message from a user and reply to it /// </summary> public async Task <HttpResponseMessage> Post([FromBody] Activity activity) { if (activity.Type == ActivityTypes.Message) { if (activity.ChannelId == ChannelIds.Msteams && activity.Text.StartsWith("\r\n")) { activity.Text = CustomCode.SanatizeMagicCodeForTeams(activity.Text); } if (activity.ChannelId == ChannelIds.Sms && activity.From.Id.Contains("+")) { activity.From.Id = activity.From.Id.Substring(1, activity.From.Id.Length - 1); } await Conversation.SendAsync(activity, () => new RootDialog()); } else { await HandleSystemMessage(activity); } var response = Request.CreateResponse(HttpStatusCode.OK); return(response); }