microsoft-teams-sample-complete-csharp | building complex bots for Microsoft Teams | Bot library
kandi X-RAY | microsoft-teams-sample-complete-csharp Summary
kandi X-RAY | microsoft-teams-sample-complete-csharp Summary
Sample that shows how to build a bot for Microsoft Teams in C#.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of microsoft-teams-sample-complete-csharp
microsoft-teams-sample-complete-csharp Key Features
microsoft-teams-sample-complete-csharp Examples and Code Snippets
Community Discussions
Trending Discussions on microsoft-teams-sample-complete-csharp
QUESTION
I'm working on a Teams bot that needs the ability to start a new 1:1 conversation with a known user (i.e., we know the Teams user ID).
I've looked at the "complete-csharp" OfficeDev samples on GitHub (https://github.com/OfficeDev/microsoft-teams-sample-complete-csharp) as well as the Teams-related parts of the Graph API but I don't see any affordance for starting a new conversation.
Our goal is to have our bot ping a known user on a schedule by inviting them into a 1:1 chat and requesting their feedback. A button in the bot's message will reveal the feedback form (via task module).
...ANSWER
Answered 2020-Mar-10 at 17:10Bot Framework has added in code specific for Teams that makes a lot of the code in this answer moot or incorrect. See this sample for sending proactive messages in Teams, now.
Teams calls that a "Proactive Message". So long as you get the user ID that Teams uses, it's fairly easy to do.
Per the docs, Proactive messaging for bots:
Bots can create new conversations with an individual Microsoft Teams user as long as your bot has user information obtained through previous addition in a personal, groupChat or team scope. This information enables your bot to proactively notify them. For instance, if your bot was added to a team, it could query the team roster and send users individual messages in personal chats, or a user could @mention another user to trigger the bot to send that user a direct message.
The easiest way to do this is through the Microsoft.Bot.Builder.Teams
middleware.
Note: The Microsoft.Bot.Builder.Teams extension is still in Prerelease for V4, which is why samples and code are kind of hard to find for it.
Adding the MiddlewareIn Startup.cs
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install microsoft-teams-sample-complete-csharp
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page