Last active
November 19, 2018 23:58
-
-
Save jamesmundy/124af91a4d034f952876f1a509997360 to your computer and use it in GitHub Desktop.
The Bot entry point for an ASP.NET Web Api
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
[BotAuthentication] | |
public class MessagesController : ApiController | |
{ | |
private readonly ITableService _tableService; | |
public MessagesController(ITableService tableService) | |
{ | |
_tableService = tableService; | |
} | |
public async Task<HttpResponseMessage> Post([FromBody] Activity activity) | |
{ | |
if (activity.Type == ActivityTypes.Message || | |
activity.Type == ActivityTypes.Event && | |
activity.Value is InternalEventMessage) | |
await Conversation.SendAsync(activity, | |
() => new NewPostcardDialog(Conversation.Container.Resolve<IAppSettingsService>()); | |
else | |
HandleSystemMessage(activity); | |
var response = Request.CreateResponse(HttpStatusCode.OK); | |
return response; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment