Created
April 27, 2016 11:48
-
-
Save chomado/bec6d620836cd023a47861aea4d2691a to your computer and use it in GitHub Desktop.
Microsoft の Bot Framework を使って bot を作った。その bot の本体部分の記述
This file contains hidden or 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
| 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