在botframework中,一旦用户回复,如何将已发送的消息修改为团队频道

问题描述 投票:0回答:1

我正在尝试修改Bot发送给用户的最后一条消息,用户响应后。

为此,我正在尝试使用其余的api,该api需要会话ID和活动ID。

我面临的问题是,仅当activityId是已发送消息的replyToId时,此api才有效。但是ReplyToId在发送消息时甚至在发送中间件期间都不可用。它是在连接器postMessage函数内部生成的,中间件无法存储该函数。

我如何获取有效的activityId来修改Bot从Bot发送的消息?有什么建议吗?

botframework direct-line-botframework
1个回答
1
投票

在V3中

session.sendBartch( (e, addresses) =>{
  // addresses contain the id that now can be used for modifying

})

在V4中

responses = await context.sendActivities( [ activities array]) 
// responses contain the id required for modifying.
© www.soinside.com 2019 - 2024. All rights reserved.