I have a conversationUpdate event for a channel, that I'm using as the conversationReference
in the following code snippet. For some reason, when I try to run this code, I get an error saying "This method is only valid within the scope of a MS Teams Team." even though as far as I can tell, the event I've provided is in the scope of a team (as further proof, conversation.conversationType
is channel
). Conversely, I am able to call TeamsInfo.getPagedMembers()
successfully, which I would expect to fail if I weren't in a team scope.
const proactiveChannelHandler = async (turnContext) => {
try {
const teamDetails = await TeamsInfo.getTeamDetails(turnContext);
if (teamDetails) {
await turnContext.sendActivity(`The group ID is: ${teamDetails.aadGroupId}`);
} else {
await turnContext.sendActivity('This message did not come from a channel in a team.');
}
} catch (err) {
console.error(err);
}
}
adapter.continueConversation(conversationReference, proactiveChannelHandler);