微信机器人框架中如何将密码活动表单机器人传到前端?

问题描述 投票:1回答:1

我正在尝试实现这个链接中所示的密码的功能。https:/github.commicrosoftBotFramework-WebChattreemastersamples05.custom-componentsf.password-input。

但如何将密码活动从机器人中传递到前端。我是用c#模板来开发机器人的。

根据我的理解,我们需要将密码活动从机器人传递到前端,以便执行链接中提到的密码事情。

一个例子将是帮助-full在知道如何传递这种类型的客户活动形式的机器人。

谢谢。

botframework azure-bot-service
1个回答
0
投票

我自己的一个机器人就用了这个样本。机器人逻辑是建立在node中,但我想它应该不难翻译成c#。

        const askPwd =
    {
        name: 'passwordInput',
        type: 'event'
    };
    await stepContext.context.sendActivity(askPwd);
    return await stepContext.prompt(PASSWORD_PROMPT, '');

在c#中,这可能会被翻译成这样(我不懂c#)。

Activity activity = new Activity
        {
            Type = ActivityTypes.Event,
            Name = "passwordInput"
        };
        await stepContext.Context.SendActivityAsync(activity, cancellationToken);});
© www.soinside.com 2019 - 2024. All rights reserved.