Skip to content

Instantly share code, notes, and snippets.

@chomado
Created April 27, 2016 11:48
Show Gist options
  • Select an option

  • Save chomado/bec6d620836cd023a47861aea4d2691a to your computer and use it in GitHub Desktop.

Select an option

Save chomado/bec6d620836cd023a47861aea4d2691a to your computer and use it in GitHub Desktop.
Microsoft の Bot Framework を使って bot を作った。その bot の本体部分の記述
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