-
-
Save peted70/941da73f59a617a83818f2abfd4d09ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MSHealthBot | |
{ | |
[BotAuthentication] | |
public class MessagesController : ApiController | |
{ | |
/// <summary> | |
/// POST: api/Messages | |
/// Receive a message from a user and reply to it | |
/// </summary> | |
public async Task<Message> Post([FromBody]Message message) | |
{ | |
if (message.Type == "Message") | |
{ | |
// calculate something for us to return | |
int length = (message.Text ?? string.Empty).Length; | |
// return our reply to the user | |
return message.CreateReplyMessage($"You sent {length} characters"); | |
} | |
else | |
{ | |
return HandleSystemMessage(message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment