Created
December 18, 2017 16:54
-
-
Save angelobelchior/4f912952d874c6b59b1dbf576c6d6ba7 to your computer and use it in GitHub Desktop.
Bot Activity Logger
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
public sealed class BotActivityLogger : Microsoft.Bot.Builder.History.IActivityLogger | |
{ | |
public async Task LogAsync(IActivity activity) | |
{ | |
var message = activity.AsMessageActivity(); | |
var text = message.Text; | |
} | |
} | |
[BotAuthentication] | |
public class MessagesController : ApiController | |
{ | |
static MessagesController() | |
{ | |
var builder = new Autofac.ContainerBuilder(); | |
builder.RegisterType<BotActivityLogger>().AsImplementedInterfaces().InstancePerDependency(); | |
builder.Update(Conversation.Container); | |
} | |
/*...*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment