private async Task SendMessage() { ProgressVisible = true; var botResponse = await _botConnector.SendMessage("Daniel", Message.Text); ProgressVisible = false; ConversationList.Add(botResponse); }
private async Task SendMessage() { ProgressVisible = true; ConversationList.Add(new BotMessage() { From = "Me", Text = Message.Text }); var botResponse = await _botConnector.SendMessage("Me", Message.Text); ProgressVisible = false; ConversationList.Add(botResponse); }
private async void SendMessage(object message) { if (!string.IsNullOrWhiteSpace(EntryText)) { var mytext = EntryText; EntryText = string.Empty; var messageToSend = new ChatMessage { From = userName, Text = mytext, ConversationId = _lastConversation.ConversationId, DateUtc = DateTime.UtcNow }; _conversationList.Add(messageToSend); await azureDataService.AddMessage(messageToSend); var botResponse = await _botConnector.SendMessage(messageToSend); var messageFromBot = new ChatMessage { From = botName, Text = botResponse.Text, ConversationId = _lastConversation.ConversationId, DateUtc = DateTime.UtcNow }; await azureDataService.AddMessage(messageFromBot); _conversationList.Add(messageFromBot); } }