0
votes

A messaging extension is associated with a Microsoft Teams bot. When invoked, such as for getting search results, it sets up a conversation with the bot it was associated with. That bot is aware of the Teams user X who invoked the messaging extension.

However, is it possible to know the context in which the messaging extension was invoked, for example it was invoked during a 1:1 Chat session with remote user Y? The use case is to return results in the messaging extension based on the identity of the remote user Y, and not just the identity of X.

1

1 Answers

-1
votes

I think you could use GetPagedMembersAsync for this - you could get all the members, eliminate the one who actually invoked the message extension, and if there's just one left:

  1. then it must have been a 1-1 converstion (note that it might contain your bot as well, so check for that and ignore as well)

  2. whoever is left is "user Y"