Updating an activity in BotFramework v4 on Teams platform

前端 未结 2 869
夕颜
夕颜 2020-11-27 23:20

I have a bot developed using the Bot Framework v4 using NodeJS and deployed on multiple channels in Teams. Is there a way we can update a message sent by the bot? I tried im

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 23:50

    I've tried this using the middleware but keep getting: "The bot is not part of the conversation roster". Question: My bot is updating a message that a user wrote, so do I need special permissions?

         let ActivityID = context.activity.conversation.id.split("=")[1];
    
            let updatedActivity: Partial = {
                "id":  ActivityID, 
                "channelId": context.activity.channelId,
                "channelData": context.activity.channelData,
                "conversation": 
                                {
                                  "name": "",
                                  "id": context.activity.conversation.id,
                                  "isGroup": context.activity.conversation.isGroup,
                                  "conversationType": context.activity.conversation.conversationType,
                                  "tenantId": context.activity.conversation.tenantId
                                },
                "type": "message",
                "text": "",
                "summary": "",
                "attachments": [ attachment ]
            }       await context.updateActivity(updatedActivity);
    

提交回复
热议问题