Tutorial: Extend a v4 Bot (typescript)

Forward queries to Skills

Within your Main/Router dialog you firstly need to ensure the SkillDialogs registered previously are added to the dialog stack:

skillDialogs.forEach((skillDialog: SkillDialog) => {
    this.addDialog(skillDialog);
});

Add the following code after your Dispatcher has executed passing the registered Skills and the Intent returned from the Dispatcher. If the isSkill method returns true then you start the appropriate SkillDialog instance passing the Skill Manifest Id and the matching intent.

// Identify if the dispatch intent matches any Action within a Skill if so, we pass to the appropriate SkillDialog to hand-off
const identifiedSkill: ISkillManifest | undefined = SkillRouter.isSkill(this.settings.skills, intent);
if (identifiedSkill !== undefined) {
    // We have identified a skill so initialize the skill connection with the target skill
    // the dispatch intent is the Action ID of the Skill enabling us to resolve the specific action and identify slots
    // Pass the activity we have
    const result: DialogTurnResult = await dc.beginDialog(identifiedSkill.id);

    if (result.status === DialogTurnStatus.complete) {
        await this.complete(dc);
    }
} else {
    // Your normal intent routing logic
}