无法通过其他渠道发送消息,但团队(nodejs)的通用msbot除外

时间:2020-04-24 12:29:11

标签: botframework microsoft-teams

我为团队创建了一个漫游器,并将其作为选项卡添加到了频道( testChannel1 )(使用配置页)。我已收到服务器的 ConversationUpdate 事件。当我尝试使用在 ConversationUpdate 事件中收到的上下文对象发送消息时,消息是通过常规通道而不是 testChannel1 发送的。我已将漫游器添加到 testChannel1 中,但是我不知道为什么消息会以 General 发送。我也无法使用该上下文对象来获取频道列表,它会引发错误Error: This method is only valid within the scope of a MS Teams Team.

contextActivityObject:-{ "membersAdded": [ { "id": "28:[guid]" } ], "type": "conversationUpdate", "timestamp": "2020-04-24T12:00:06.7125247Z", "id": "f:[guid]", "channelId": "msteams", "serviceUrl": "https://smba.trafficmanager.net/in/", "from": { "id": "29:[id]", "aadObjectId": "[guid]" }, "conversation": { "isGroup": true, "conversationType": "channel", "tenantId": "[guid]", "id": "19:aba[id]@thread.tacv2" }, "recipient": { "id": "28:[guid]", "name": "teststandups" }, "channelData": { "team": { "aadGroupId": "[guid]", "name": "nikhilp", "id": "19:aba[id]@thread.tacv2" }, "eventType": "teamMemberAdded", "tenant": { "id": "[guid]" } } }

我为机器人提供的作用域为Team

感谢您的帮助

1 个答案:

答案 0 :(得分:2)

因此,您已经问了几个问题,我会尽力回答。基本上,每个通道的会话ID(19:aba [id] @ thread.tacv2)是唯一的,因此,如果您使用的是“常规”通道,则一定会进入“常规”。

要了解如何获取频道ID,请查看Get the list of channels in a team。这将向您展示如何获取信息,但是您需要获取触发器才能进行该呼叫。为此,最好的方法是加入触发器之一,例如接收来自用户的消息或将其添加到团队中。这些事件集中包括正在添加和删除的通道。查看更多here