我正在使用微软机器人框架。我需要在我的代码中实现星级反馈机制。就像选择星星一样,应该提交机器人的评级。谁可以帮我这个事?或有什么建议吗?
我有一个使用 NodeJS 使用 Bot Framework v4 开发的机器人,并部署在 Teams 中的多个渠道上。有没有办法更新机器人发送的消息?我尝试在 BotFrameworkAdapter 中实现 updateActivity() 函数。但是,它不会更新活动。
我已将这张卡从机器人发送到 Teams 频道。当有人点击按钮时,有没有办法更新卡片或消息(禁用按钮)?
在 Node.js(正在使用 MS Bot Framework)中,我尝试迭代包含 . 返回的多个对象的数组fetch()。它执行一次迭代,然后抛出一个错误。
我确实已经将节点获取从等式中剔除,并使用了对象的静态数组。我也尝试转换为数组。结果还是一样:TypeError: (images || []).forEach is not a function第一次迭代进展顺利。
这是目前的样子(为了可读性缩短了对象值):
\n\n// exact copy of what fetch returns\nlet test = [\n {\n title: 'Power BI Desktop\xe2\x80\x94Interactive Reports | Microsoft Power BI',\n link: 'https://support.office.com/',\n description: 'Create interactive reports with data',\n thumbnail: 'https://powerbi.microsoft.com/'\n }, {\n title: 'What is Power BI administration? - Power BI',\n link: 'https://support.office.com/',\n description: 'Learn about the configuration of Power BI ',\n thumbnail: 'https://learn.microsoft.com/'\n }, {\n …Run Code Online (Sandbox Code Playgroud) 我是机器人框架的新手,所以如果这是基本的,我很抱歉,但我正在尝试向用户发送主动消息以开始对话。我正在使用以下示例:
这工作得很好,但我想做的是从此时开始一个对话框,而不是仅仅向用户发回一些文本。这可能吗?这是示例中的代码
[Route("api/notify")]
[ApiController]
public class NotifyController : ControllerBase
{
private readonly IBotFrameworkHttpAdapter _adapter;
private readonly string _appId;
private readonly ConcurrentDictionary<string, ConversationReference> _conversationReferences;
private readonly BotState _userState;
private readonly BotState _conversationState;
public NotifyController(IBotFrameworkHttpAdapter adapter,
ICredentialProvider credentials,
ConcurrentDictionary<string, ConversationReference> conversationReferences,
ConversationState conversationState,
UserState userState
)
{
_adapter = adapter;
_conversationReferences = conversationReferences;
_appId = ((SimpleCredentialProvider)credentials).AppId;
// If the channel is the Emulator, and authentication is not in use,
// the AppId will be null. We generate a random AppId for …Run Code Online (Sandbox Code Playgroud) 你好,我正在使用 Microsoft Botframework V4 在 c# 和 VS 中做一个 chatBot 项目。实际上该项目是从 Botframework v3 到 V4 的迁移。在 v4 中,如何使用 DataTable 扩展。就像 CopytoDataTable 仅在 v3 中有效,在 v4 中无效。
数据表扩展的用法,例如“using system.data.datasetextensions”
DataTable ResultTable = new DataTable();
DataTable TempTable = query.CopyToDataTable<DataRow>();
ResultTable.Merge(TempTable);
ResultTable = ResultTable.DefaultView.ToTable()
错误是“DataTable”不包含“AsEnumerable”的定义,并且最佳扩展方法重载“ConfigurationExtensions.AsEnumerable(IConfiguration)”需要“IConfiguration”类型的接收器
我将从机器人向 Microsoft Teams 发送一条主动消息,其中包含用户可以采取的 2 项建议操作。但在 Microsoft Teams 中,消息显示如下:
请注意,该消息未显示任何建议消息!在 Bot Framework Emulator 中,相同的消息如下所示:
Teams 或我的代码有什么问题?
下面是我验证、生成和发送消息的代码:
private async Task BotCallback(ITurnContext turnContext, CancellationToken cancellationToken)
{
string serviceUrl = turnContext.Activity.RelatesTo.ServiceUrl;
ConnectorClient Connector = new ConnectorClient(
new Uri(serviceUrl),
microsoftAppId: "[MicrosoftAppId]",
microsoftAppPassword: "[MicrosoftAppPassword]"
);
AppCredentials.TrustServiceUrl(serviceUrl);
ChannelAccount from = turnContext.Activity.From;
IMessageActivity activity = MessageFactory.SuggestedActions(
new string[] { "First action", "Second action" },
$"Hi {userName},\r\nYou've missed some lorem ipsum dolor sit amet:\r\n- **consectetur:** Ut porttitor\r\nChoose an action from below to add them."
);
await Connector.Conversations.SendToConversationAsync( …Run Code Online (Sandbox Code Playgroud) 有没有办法将 Onchange 事件添加到在网络聊天(版本 V4)中呈现的自适应卡片输入字段。在结帐屏幕中更改数量值(类型为数字的自适应卡片输入字段)的示例应更新总值(自适应卡片文本字段)
为了简单起见......在下图中,一旦我更改了输入框中的数字,它应该在下面的文本框中更新。一切都应该发生在网络聊天 V4(React) 客户端

以下是我尝试过的选项,这里没有任何代码可以提交:
选项 1:尝试使用中间件将事件添加到来自机器人的卡片中的数量输入字段,但无法找到唯一标识输入字段以添加事件的选项(可以根据项目中的项目数量看到多个输入字段卡片)
选项 2:根据来自 bot 的卡片在前端创建一张新卡片,并将事件添加到该新卡片。是否可以中断发送到机器人的消息并从前端发送卡片?
选项3:在卡片上添加更新按钮,以便在后台计算总数并提交更新卡片给用户
下面是有效载荷:
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0",
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Output",
"weight": "Bolder",
"horizontalAlignment": "Center",
"size": "Large",
"id": "output",
"color": "Good"
},
{
"type": "Container",
"items": [
{
"$data": "{items}",
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": " ",
"id": "line",
"spacing": "None"
},
{
"type": "Image",
"altText": "",
"id": "myimage",
"url": "{imgUrl}",
"spacing": "None",
"size": "Stretch",
"width": "1000px",
"height": …Run Code Online (Sandbox Code Playgroud) 我已通过遵循提到的步骤创建一个机器人DOC .I已经验证使用OAuth 2.0(AUTH码许可)用户如在所提到的文档,并反向我得到了访问令牌。但是当我使用 (/teams/{id}/channels/{id}/messages) API 向团队中的频道发送消息时,消息是代表我发送的。但我希望我的机器人作为消息的发送者。这是我使用上述 API 发送的消息的图像。有什么方法可以作为机器人向用户发送直接消息吗?
botframework microsoft-teams microsoft-graph-teams microsoft-graph-api
当我在文档开始时尝试将我的机器人与身份验证集成时,我发现了有关 Bot Channels Registration 的信息
后来我在 Azure Docs 中搜索了这个我还没有找到关于这个的任何人都可以解释我
是否可以在此处传递直接端点/API 并可以对其进行测试并将其从外部集成到通道中?
azure azure-active-directory botframework azure-bot-service azure-authentication
我按照文档在 manifest.json 中添加了 webApplicationInfo 以包含 RSC 权限。但是,当消息中没有提到机器人时,我仍然没有收到任何消息活动。
"webApplicationInfo": {
"id": "<i have updated app id here>",
"resource": "https://AnyString",
"applicationPermissions": [
"ChannelMessage.Read.Group"
]
}
Run Code Online (Sandbox Code Playgroud)
下面是我回显消息的代码:
protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
await turnContext.SendActivityAsync(MessageFactory.Text($"Echo: {turnContext.Activity.Text}"), cancellationToken);
}
Run Code Online (Sandbox Code Playgroud)
我已经检查了 permissionGrant restful API(https://graph.microsoft.com/v1.0/groups/ { groupid }/ permissionGrants ),它包括“ChannelMessage.Read.Group”
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#permissionGrants",
"value": [
{
"id": "<id ....>",
"deletedDateTime": null,
"clientId": "<client id ...>",
"clientAppId": "<client app id ...>",
"resourceAppId": "<resource app id ...>",
"permissionType": "Application",
"permission": "ChannelMessage.Read.Group"
} …Run Code Online (Sandbox Code Playgroud) botframework ×10
c# ×3
javascript ×2
node.js ×2
arrays ×1
asp.net-core ×1
azure ×1
bots ×1
json ×1
reactjs ×1
web-chat ×1