Search code examples
c#botframeworkmicrosoft-teams

DefaultActivityHandler inheritance in Virtual Assistant and Skill Templates


Is there a reason why the Virtual Assistant template creates the bot like:

public class DefaultActivityHandler<T> : TeamsActivityHandler
    where T : Dialog

while the Skill template creates the bot like:

public class DefaultActivityHandler<T> : ActivityHandler
    where T : Dialog

Will the skill work correctly when integrated in Teams?


Solution

  • Yes, it should work. Skills are meant/designed to be abstract and context agnostic of the client/parent bot (VA in this case). They don't have to be, but the idea is that they generally are. Unless the skill needs to work directly with Teams, then it shouldn't need to use TeamsActivityHandler. This is because the VA is the one communicating with the skill, not the channel/client (Teams).

    This is of course a very simplified scenario. There are absolutely scenarios out there where you would want a skill to be used directly with Teams (as just a bot in that case, it wouldn't be a skill), or where you would want the skill to have some sort of context for Teams. But by default it's not setup that way and you have to adjust and design for that.