void AddMessage(BotActivity message) { if (message == null || Conversation == null) { return; } message.IsFromMe = message.FromId == Conversation.MyName; //Set the callback for the actions! (message as Message)?.Attachments?.ToList()?.ForEach(x => x?.Content?.Buttons?.ToList().ForEach(y => y.ActionHandler = this)); Conversation.Messages.Add(message); }
public async Task <bool> SendActivity(string conversationId, BotActivity message) { try { var resp = await Post(message, queryParameters : new Dictionary <string, string> { { "conversationId", conversationId } }); Console.WriteLine(resp); return(true); } catch (Exception ex) { this.OnException(this, ex); } return(false); }