private async Task MessageReceivedAsync(IDialogContext context, IAwaitable<object> result)
{
var cli = new ConnectorClient(new Uri(activity.ServiceUrl));
var activity = await result as IMessageActivity;
await context.PostAsync($"{activity.Text}");
activity.SuggestedActions = new SuggestedActions()
{
Actions = new List<CardAction>()
{
new CardAction(){ Title = "Blue", Type=ActionTypes.ImBack, Value="Blue" },
new CardAction(){ Title = "Red", Type=ActionTypes.ImBack, Value="Red" },
new CardAction(){ Title = "Green", Type=ActionTypes.ImBack, Value="Green" }
}
};
await context.PostAsync(activity);
context.Wait(MessageReceivedAsync);
}
I want to make the bot suggest action to user, i need to do this in the dialog and also sometimes in form flow. i have not been able to figure it out. It actually worked when i tried in the message controller.
Try creating a reply like:
you should be able to paste this into you
MessageReceivedAsync
method and it should work. You also do not need to create your ClientConnector.