Forum Discussion

AyeshaKulsumSJ's avatar
AyeshaKulsumSJ
Brass Contributor
Sep 09, 2022

Reply to message is not working as expected

const {
MessageFactory,
TeamsActivityHandler, BotFrameworkAdapter, TurnContext,
teamsGetChannelId,
TeamsInfo
} = require('botbuilder');
const properties = {
'membersAdded': [{ 'id': '28:17a' }], 'type': 'conversationUpdate''timestamp': '2022-08-11T10:54:30.482Z''id': 'f:ce9c82ab7a6feabc''channelId': 'msteams''serviceUrl': 'https://smba.trafficmanager.net/in/''from': { 'id': '29:1YqsjLwgg-0A_V8tL5P3hIw''aadObjectId': 'a0858f3e-d57759' }, 'conversation': {
'isGroup': true'conversationType': 'channel''tenantId': '3272b84e1''id': '19:PZppMpIo1@thread.tacv2'
}, 'recipient': { 'id': '28:17720bfc7ba''name': 'bot 1' }, 'channelData': {
'team': { 'aadGroupId': '9ffd4120579''name': 'Ayesha Testing''id': '19:PZp9pIo1@thread.tacv2' }, 'eventType': 'teamMemberAdded''tenant': { 'id': '3284e1' }, 'settings': { 'selectedChannel': { 'id': '19:PZ1@thread.tacv2' } }
}
};
const BotConnector = require('botframework-connector');
const adapter = new BotFrameworkAdapter({
appId: '',
appPassword: ''
});
 
BotConnector.MicrosoftAppCredentials.trustServiceUrl(properties.serviceUrl);
const context = new TurnContext(adapter, properties);
const teamsChannelId = '19:PZpplOG9xxoOHhanG9pIo1@thread.tacv2';
console.log(teamsChannelId);
const activity = MessageFactory.text('This will be the first message in a new thread');
const [reference] = await TeamsInfo.sendMessageToTeamsChannel(context, activity, teamsChannelId, process.env.MicrosoftAppId);

await context.adapter.continueConversationAsync( reference, async turnContext => {
await turnContext.sendActivity(MessageFactory.text('This will be the first response to the new thread'));
});
 
Expected:

 

Actual :

 

When I want to send a Reply to the message but it is sending as a new message. And I have to update that reply message that certain times. Can you please look into that? Also Is there a way to batch send or update messages to users in personal chat, otherwise data might be inconsistent for users.

Resources