0
votes

New to Teams bot, and I am trying out the samples with python botframework,

What I need?

  • With teams Messaging Extension, added an action menu for message, on click it shows a input dialog - this is done.
  • User selects a message in a channel, and use the above action menu, once the user inputs a value in the dialog, the requirement is to send him a direct (private) message - this is not done

What I tried

Tried using proactive message from samples,

The proactive message can be done via either of the below methods in BotFrameworkAdapter

  • create_conversation
  • continue_conversation

but both methods needs a conversation reference, but in my case, I will not have a conversation reference, as the user would interact for the first time only in action menu in channel. What i have is the from_property ( which holds all details of user) in turncontext, but didnt find the write api in framework to send direct message to user with this values.

1

1 Answers

0
votes

Your Teams application would need to contain both the Message Extension and the Bot itself (registered in the Bots section). As a result, when they install the app, to get the message extension, your Bot will be installed at the same time. Good practice is to send a "welcome" message anyway, which you do by hooking into the "OnMembersAddedAsync" event - see more here. In that event you immediately have access to everything you need for a proactive message (ServiceUrl, ConversationID, TenantID,..)