Dec 14 2022 12:50 AM
Recently we have upgraded the .net version from 3 to 6 and updated bot builder. As 'BotFrameworkAdapter' is obselete , we have used CloudAdapter instead.
In BotFrameworkAdapter, method 'GetConversationMembersAsync' gets the list of members of the current conversation. We need the same replacement of this method in Cloud adapter to return the channel account of the current conversation members .
GetConversationMembersAsync in BotFrameworkAdapter,
Dec 14 2022 01:29 AM
Dec 15 2022 01:46 AM
@Lakshmi_145 -You can try with the below code snippets.
Sample link-Microsoft-Teams-Samples/TeamsConversationBot.cs at 6d681dbf8133921172adf3d6aa03843ab09715ce · Office...
var members = await GetPagedMembers(turnContext, cancellationToken);
foreach (var teamMember in members)
{
var proactiveMessage = MessageFactory.Text($"Hello {teamMember.GivenName} {teamMember.Surname}. I'm a Teams conversation bot.");
var conversationParameters = new ConversationParameters
{
IsGroup = false,
Bot = turnContext.Activity.Recipient,
Members = new ChannelAccount[] { teamMember },
TenantId = turnContext.Activity.Conversation.TenantId,
};
await ((CloudAdapter)turnContext.Adapter).CreateConversationAsync(
credentials.MicrosoftAppId,
teamsChannelId,
serviceUrl,
credentials.OAuthScope,
conversationParameters,
async (t1, c1) =>
{
conversationReference = t1.Activity.GetConversationReference();
await ((CloudAdapter)turnContext.Adapter).ContinueConversationAsync(
_appId,
conversationReference,
async (t2, c2) =>
{
await t2.SendActivityAsync(proactiveMessage, c2);
},
cancellationToken);
},
cancellationToken);
}
await turnContext.SendActivityAsync(MessageFactory.Text("All messages have been sent."), cancellationToken);
Dec 16 2022 06:24 AM - edited Dec 19 2022 03:25 AM
@Aiswarya_Lakshmy -Hope you are doing well!
Did you get chance to check above suggestion?
Dec 16 2022 07:08 AM
Dec 20 2022 02:52 AM
@Lakshmi_145 -
Are you trying the above method.
We have tried with the above method; we get the members of the current conversation.
Could please set up the sample and check it once? and also share which data you did not get using this method.
Sample link-Microsoft-Teams-Samples/TeamsConversationBot.cs at 6d681dbf8133921172adf3d6aa03843ab09715ce · Office...
Dec 21 2022 12:00 AM
Dec 21 2022 05:02 AM
@Lakshmi_145 -Could you please share your valuable feedback via Microsoft Teams Developer Feedback link.