虚拟助手技能 - 如何 kill/end 当前技能机器人

Virtual Assistant Skill - how to kill/end the current skills bot you are in

我试图实现一个 msbot 技能来处理目录服务,例如一个人的联系电话和电子邮件。我的问题是我无法摆脱技能机器人。我已经尝试了一切,但没有任何效果。

我正在尝试对技能机器人执行以下操作以结束或杀死它,并且 return 向父级发送对话状态:

但不幸的是我无法 return 到父机器人,而是它一直返回到技能机器人,这不是我想要的。我可能做错了,我不确定如何结束技能机器人状态和 return 到父机器人,因为主要功能在那里。

您需要发送 EndOfConversation Activity。看看我们的 skills sample does it:

protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
    if (turnContext.Activity.Text.Contains("end") || turnContext.Activity.Text.Contains("stop"))
    {
        // Send End of conversation at the end.
        await turnContext.SendActivityAsync(MessageFactory.Text($"ending conversation from the skill..."), cancellationToken);
        var endOfConversation = Activity.CreateEndOfConversationActivity();
        endOfConversation.Code = EndOfConversationCodes.CompletedSuccessfully;
        await turnContext.SendActivityAsync(endOfConversation, cancellationToken);
    }
[...]