Build bots for Teams
A bot is also referred to as a chatbot or conversational bot. It's an app that runs simple and repetitive tasks by users such as customer service or support staff. Everyday use of bots include, bots that provide information about the weather, make dinner reservations, or provide travel information. Interactions with bots can be quick questions and answers or complex conversations.
It's recommended to start with build your first bot app using JavaScript or build notification bot with JavaScript by using the new generation development tool for Teams. For more information, see Teams Toolkit overview.
Important
Bots are available in Government Community Cloud (GCC), GCC-High, and Department of Defense (DOD) environments. Bot applications within Microsoft Teams for GCC-High and DOD are available through Azure bot Service and bot channel registration must be done in Azure Government portal.
Image URLs in Adaptive Cards aren't supported in GCC-High and DOD environments. You can replace an image URL with Base64 encoded DataUri.
When a user changes the Teams theme in a bot, the theme doesn’t apply to the content shared using an Adaptive Card.
Conversational bots allow users to interact with your web service using text, interactive cards, and dialogs (referred as task modules in TeamsJS v1.x).
Conversational bots are incredibly flexible. Bots can handle a few basic commands or complex tasks that involve artificial intelligence and natural language processing. Bots can be part of a larger application or be standalone.
Use the right mix of cards, text, and dialogs to create a useful bot. The following image shows a user conversing with a bot in a one-to-one chat using text and interactive cards.
Every interaction between the user and the bot is represented as an activity. When a bot receives an activity, it passes it on to its activity handlers. See bot activity handlers.
Bots are apps that have a conversational interface. You can interact with a bot using text, interactive cards, and speech. A bot behaves differently in a channel or group chat conversation and in a one-to-one conversation. Conversations are handled through the Bot Framework connector. See conversation basics.
Your bot requires contextual information, such as user profile details to access relevant content and enhance the bot experience. See get Teams context.
You can send and receive files through the bot using Graph APIs or Teams bot APIs. See send and receive files through the bot.
Rate limiting is used to optimize bots used for your Teams application. To protect Teams and its users, the bot APIs provide a rate limit for incoming requests. See optimize your bot with rate limiting in Teams.
With Microsoft Graph APIs for calls and online meetings, Teams apps can now interact with users using voice and video. See calls and meetings bots.
You can use the Teams bot APIs to get information for members of a chat or team. See changes to Teams bot APIs for fetching team or chat members.
You can change the bot name displayed in Teams environment, and you need to update it in the following occurrences:
The bot name displayed as a title in the chat window is managed within your app manifest (previously called Teams app manifest) and you can update the bot name in your app manifest.
The bot name that's displayed in your Teams chat list and in the chat window with each message are managed within Microsoft Azure portal. For custom uploaded apps, you can update the bot name in the Bot profile page in Azure portal.
Add SSO authentication to your conversation bots
You can add single sign-on authentication to your conversation bot using the following steps:
Bot configuration experience
Bot configuration experience helps you to enable the bot settings for users to configure their bot during installation and reconfigure the bot from the channel or group chat scope where the bot is installed. Bot configuration is an important functionality for apps within the Teams platform, laying the foundation for their operational effectiveness. For more information, see bot configuration experience.
Code samples
Sample name | Description | .NET | Node.js | Manifest |
---|---|---|---|---|
Bot daily task reminder | This sample shows how to schedule a recurring task and get a reminder at a scheduled time using bot. | View | View | View |
Hello world bot | This is a simple hello world application with both bot and message extension capabilities. | NA | View | |
Adaptive Card notification | This is a sample, which shows how to send notifications with different Adaptive Cards using bots. | NA | View | |
Incoming Webhook notification | This is a sample, which shows how to send notifications using Incoming Webhook in Microsoft Teams channels. | NA | View |
Next step
See also
- How Microsoft Teams bots work
- Designing your Microsoft Teams bot
- Create a bot for Teams
- Test and debug your Microsoft Teams bot
- Build your first bot app using JavaScript
- Add authentication to your Teams bot
- Use dialogs from bots
- Create Incoming Webhooks
- Instrumenting for Teams app specific analytics