Tallan's Technology Blog

Tallan's Top Technologists Share Their Thoughts on Today's Technology Challenges

Posts Tagged "Autofac"

Global Message Handling and Catching the Bot Framework Way

Matthew Gajdosik

So you’ve set up your new chat bot using the Microsoft Bot Framework, and you need to catch messages before they’re read by your dialogs or FormFlows to apply some global or preemptive logic. Luckily, the Bot Framework team thought ahead and built in a concept for handling message interception, called Scorables.
What Are Scorables?
A Scorable is a class that you can register with Autofac (the dependency injection solution used by Bot Framework), that will silently sit in between your externally-facing code accepting incoming user messages, and your internal dialog code. Each one will get the chance to handle the incoming message, and even compete for priority (which is where the “score” originates).
When To Use Scorables
Since they have full access to Autofac and the dialog stack, they can allow you to do anything from:

applying logic across your entire set of dialogs without duplicating…

\\\