BotBuilder-MicrosoftTeams-node
BotBuilder-MicrosoftTeams-node copied to clipboard
how to get newly created chain info when calling createReplyChain?
Hi, I'm using createReplyChain
to send messages to a new chain (in the channel).
const activity = {
type: ActivityTypes.Message,
attachments: [{
contentType: 'application/vnd.microsoft.card.adaptive',
content: buildFeedbackDialog(message),
}],
} as Activity
const resource = (await adapter.createReplyChain(context, [activity]))[0]
console.log(`Add record: ${resource.id}`)
After that, the only thing I got is resourceId
So after I reply to the message created by the bot and received onMessage webhook, how could I know which 'initial activity' or 'reply chain' the replied message activity belongs to?
Or knowing the relation between the bot's initial activity and the user reply message?
Thanks.
Hi @richard1122 ,
You may check out the conversation object (and its id) from the incoming activity, by context.activity.conversation.id
, and the conversation id looks like:
19:[email protected];messageid=1557438940572
which means Channel id + Reply chain root message id:
19:[email protected]
is channel id
messageid=1557438940572
is the parent / root message id of the current reply chain.
Hi @robin-liao ,
Thanks for your reply.
I know that I could extract message_id when receiving updates from the context.
But when creating the reply chain ( bot send the first message ), no message_id is returned.
The only response from createReplyChain
is:
export interface ResourceResponse {
/**
* Id of the resource
*/
id: string;
}
The id is 1:1xel-XL7Sppbet .....
Which means I'm not sure how to get the message_id when creating reply chain.
Thanks.
@richard1122 you're right!! After some investigations, I found it's indeed a design flaw. It should've return new message id. Reopen this issue and will fix bug soon. Thanks!