botframework - 如何将密码活动表单bot传递到microsoft bot框架中的前端
问题描述
我正在尝试实现此链接中显示的密码功能。 https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/05.custom-components/f.password-input
但是如何将密码活动从机器人传递到前端。我正在使用 c# 模板来开发机器人。
根据我的理解,我们需要将密码活动从机器人传递到前端,以执行链接中提到的密码内容。
一个示例将有助于了解如何将这种类型的客户活动传递给机器人。
谢谢,
解决方案
我自己将这个样本用于我的一个机器人。机器人逻辑内置在节点中,但我想翻译成 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);});
推荐阅读
- c# - TFS 自动关联 ID 未提供的其他工作项
- android - Android Studio 使用 gradle 同步构建配置问题
- sql - 如何计算两个表之间的指标
- mysql - MySQL从许多表中返回唯一组合
- electron - Electron 应用程序在 Windows 10 中运行良好,但在 Windows 7 中显示白屏
- c# - WPF CoerceCallback 取消值更改
- telegram - Github Actions:缺少电报令牌或用户列表
- angular - 如何强制 navigateByUrl() 在 Angular 9 中导航域根目录?
- c - 将用于查找最低有效设置位的 ASM 函数移植到 C 中
- python - 计算不同时间间隔的 RMSE