SlideShare a Scribd company logo
Bot & AI
Marvin Heng, Microsoft MVP
https://www.techconnect.io
@hmheng
“To him,
turning innovative ideas into
reality is great excitement and
achievement.”
Microsoft MVP | Tech + AI Enthusiast
Marvin Heng
#GlobalAIBootcamp
@hmheng
What is Bot?
A chatbot is an artificial intelligence (AI) software that
can simulate a conversation (or a chat) with a user in
natural language.
Why Do I Need a Bot?
A chatbot is said to bring the following benefits
Be Pioneer
Chatbot is highly intelligent solution that
allows human-like interaction.
And it is 24/7 throughout the year.
Improve Satisfaction
User/Customers satisfaction is proven to
be improved by implementing bot into
your businesses.
Boost Productivity
By integrating bot into your productivity
apps, it is highly possible to automate a
lot of processes.
Chatbot & Productivity
Conversations
Notification-Only Bots
Sending and Receiving Files (Preview)
DEMO
Bots in Microsoft Teams
Conversations
Series of messages sent between your bot and one or more users. Conversations are in one of
the following scopes:
Teams
Also called channel conversations,
visible to all members of the channel.
Personal
Conversations between bots and a
single user.
Group chat
Chat between a bot and two or more
users.
(In developer preview – Sep 2018)
Bot Events in Microsoft Teams
Activity objects are used to pass information back and forth between bot and channel (or user).
Activities can represent Events, denoted by ActivityType == ‘conversationUpdate’
Team Member Events
teamMemberAdded
teamMemberRemoved
Payload object contains
added/removed members
*Adding bot fires this event
Channel Events
channelCreated
channelRenamed
channelDeleted
ChannelData object reflects
current state
Reactions
reactionsAdded
reactionsRemoved
replyToId contains the ID of the
specific message
Team Events
teamRenamed
ChannelData object reflects
current state
Teams Context
Your bot can access additional context about the team or chat, such as user profile. This information
can be used to enrich your bot's functionality and provide a more personalized experience.
Members in conversation
var mbrs = await connector.Conversations
.GetConversationMembersAsync(
message.Conversation.Id
);
foreach (var mbr in mbrs.AsTeamsChannelAccounts())
{
[...]
}
Channels in Team
ConversationList channels =
client
.GetTeamsConnectorClient()
.Teams
.FetchChannelList(
activity.GetChannelData<TeamsChannelData>()
.Team.Id
);
Proactive Messaging
A proactive message is an activity sent by a bot to start a conversation
Start Personal conversation
Must have user’s information cached
• From team roster
• From previous interaction with user
• From conversationUpdate events
Use the CreateOrGetDirectConversation method
Start Channel conversation
Must have channel information cached
• From previous interaction in channel
• From conversationUpdate events
To create conversation:
• Create ConnectorClient with service Uri
• Call connector.Conversations.CreateConversationAsync,
passing channel account for bot
• Set Conversation property of new message
• Call connector.Conversations.SendToConversationAsync
Activity Feed
Optionally send personal chat messages into the
feed as preview cards summarizing your app's
activity.
Construct the message such that choosing the card
navigates the user straight to the message or object
that triggered the notification, such as an entity in a
tab.
Must include Text and Summary properties
Notification only bots
Bots can update the activity feed
If the sole purpose of the bot is to deliver notifications,
consider a notification only bot.
• Users cannot message your notification-only bot
• Users cannot @mention the bot
bots node
isNotificationOnly property
"bots": [
{
"botId": "[MicrosoftAppId]",
"scopes": [
"personal",
"team"
],
"isNotificationOnly": true,
}
]
Send and Receive file
Sending and receiving files through a bot can be accomplished via two different APIs
Microsoft Graph API
Obtain access to OneDrive folder (user or group drive)
Get reference to file
Post message to conversation with card attachment
Microsoft Teams API
Personal context (1:1) only
Enable files in manifest
Teams client provides a file picker experience
Teams client will store file in OneDriveCreate and then post
activity with metadata, including content URL
Bot must download and handle file as appropriate
Enable send and receive
Teams client will handle file selection and
storage
Handles scenario User -> Bot
bots node
supportsFiles property
"bots": [
{
"botId": "[MicrosoftAppId]",
"scopes": [
"personal",
"team"
],
"supportsFiles": true,
}
]
Demo
Sending and Receiving files
Events and Queries
Responding to User Requests
Message Extensions in App Manifest
Demo
Messaging Extensions
Events and Queries
Activity payload
Type is invoke
Name identifies type of event
composeExtension/query
composeExtension/querySettingUrl
composeExtension/setting
Sent to registered bot endpoint
Teams Connector NuGet package provides
detection methods and data models
Events and Queries
Query events
Query data sent to bot
Activity.GetComposeExtensionQueryData()
• Verify commandId and parameters
• Use parameter value to query your service
Respond with attachment layout of “List”
Events and Queries
Settings events
If canUpdateConfiguration is true, Teams
will send Settings events in response to
user action
onQuerySettingsUrl
• Sent when “Settings” clicked
• Return Url of settings page
• Teams will render page
onSettingsUpdate
• Sent when settings page is closed
• Storage of settings is developer
responsibility
Responding to User Requests
Service must respond within 5 seconds.
Response is not an activity sent via the Bot Framework.
Response is an HTTP Response:
• HTTP Status of 200
• Content type application/json
• Response body must contain a valid composeExtension object.
Message Extensions in App Manifest
composeExtension node
Associated with a registered application
Personal and Team scopes
Define command UI and parameter
Multiple extensions
Your extension shown along
with all others added to Teams
"composeExtensions": [
{
"botId": "[MicrosoftAppId]",
"scopes": [
"team"
],
"canUpdateConfiguration": true,
"commands": [
{
"id": "searchCmd",
"description": "Search Bot Channels",
"title": "Bot Channels",
"initialRun": false,
"parameters": [
{
"name": "searchText",
"description": "Enter your search text",
"title": "Search Text“
}
]
}
]
}
]
Demo
Messaging Extension
Using Cards in Bots
Using Cards in Messaging Extensions
Adaptive Cards support in Microsoft Teams
DEMO
Using Cards in Microsoft Teams
Using Cards in Bots
Adaptive Card
A customizable card that can contain any
combination of text, speech, images,
buttons, and input fields.
Supported in Teams, Outlook, Windows,
etc.
Hero
Largest card
Best used for articles, long descriptions or
scenarios where your image is telling most of
the story
Receipt
A card that enables a bot to provide a receipt
to the user. It typically contains the list of items
to include on the receipt, tax and total
information, and other text.
Using Cards in Messaging Extensions
Respond with attachment layout of “List”
Format each query result as a card
Do not include actions
Adaptive Cards support in Microsoft Teams
Microsoft Teams supports three action types for Adaptive cards:
• Action.OpenUrl
• Action.Submit
• Action.ShowCard
Actions other than these are not supported
Demo
Adaptive Cards in Microsoft Teams
Summary
Conversations
Notification-Only Bots
Sending and Receiving Files (Preview)
Events and Queries
Responding to User Requests
Message Extensions in App Manifest
Using Cards in Bots
Using Cards in Messaging Extensions
Adaptive Cards support in Microsoft Teams
Content References
OfficeDev – Bot, Messaging Extensions
and Cards by Microsoft
Thank you!
Bot & AI
Marvin Heng, Microsoft MVP

More Related Content

PPTX
Building apps for microsoft teams - aossg
PPTX
Microsoft Team Messaging Extension Deep Dive
PPTX
Bots, adaptive cards, task module, message extensions in microsoft teams
PPTX
Bots, adaptive cards, task module, message extensions in microsoft teams
PPTX
Sps mad2019 es el momento, empieza a desarrollar para microsoft teams
PPTX
Microsoft Bot Framework (Node.js Edition)
PPTX
Practical Microsoft Bot Framework for Office 365 developers
PPTX
Azure Bot Framework
Building apps for microsoft teams - aossg
Microsoft Team Messaging Extension Deep Dive
Bots, adaptive cards, task module, message extensions in microsoft teams
Bots, adaptive cards, task module, message extensions in microsoft teams
Sps mad2019 es el momento, empieza a desarrollar para microsoft teams
Microsoft Bot Framework (Node.js Edition)
Practical Microsoft Bot Framework for Office 365 developers
Azure Bot Framework

Similar to Bot & AI - A Bot for Productivity (20)

PPTX
Office Dev Day 2018 - Extending Microsoft Teams
PPTX
Global office 365 developer bootcamp Slovenia 2018
PPTX
Microsoft Teams Development - Conversational AI
PDF
Thr2426 Build a bot for Microsoft Teams in 5 minutes
PPTX
Microsoft teams & bot framework - A developer's perspective
PPTX
Blazor + Bot Framework = a Microsoft Teams Platform Dream Team
PPTX
Rapid development & integration of real time communication in websites
PPTX
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s Perspective
PPTX
Microsoft Teams - A developers perspective
PPTX
Deep dive into advanced teams development
PDF
Webinar - Building a ChatBot using IBM Watson Conversation Service
PPTX
Facebook Messenger Platform Framework
PPTX
M365 Teams Automation
PPTX
Tokyo azure meetup #13 build bots with azure bot services
PPTX
Diwug 2019 Teams Development
PDF
Intégrez vos applications métiers dans Microsoft Teams
PPTX
Build and integrate conversational series with Microsoft Teams Bot
PPTX
Build Microsoft Teams Apps with Teams App Studio
PDF
[2019 Serverless Summit] Building Serverless Slack Chatbot on IBM Cloud Func...
PPTX
Azure Bot Services - Malaysia
Office Dev Day 2018 - Extending Microsoft Teams
Global office 365 developer bootcamp Slovenia 2018
Microsoft Teams Development - Conversational AI
Thr2426 Build a bot for Microsoft Teams in 5 minutes
Microsoft teams & bot framework - A developer's perspective
Blazor + Bot Framework = a Microsoft Teams Platform Dream Team
Rapid development & integration of real time communication in websites
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s Perspective
Microsoft Teams - A developers perspective
Deep dive into advanced teams development
Webinar - Building a ChatBot using IBM Watson Conversation Service
Facebook Messenger Platform Framework
M365 Teams Automation
Tokyo azure meetup #13 build bots with azure bot services
Diwug 2019 Teams Development
Intégrez vos applications métiers dans Microsoft Teams
Build and integrate conversational series with Microsoft Teams Bot
Build Microsoft Teams Apps with Teams App Studio
[2019 Serverless Summit] Building Serverless Slack Chatbot on IBM Cloud Func...
Azure Bot Services - Malaysia
Ad

More from Marvin Heng (20)

PDF
Accelerating Personal Development through Microsoft Certifications
PDF
Microsoft BotFramework - Global AI Bootcamp Nepal 2022
PDF
Microsoft Cognitive Services at a Glance
PDF
Create real value in your business process by automated data and form extraction
PDF
A Journey with Microsoft Cognitive Service I
PDF
A Journey With Microsoft Cognitive Services II
PDF
AI and App Accessibility
PDF
What's New With Azure AI
PDF
Intelligent Assistant with Microsoft BotFramework
PDF
Using AI to solve business challenges
PDF
Intelligent Mobile App with Azure Custom Vision
PDF
Azure Cognitive Services for Developers
PDF
Artificial Intelligence - Tell You What I See
PDF
Handwriting Detection with Microsoft Cognitive Services
PDF
Create a Q&A Bot to Serve Your Customers
PDF
Facial Analysis with Angular Web App & ASP.NET Core
PDF
AI/ML/DL: Introduction to Deep Learning with Cognitive ToolKit
PDF
AI/ML/DL: Getting Started with Machine Learning on Azure
PDF
AI: Integrate Search Function into Your App Using Bing Search API.
PDF
Artificial Intelligent: Intelligent Bot With Microsoft Bot Framework & Azure
Accelerating Personal Development through Microsoft Certifications
Microsoft BotFramework - Global AI Bootcamp Nepal 2022
Microsoft Cognitive Services at a Glance
Create real value in your business process by automated data and form extraction
A Journey with Microsoft Cognitive Service I
A Journey With Microsoft Cognitive Services II
AI and App Accessibility
What's New With Azure AI
Intelligent Assistant with Microsoft BotFramework
Using AI to solve business challenges
Intelligent Mobile App with Azure Custom Vision
Azure Cognitive Services for Developers
Artificial Intelligence - Tell You What I See
Handwriting Detection with Microsoft Cognitive Services
Create a Q&A Bot to Serve Your Customers
Facial Analysis with Angular Web App & ASP.NET Core
AI/ML/DL: Introduction to Deep Learning with Cognitive ToolKit
AI/ML/DL: Getting Started with Machine Learning on Azure
AI: Integrate Search Function into Your App Using Bing Search API.
Artificial Intelligent: Intelligent Bot With Microsoft Bot Framework & Azure
Ad

Recently uploaded (20)

PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
MYSQL Presentation for SQL database connectivity
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPT
Teaching material agriculture food technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Approach and Philosophy of On baking technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Empathic Computing: Creating Shared Understanding
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Cloud computing and distributed systems.
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Unlocking AI with Model Context Protocol (MCP)
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine learning based COVID-19 study performance prediction
Programs and apps: productivity, graphics, security and other tools
MYSQL Presentation for SQL database connectivity
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Teaching material agriculture food technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Approach and Philosophy of On baking technology
MIND Revenue Release Quarter 2 2025 Press Release
Empathic Computing: Creating Shared Understanding
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Reach Out and Touch Someone: Haptics and Empathic Computing
Cloud computing and distributed systems.
Review of recent advances in non-invasive hemoglobin estimation
Unlocking AI with Model Context Protocol (MCP)

Bot & AI - A Bot for Productivity

  • 1. Bot & AI Marvin Heng, Microsoft MVP
  • 2. https://www.techconnect.io @hmheng “To him, turning innovative ideas into reality is great excitement and achievement.” Microsoft MVP | Tech + AI Enthusiast Marvin Heng
  • 5. A chatbot is an artificial intelligence (AI) software that can simulate a conversation (or a chat) with a user in natural language.
  • 6. Why Do I Need a Bot? A chatbot is said to bring the following benefits Be Pioneer Chatbot is highly intelligent solution that allows human-like interaction. And it is 24/7 throughout the year. Improve Satisfaction User/Customers satisfaction is proven to be improved by implementing bot into your businesses. Boost Productivity By integrating bot into your productivity apps, it is highly possible to automate a lot of processes.
  • 8. Conversations Notification-Only Bots Sending and Receiving Files (Preview) DEMO Bots in Microsoft Teams
  • 9. Conversations Series of messages sent between your bot and one or more users. Conversations are in one of the following scopes: Teams Also called channel conversations, visible to all members of the channel. Personal Conversations between bots and a single user. Group chat Chat between a bot and two or more users. (In developer preview – Sep 2018)
  • 10. Bot Events in Microsoft Teams Activity objects are used to pass information back and forth between bot and channel (or user). Activities can represent Events, denoted by ActivityType == ‘conversationUpdate’ Team Member Events teamMemberAdded teamMemberRemoved Payload object contains added/removed members *Adding bot fires this event Channel Events channelCreated channelRenamed channelDeleted ChannelData object reflects current state Reactions reactionsAdded reactionsRemoved replyToId contains the ID of the specific message Team Events teamRenamed ChannelData object reflects current state
  • 11. Teams Context Your bot can access additional context about the team or chat, such as user profile. This information can be used to enrich your bot's functionality and provide a more personalized experience. Members in conversation var mbrs = await connector.Conversations .GetConversationMembersAsync( message.Conversation.Id ); foreach (var mbr in mbrs.AsTeamsChannelAccounts()) { [...] } Channels in Team ConversationList channels = client .GetTeamsConnectorClient() .Teams .FetchChannelList( activity.GetChannelData<TeamsChannelData>() .Team.Id );
  • 12. Proactive Messaging A proactive message is an activity sent by a bot to start a conversation Start Personal conversation Must have user’s information cached • From team roster • From previous interaction with user • From conversationUpdate events Use the CreateOrGetDirectConversation method Start Channel conversation Must have channel information cached • From previous interaction in channel • From conversationUpdate events To create conversation: • Create ConnectorClient with service Uri • Call connector.Conversations.CreateConversationAsync, passing channel account for bot • Set Conversation property of new message • Call connector.Conversations.SendToConversationAsync
  • 13. Activity Feed Optionally send personal chat messages into the feed as preview cards summarizing your app's activity. Construct the message such that choosing the card navigates the user straight to the message or object that triggered the notification, such as an entity in a tab. Must include Text and Summary properties
  • 14. Notification only bots Bots can update the activity feed If the sole purpose of the bot is to deliver notifications, consider a notification only bot. • Users cannot message your notification-only bot • Users cannot @mention the bot bots node isNotificationOnly property "bots": [ { "botId": "[MicrosoftAppId]", "scopes": [ "personal", "team" ], "isNotificationOnly": true, } ]
  • 15. Send and Receive file Sending and receiving files through a bot can be accomplished via two different APIs Microsoft Graph API Obtain access to OneDrive folder (user or group drive) Get reference to file Post message to conversation with card attachment Microsoft Teams API Personal context (1:1) only Enable files in manifest Teams client provides a file picker experience Teams client will store file in OneDriveCreate and then post activity with metadata, including content URL Bot must download and handle file as appropriate
  • 16. Enable send and receive Teams client will handle file selection and storage Handles scenario User -> Bot bots node supportsFiles property "bots": [ { "botId": "[MicrosoftAppId]", "scopes": [ "personal", "team" ], "supportsFiles": true, } ]
  • 18. Events and Queries Responding to User Requests Message Extensions in App Manifest Demo Messaging Extensions
  • 19. Events and Queries Activity payload Type is invoke Name identifies type of event composeExtension/query composeExtension/querySettingUrl composeExtension/setting Sent to registered bot endpoint Teams Connector NuGet package provides detection methods and data models
  • 20. Events and Queries Query events Query data sent to bot Activity.GetComposeExtensionQueryData() • Verify commandId and parameters • Use parameter value to query your service Respond with attachment layout of “List”
  • 21. Events and Queries Settings events If canUpdateConfiguration is true, Teams will send Settings events in response to user action onQuerySettingsUrl • Sent when “Settings” clicked • Return Url of settings page • Teams will render page onSettingsUpdate • Sent when settings page is closed • Storage of settings is developer responsibility
  • 22. Responding to User Requests Service must respond within 5 seconds. Response is not an activity sent via the Bot Framework. Response is an HTTP Response: • HTTP Status of 200 • Content type application/json • Response body must contain a valid composeExtension object.
  • 23. Message Extensions in App Manifest composeExtension node Associated with a registered application Personal and Team scopes Define command UI and parameter Multiple extensions Your extension shown along with all others added to Teams "composeExtensions": [ { "botId": "[MicrosoftAppId]", "scopes": [ "team" ], "canUpdateConfiguration": true, "commands": [ { "id": "searchCmd", "description": "Search Bot Channels", "title": "Bot Channels", "initialRun": false, "parameters": [ { "name": "searchText", "description": "Enter your search text", "title": "Search Text“ } ] } ] } ]
  • 25. Using Cards in Bots Using Cards in Messaging Extensions Adaptive Cards support in Microsoft Teams DEMO Using Cards in Microsoft Teams
  • 26. Using Cards in Bots Adaptive Card A customizable card that can contain any combination of text, speech, images, buttons, and input fields. Supported in Teams, Outlook, Windows, etc. Hero Largest card Best used for articles, long descriptions or scenarios where your image is telling most of the story Receipt A card that enables a bot to provide a receipt to the user. It typically contains the list of items to include on the receipt, tax and total information, and other text.
  • 27. Using Cards in Messaging Extensions Respond with attachment layout of “List” Format each query result as a card Do not include actions
  • 28. Adaptive Cards support in Microsoft Teams Microsoft Teams supports three action types for Adaptive cards: • Action.OpenUrl • Action.Submit • Action.ShowCard Actions other than these are not supported
  • 29. Demo Adaptive Cards in Microsoft Teams
  • 30. Summary Conversations Notification-Only Bots Sending and Receiving Files (Preview) Events and Queries Responding to User Requests Message Extensions in App Manifest Using Cards in Bots Using Cards in Messaging Extensions Adaptive Cards support in Microsoft Teams
  • 31. Content References OfficeDev – Bot, Messaging Extensions and Cards by Microsoft
  • 33. Bot & AI Marvin Heng, Microsoft MVP