The Post method accepts messages from the user as an activity, which contains all conversation information between the user and our bot. Using this, we can ascertain what kind of information the user wants from the bot:
public async Task<HttpResponseMessage> Post([FromBody]Activity activity)
Here, we defined a sample bot that will reply back to the user with the same as what you say to it.
The Bot Framework provides many features that include how to identify the type of incoming message and based on that, your bot can respond to the user. To identify that, we have activity enum types, which will provide information about the conversation.
To identify and apply business logic to the message sent by the user, we will write the following code in the Post method:
if (activity.Type == ActivityTypes.Message)
{
}
If the user is sending a message, it means they are requesting something...