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

I have created a bot for teams and added it to a channel (testChannel1) as a tab (using a configuration page). I have received a ConversationUpdate event to my server. When I try to send message using the context object that I have received in ConversationUpdate event the message was sent in General channel instead of testChannel1. I have added my bot to testChannel1 but I dont know why the message is sent in General. I am also not able to get the channels list using that context object it is throwing error 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]" } } }

The scope I have provided for my bot is Team

感谢您的帮助

评论
  • LOL
    LOL 回复

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

    To find out how to get the channel Ids, have a look at Get the list of channels in a team. That will show you -how- to get the info, but you need to get a trigger in order to be able to make that call. To do that, the best way is to hook into one of the triggers, like receiving a message from a user, or being added to the team. Included in these set of events, are channels being added and deleted. See more here.