Create interactive conversational bots for Microsoft Teams

Microsoft 365 Developer · Beginner ·📰 AI News & Updates ·5y ago

Key Takeaways

This video demonstrates how to create interactive conversational bots for Microsoft Teams using the Microsoft Bot Framework, C#, and Node.js, covering topics such as conversational bot development, natural language processing, and artificial intelligence.

Full Transcript

welcome to the module on creating interactive conversational bots for microsoft teams hi i'm andrew connell i'm a microsoft mvp in the area of microsoft 365 development i have a lot of experience with sharepoint development microsoft graph microsoft teams developing add-ins for microsoft office as well as developing applications for microsoft identity including azure active directory this video is the first in a series of videos on this microsoft learning module this video is also part of a playlist that includes all the videos that are associated with this module so you can watch them in order the playlist and all its included videos are associated with a microsoft learning module that includes hands-on lab exercises and additional resources check the notes for this video in the associated playlist for more information and where to find the microsoft learning module okay let's get started conversational bots allow users to interact with your web service through text interactive adaptive cards and task modules these bots can be scoped to handling simple commands developers can also create complex artificial intelligence powered and natural language processing virtual agents this capability enables developers to create a guided interaction with your users in this video series you'll learn the basics of bots the microsoft bot framework and the steps required to register a bot in the microsoft teams app to interact with it from the microsoft team's client we're specifically going to cover what tasks are best handled by bots how to bots work how are bots and microsoft teams unique developing bots for microsoft teams and the basics of conversational bots let's start with an overview of bots and microsoft teams bots and microsoft teams can be part of a one-to-one conversation a group chat or a channel and a team each scope provides unique opportunities and challenges for your conversational bot bots contain threaded conversations between multiple people this potentially gives your bot massive reach but individual interactions need to be concise traditional multi-turn interactions probably won't work very well and instead look to use interactive cards or task modules or potentially move the conversation to a one-to-one conversation if you need to collect lots of information your bot only has access to messages where it is at mentioned directly you can retrieve additional message messages from the conversation using microsoft graph some scenarios where bots excel in a channel include notifications particularly if you provide an interactive card for users to take additional information feedback scenarios like polls and surveys and interactions that can be resolved in a single request response cycle where the results are useful for multiple members of the conversation bot chats are non-threaded conversations between three or more people and they tend to have fewer members in a channel and are much more transient similar to a channel a bot will only have access to messages where it is at mentioned directly scenarios that work well in a channel will usually work well in a group chat this is the traditional way for a conversation bot to interact with the user in a one-to-one personal chat they can enable diverse workloads qa bots bots that start workflows and other systems bots that tell jokes and bots that take notes are just a few examples remember to consider whether a conversation based interface is the best way to present your functionality so how do bots work conversational bots consist of three things a publicly accessible web service that you host your bot registration that registers your bot with the bot framework and your team's app package that contains your app manifest this is what your users install and connect to the team's client to your web services that are all routed through the bot service bots for microsoft teams are built on the microsoft bot framework microsoft recommends you use either c sharp or node.js to take advantage of their sdks these packages extend the basic bot builder sdk classes and methods they're going to use specialized card types such as adaptive cards they're going to send and receive microsoft teams channel specific data on activities and they're going to process messaging extension requests so how are bots and microsoft teams unique bots are created using the microsoft bot framework and are diverse and they can be used in multiple platforms bots developed for microsoft teams contain some differences from other platforms the primary difference in bots developed for microsoft teams is in how activities are handled the microsoft team's activity handler derives from the bot frameworks activity handler to route all teams activities before allowing any non-teams specific activities to be handled when a bot for microsoft teams receives an activity it passes it on to its activity handlers under the covers there's one base handler called the return the turn handler that all activities are routed through the turn handler calls the required activity handler to handle whatever type of activity was received where a bot is designated for microsoft team differs is that it's derived from a teams activity handler class that is derived from the bot frameworks activity handler class your conversational bot can subscribe to events unique to microsoft teams some of these events are as follows if you have team member events like team member added and team member removed channel events such as channel created renamed and deleted team events such as team renamed and messaging reactions such as reactions added or removed to create a conversational bot for microsoft teams you need the following things you need to create a web service register the web service as a bot with the microsoft bot framework create your microsoft team's app manifest and app package and upload your app package to microsoft teams microsoft provides sdks for multiple platforms including net and node.js and this video and all the demos that i have associated with this video will use the node.js sdk the heart of your bot is the web service it's going to define a single https route on which it receives all requests the microsoft bot framework will send a different type of message to your web service your web service can then inspect the type of message to route it to the wanted logic the other option is to use one of the available sdks that expose methods the sdk will call when messages matching the specific types are received for example when a message extension action command is in vote the sdk will direct the message type compose extension fetch task and it's going to call the method handle teams messaging extension fetch task that's going to then pass in a context and the payload from the message that was sent as an https post from the microsoft bot framework the following code defines a new bot that is watching for messages that contain the string mention me when it receives this message it responds with a message that starts with hi and then it at mentions the user who sent the original message now once you've created your web service you'll then register it as a bot with the microsoft bot framework and registering your web service with a bot framework provides a secure communication channel between the microsoft teams client and your web service the microsoft team's client and your web service never communicate directly and instead messages are routed through the microsoft bot framework service when you register a new bot with a microsoft bot framework you'll associate it with a new or an existing azure ad app and this app contains the app id and the secret that are used for the bot framework to authenticate with your web service and a microsoft teams app before deploying your microsoft teams app and custom bot to microsoft teams you need to define the bot within the custom app and this is done by adding an entry to the app's manifest file now you can use app studio to add a bot to the apps manifest file app studio can be can create a new app manifest file or you can import an existing one to add a bot to it the following json is taken from the app's manifest for the bot that you'll create in the next few demos within this module the bot defines a new command mention me that is displayed to users who want to interact with it and listening to all the supported commands isn't required but it does make your bot more user-friendly the last step is to then create the microsoft team's app package and upload it to microsoft teams and once this is done users can begin to use your bot a conversation is a series of messages sent between your bot and one or more users there are three kinds of conversations that are also called scopes in microsoft teams you've got teams which is called the channel conversation and also called a channel conversation and it's available it's visible to all members of the team at the channel a group chat is a conversation between the bot and two or more users and a personal conversation is between the bot and a single user a bots can behave slightly differently depending on what kind of a conversation it's involved in bots in a channel in a group chat conversation require that the user at mention the bot to invoke it in the channel or in the group chat while bots in a one-to-one conversation don't require an ad mentioned all messages that are sent by the user will be routed to your bot now each message is an activity object of type message type message when a user sends a message teams post the message to your bot specifically it sends a json object to your bot's messaging endpoint your bot examines the message to determine its type and respond correctly to receive a text message the text property of the activity object is going to be set and in the box activity handler you're going to use the turn context objects activity to read a single message request and to send a text message you're going to specify the string that you want to send as the activity and in the bots activity handler you're going to use the turn context objects send activity method to send a single message response

Original Description

Conversational bots allow user interaction with web services via text, cards, and task modules. In this module, learn how to create bots for Microsoft Teams. This video is part of a series in a playlist and is associated with a Microsoft Learning module: 'Create interactive conversational bots for Microsoft Teams'. Refer to the following URL to access the Microsoft Learning module for hands-on lab exercises and more resources: https://docs.microsoft.com/learn/modules/msteams-conversation-bots/
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Microsoft 365 Developer · Microsoft 365 Developer · 0 of 60

← Previous Next →
1 Adaptive Cards community call-February 2019
Adaptive Cards community call-February 2019
Microsoft 365 Developer
2 PowerApps community call-February 2019
PowerApps community call-February 2019
Microsoft 365 Developer
3 Microsoft Graph community call-March 2019
Microsoft Graph community call-March 2019
Microsoft 365 Developer
4 Office Add ins community call-March 2019
Office Add ins community call-March 2019
Microsoft 365 Developer
5 PowerApps community call-March 2019
PowerApps community call-March 2019
Microsoft 365 Developer
6 Microsoft Teams community call-March 2019
Microsoft Teams community call-March 2019
Microsoft 365 Developer
7 Using React and Office UI Fabric React Components
Using React and Office UI Fabric React Components
Microsoft 365 Developer
8 Build Microsoft Teams customization using SharePoint Framework
Build Microsoft Teams customization using SharePoint Framework
Microsoft 365 Developer
9 Microsoft Graph community call-April 2019
Microsoft Graph community call-April 2019
Microsoft 365 Developer
10 Using Change Notifications and Track Changes with Microsoft Graph
Using Change Notifications and Track Changes with Microsoft Graph
Microsoft 365 Developer
11 Office Add Ins community call-April 2019
Office Add Ins community call-April 2019
Microsoft 365 Developer
12 Adaptive Cards community call-April 2019
Adaptive Cards community call-April 2019
Microsoft 365 Developer
13 Microsoft Teams community call-April 2019
Microsoft Teams community call-April 2019
Microsoft 365 Developer
14 Getting Started with Microsoft Graph and Application Registration
Getting Started with Microsoft Graph and Application Registration
Microsoft 365 Developer
15 Getting Started with Microsoft Graph and the Directory API
Getting Started with Microsoft Graph and the Directory API
Microsoft 365 Developer
16 Getting Started with Microsoft Graph and Microsoft Teams
Getting Started with Microsoft Graph and Microsoft Teams
Microsoft 365 Developer
17 Getting Started with Microsoft Graph Explorer
Getting Started with Microsoft Graph Explorer
Microsoft 365 Developer
18 Getting Started with Microsoft Graph
Getting Started with Microsoft Graph
Microsoft 365 Developer
19 Getting Started with Microsoft Graph and Mail API
Getting Started with Microsoft Graph and Mail API
Microsoft 365 Developer
20 Getting Started with Microsoft Graph and Office 365 Groups
Getting Started with Microsoft Graph and Office 365 Groups
Microsoft 365 Developer
21 Getting Started with Microsoft Graph and the Calendar API
Getting Started with Microsoft Graph and the Calendar API
Microsoft 365 Developer
22 Getting Started with the Microsoft Graph Toolkit
Getting Started with the Microsoft Graph Toolkit
Microsoft 365 Developer
23 Getting Started with Microsoft Graph and JavaScript SDKs
Getting Started with Microsoft Graph and JavaScript SDKs
Microsoft 365 Developer
24 Getting Started with Microsoft Graph and .NET SDKs
Getting Started with Microsoft Graph and .NET SDKs
Microsoft 365 Developer
25 Discover how businesses can be more productive with Microsoft 365 integrations
Discover how businesses can be more productive with Microsoft 365 integrations
Microsoft 365 Developer
26 Adaptive Cards community call-May 2019
Adaptive Cards community call-May 2019
Microsoft 365 Developer
27 Office Add-ins community call-May 2019
Office Add-ins community call-May 2019
Microsoft 365 Developer
28 Why We Built on Microsoft Teams
Why We Built on Microsoft Teams
Microsoft 365 Developer
29 Microsoft Teams community call-May 2019
Microsoft Teams community call-May 2019
Microsoft 365 Developer
30 Microsoft Graph community call-June 2019
Microsoft Graph community call-June 2019
Microsoft 365 Developer
31 Build Angular SPA's with Microsoft Graph - June 2019
Build Angular SPA's with Microsoft Graph - June 2019
Microsoft 365 Developer
32 Office Add -ins community call-June 2019
Office Add -ins community call-June 2019
Microsoft 365 Developer
33 Build Android native apps with the Microsoft Graph Android SDK - June 2019
Build Android native apps with the Microsoft Graph Android SDK - June 2019
Microsoft 365 Developer
34 Build MVC apps with Microsoft Graph - June 2019
Build MVC apps with Microsoft Graph - June 2019
Microsoft 365 Developer
35 Authenticate and connect with Microsoft Graph - June 2019
Authenticate and connect with Microsoft Graph - June 2019
Microsoft 365 Developer
36 Microsoft Graph data connect - June 2019
Microsoft Graph data connect - June 2019
Microsoft 365 Developer
37 Change notifications with Microsoft Graph - June 2019
Change notifications with Microsoft Graph - June 2019
Microsoft 365 Developer
38 Build iOS native apps with the Microsoft Graph REST API - June 2019
Build iOS native apps with the Microsoft Graph REST API - June 2019
Microsoft 365 Developer
39 Build Node.js Express apps with Microsoft Graph - June 2019
Build Node.js Express apps with Microsoft Graph - June 2019
Microsoft 365 Developer
40 Smart UI with Microsoft Graph - June 2019
Smart UI with Microsoft Graph - June 2019
Microsoft 365 Developer
41 Leveraging the Microsoft Graph API from the SharePoint Framework - June 2019
Leveraging the Microsoft Graph API from the SharePoint Framework - June 2019
Microsoft 365 Developer
42 Build UWP apps with Microsoft Graph - June 2019
Build UWP apps with Microsoft Graph - June 2019
Microsoft 365 Developer
43 Build React SPA's with Microsoft Graph - June 2019
Build React SPA's with Microsoft Graph - June 2019
Microsoft 365 Developer
44 Getting Started with Microsoft Graph and Batching
Getting Started with Microsoft Graph and Batching
Microsoft 365 Developer
45 Getting Started with Microsoft Graph and Change Notifications
Getting Started with Microsoft Graph and Change Notifications
Microsoft 365 Developer
46 Getting Started with Microsoft Graph and Consent Permissions
Getting Started with Microsoft Graph and Consent Permissions
Microsoft 365 Developer
47 Getting Started with Microsoft Graph and Education
Getting Started with Microsoft Graph and Education
Microsoft 365 Developer
48 Getting Started with Microsoft Graph and Financials
Getting Started with Microsoft Graph and Financials
Microsoft 365 Developer
49 Getting Started with Microsoft Graph and Excel
Getting Started with Microsoft Graph and Excel
Microsoft 365 Developer
50 Getting Started with Microsoft Graph and Data Connect
Getting Started with Microsoft Graph and Data Connect
Microsoft 365 Developer
51 Getting Started with Microsoft Graph and Intune
Getting Started with Microsoft Graph and Intune
Microsoft 365 Developer
52 Getting Started with Microsoft Graph and Notifications
Getting Started with Microsoft Graph and Notifications
Microsoft 365 Developer
53 Getting Started with Microsoft Graph and OneNote
Getting Started with Microsoft Graph and OneNote
Microsoft 365 Developer
54 Getting Started with Microsoft Graph and OneDrive
Getting Started with Microsoft Graph and OneDrive
Microsoft 365 Developer
55 Getting Started with Microsoft Graph and Open Extensions
Getting Started with Microsoft Graph and Open Extensions
Microsoft 365 Developer
56 Getting Started with Microsoft Graph and Paging
Getting Started with Microsoft Graph and Paging
Microsoft 365 Developer
57 Getting Started with Microsoft Graph and Schema Extensions
Getting Started with Microsoft Graph and Schema Extensions
Microsoft 365 Developer
58 Getting Started with Microsoft Graph and Security API
Getting Started with Microsoft Graph and Security API
Microsoft 365 Developer
59 Getting Started with Microsoft Graph and Query Parameters
Getting Started with Microsoft Graph and Query Parameters
Microsoft 365 Developer
60 Getting Started with Microsoft Graph and Reporting API
Getting Started with Microsoft Graph and Reporting API
Microsoft 365 Developer

This video teaches viewers how to create interactive conversational bots for Microsoft Teams, covering topics such as conversational bot development, natural language processing, and artificial intelligence. Viewers will learn how to use the Microsoft Bot Framework, C#, and Node.js to build conversational bots that can interact with users through text, adaptive cards, and task modules.

Key Takeaways
  1. Define a single HTTPS route on which the web service receives all requests from the Microsoft Bot Framework
  2. Register the web service as a bot with the Microsoft Bot Framework
  3. Create a Microsoft Teams app manifest and app package
  4. Upload the app package to Microsoft Teams
  5. Register a new bot with Microsoft Bot Framework
  6. Associate bot with Azure AD app
  7. Define bot within custom app manifest file
  8. Create Microsoft Teams app package
  9. Upload app package to Microsoft Teams
💡 Conversational bots can be scoped to handling simple commands or complex artificial intelligence-powered and natural language processing virtual agents, and can be part of a one-to-one conversation, group chat, or channel in Microsoft Teams.

Related Reads

📰
Netflix used AI in 300 shows. Its biggest director calls AI a Trojan horse.
Netflix's use of AI in 300 shows sparks debate among Hollywood directors and unions, highlighting the need for discussion on AI's role in the industry
The Next Web AI
📰
NRED Is Moving From Target Generation to Operational Intelligence
NRED shifts focus from target generation to operational intelligence, leveraging MetalCore and EyeX platforms
Medium · AI
📰
The top AI fear for 6,000 tech pros isn't losing their jobs - it's more work for the same pay
Tech pros fear increased workload due to AI, not job loss, and are hesitant to recommend their role to newcomers
ZDNet
📰
Only10 Vol.26.01 | 10 AI Projects Worth Watching This Week
Discover 10 noteworthy AI projects using the CRP framework to stay updated on the latest developments in the field
Medium · ChatGPT
Up next
Why Marketers Should Join an AI Community? Best Group To Learn AI (Karl Hudson ft James Dooley)
James Dooley
Watch →