Updates from: 06/07/2022 01:28:13
Service Microsoft Docs article Related commit history on GitHub Change details
platform Auth Aad Sso Bots https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/bots/how-to/authentication/auth-aad-sso-bots.md
Open [Teams auth sample](https://github.com/microsoft/BotBuilder-Samples/tree/ma
## Step-by-step guide
-Follow the [step-by-step guide](../../../sbs-bots-with-sso.yml), which helps you to create a bot with SSO authentication enabled.
+Follow the [step-by-step guide](../../../sbs-bots-with-sso.yml), to build a bot with SSO authentication.
platform Subscribe To Conversation Events https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/bots/how-to/conversations/subscribe-to-conversation-events.md
When building your conversational bots for Microsoft Teams, you can work with co
* Trigger a welcome message when a new team member is added or removed. * Trigger a notification when a channel is created, renamed, or deleted. * Trigger a notification when a bot message is liked by a user.
+* Identify the default channel for your bot from user input (selection) during installation.
## Conversation update events
-You can use conversation update events to provide better notifications and more effective bot actions.
+You can use conversation update events to provide better notifications and effective bot actions.
> [!IMPORTANT] >
The following table shows a list of Teams conversation update events with more d
| Channel renamed | channelRenamed | OnTeamsChannelRenamedAsync | [A channel is renamed](#channel-renamed). | Team | | Channel deleted | channelDeleted | OnTeamsChannelDeletedAsync | [A channel is deleted](#channel-deleted). | Team | | Channel restored | channelRestored | OnTeamsChannelRestoredAsync | [A channel is restored](#channel-deleted). | Team |
-| Members added | membersAdded | OnTeamsMembersAddedAsync | [A member is added](#team-members-added). | All |
-| Members removed | membersRemoved | OnTeamsMembersRemovedAsync | [A member is removed](#team-members-removed). | groupChat and team |
+| Members added | membersAdded | OnTeamsMembersAddedAsync | [A member is added](#members-added). | All |
+| Members removed | membersRemoved | OnTeamsMembersRemovedAsync | [A member is removed](#members-removed). | All |
| Team renamed | teamRenamed | OnTeamsTeamRenamedAsync | [A team is renamed](#team-renamed). | Team | | Team deleted | teamDeleted | OnTeamsTeamDeletedAsync | [A team is deleted](#team-deleted). | Team | | Team archived | teamArchived | OnTeamsTeamArchivedAsync | [A team is archived](#team-archived). | Team |
The following table shows a list of Teams conversation update events with more d
### Channel created
-The channel created event is sent to your bot whenever a new channel is created in a team where your bot is installed.
+The `channelCreated` event is sent to your bot whenever a new channel is created in a team where your bot is installed.
The following code shows an example of channel created event:
async def on_teams_channel_created(
### Channel renamed
-The channel renamed event is sent to your bot whenever a channel is renamed in a team where your bot is installed.
+The `channelRenamed` event is sent to your bot whenever a channel is renamed in a team where your bot is installed.
The following code shows an example of channel renamed event:
async def on_teams_channel_renamed(
### Channel deleted
-The channel deleted event is sent to your bot, whenever a channel is deleted in a team where your bot is installed.
+The `channelDeleted` event is sent to your bot, whenever a channel is deleted in a team where your bot is installed.
The following code shows an example of channel deleted event:
async def on_teams_channel_deleted(
### Channel restored
-The channel restored event is sent to your bot, whenever a channel that was previously deleted is restored in a team where your bot is already installed.
+The `channelRestored` event is sent to your bot, whenever a channel that was previously deleted is restored in a team where your bot is already installed.
The following code shows an example of channel restored event:
async def on_teams_channel_restored(
-### Team members added
+### Members added
-The `teamMemberAdded` event is sent to your bot the first time it's added to a conversation. The event is sent to your bot every time a new user is added to a team or group chat where your bot is installed. The user information that is ID, is unique for your bot and can be cached for future use by your service, such as sending a message to a specific user.
+A member added event is sent to your bot in the following scenarios:
+
+1. When the bot, itself, is installed and added to a conversation
+
+ > In team context, the activity's conversation.id is set to the `id` of the channel selected by the user during app installation or the channel where the bot was installed from (currently available in [Public Developer Preview](../../../resources/dev-preview/developer-preview-intro.md)).
+
+2. When a user is added to a conversation where the bot is installed
+
+ > User ids received in the event payload are unique to the bot and can be cached for future use, such as directly messaging a user.
+
+The member added activity `eventType` is set to `teamMemberAdded` when the event is sent from a team context. To determine if the new member added was the bot itself or a user, check the `Activity` object of the `turnContext`. If the `MembersAdded` list contains an object where `id` is the same as the `id` field of the `Recipient` object, then the member added is the bot, else it's a user. The bot's `id` is formatted as `28:<MicrosoftAppId>`.
+
+> [!TIP]
+> Use the [`InstallationUpdate` event](#installation-update-event) to determine when when your bot is added or removed from a conversation.
The following code shows an example of team members added event:
export class MyBot extends TeamsActivityHandler {
# [JSON](#tab/json)
-This is the message your bot receives when the bot is added to a team.
+The message your bot receives when the bot is added to a team.
+
+> [!NOTE]
+> In this payload, `conversation.id` and `channelData.settings.selectedChannel.id` will be the id of the channel that the user selected during app installation or where installation was triggered from.
```json {
+ "type": "conversationUpdate",
"membersAdded": [ {
- "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0"
+ "id": "28:608cacfd-1cea-40c9-b678-4b93e69bb72b"
} ],
- "type": "conversationUpdate",
- "timestamp": "2017-02-23T19:38:35.312Z",
- "localTimestamp": "2017-02-23T12:38:35.312-07:00",
- "id": "f:5f85c2ad",
+ "timestamp": "2021-12-07T22:34:56.534Z",
+ "id": "f:0b9079f4-d4d3-3d8e-b883-798298053c7e",
"channelId": "msteams",
- "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
+ "serviceUrl": "https://smba.trafficmanager.net/amer/",
"from": {
- "id": "29:1I9Is_Sx0OIy2rQ7Xz1lcaPKlO9eqmBRTBuW6XzkFtcjqxTjPaCMij8BVMdBcL9L_RwWNJyAHFQb0TRzXgyQvA"
+ "id": "29:1ljv6N86roXr5pjPrCJVIz6xHh5QxjI....",
+ "aadObjectId": "eddfa9d4-346e-4cce-a18f-fa6261ad776b"
}, "conversation": { "isGroup": true, "conversationType": "channel",
- "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
+ "tenantId": "b28fdbfd-2b78-4f93-b0f8-8881793f0f8f",
+ "id": "19:0b7f32667e064dd9b25d7969801541f4@thread.tacv2",
+ "name": "2021 Test Channel"
}, "recipient": {
- "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
- "name": "SongsuggesterBot"
+ "id": "28:608cacfd-1cea-40c9-b678-4b93e69bb72b",
+ "name": "Test Bot"
}, "channelData": {
+ "settings": {
+ "selectedChannel": {
+ "id": "19:0b7f32667e064dd9b25d7969801541f4@thread.tacv2"
+ }
+ },
"team": {
- "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
+ "aadGroupId": "f3ec8cd2-e704-4344-8c47-9a3a21d683c0",
+ "name": "TestTeam2022",
+ "id": "19:zFLSDFWsesfzcmKArqKJ-65aOXJz@sgf462H2wz41@thread.tacv2"
}, "eventType": "teamMemberAdded", "tenant": {
- "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
+ "id": "b28fdbfd-2b78-4f93-b0f8-8881793f0f8f"
} } } ```
-This is the message your bot receives when the bot is added to a one-to-one chat.
+The message your bot receives when the bot is added to a one-to-one chat.
```json {
async def on_teams_members_added(
-### Team members removed
+### Members removed
+
+A member removed event is sent to your bot in the following scenarios:
+
+1. When the bot, itself, is uninstalled and removed from a conversation.
+2. When a user is removed from a conversation where the bot is installed.
+
+The member removed activity `eventType` is set to `teamMemberRemoved` when the event is sent from a team context. To determine if the new member removed was the bot itself or a user, check the `Activity` object of the `turnContext`. If the `MembersRemoved` list contains an object where `id` is the same as the `id` field of the `Recipient` object, then the member added is the bot, else it's a user. The bot's id is formatted as `28:<MicrosoftAppId>`.
-The `teamMemberRemoved` event is sent to your bot if it's removed from a team. The event is sent to your bot every time any user is removed from a team where your bot is a member. To determine if the new member removed was the bot itself or a user, check the `Activity` object of the `turnContext`. If the `Id` field of the `MembersRemoved` object is the same as the `Id` field of the `Recipient` object, then the member removed is the bot, else it's a user. The bot's `Id` generally is `28:<MicrosoftAppId>`.
> [!NOTE] > When a user is permanently deleted from a tenant, `membersRemoved conversationUpdate` event is triggered.
async def on_teams_team_renamed(
### Team deleted
-Your bot is notified when the team is deleted. It receives a `conversationUpdate` event with `eventType.teamDeleted` in the `channelData` object.
+The bot receives a notification when the team is deleted. It receives a `conversationUpdate` event with `eventType.teamDeleted` in the `channelData` object.
The following code shows an example of team deleted event:
The bot receives an `installationUpdate` event when you install a bot to a conve
Use the `installationUpdate` event to send an introductory message from your bot on installation. This event helps you to meet your privacy and data retention requirements. You can also clean up and delete user or thread data when the bot is uninstalled.
+Similar to the `conversationUpdate` event that's sent when bot is added to a team, the conversation.id of the `installationUpdate` event is set to the id of the channel selected by a user during app installation or the channel where the installation occurred. The id represents the channel where the user intends for the bot to operate and must be used by the bot when sending a welcome message. For scenarios where the ID of the General channel is explicitly required, you can get it from `team.id` in `channelData`.
+
+In this example, the `conversation.id` of the `conversationUpdate` and `installationUpdate` activities will be set to the ID of the Response channel in the Daves Demo team.
+
+![Create a selected channel](~/assets/videos/addteam.gif)
+
+> [!NOTE]
+> The selected channel id is only set on `installationUpdate` *add* events that are sent when an app is installed into a team (currently available in [Public Developer Preview](../../../resources/dev-preview/developer-preview-intro.md)).
+ # [C#](#tab/dotnet) ```csharp
async onInstallationUpdateActivity(context: TurnContext) {
# [JSON](#tab/json) ```json
-{
- "action": "add",
- "type": "installationUpdate",
- "timestamp": "2020-10-20T22:08:07.869Z",
- "id": "f:3033745319439849398",
- "channelId": "msteams",
- "serviceUrl": "https://smba.trafficmanager.net/amer/",
- "from": {
- "id": "sample id",
- "aadObjectId": "sample Azure AD Object ID"
- },
- "conversation": {
- "isGroup": true,
- "conversationType": "channel",
- "tenantId": "sample tenant ID",
- "id": "sample conversation Id@thread.skype"
- },
-
- "recipient": {
- "id": "sample reciepent bot ID",
- "name": "bot name"
- },
- "entities": [
- {
- "locale": "en",
- "platform": "Windows",
- "type": "clientInfo"
- }
- ],
- "channelData": {
- "settings": {
- "selectedChannel": {
- "id": "sample channel ID@thread.skype"
- }
- },
- "channel": {
- "id": "sample channel ID"
- },
- "team": {
- "id": "sample team ID"
- },
- "tenant": {
- "id": "sample tenant ID"
- },
- "source": {
- "name": "message"
- }
- },
- "locale": "en"
-}
+{
+ {
+ "type": "installationUpdate",
+ "id": "f:816eb23d-bfa1-afa3-dfeb-d2aa338e9541",
+ "timestamp": "2021-11-09T04:47:30.91Z",
+ "serviceUrl": "https://smba.trafficmanager.net/amer/",
+ "channelId": "msteams",
+ "from": {
+ "id": "29:1ljv6N86roXr5pjPrCJVIz6xHh5QxjI....",
+ "aadObjectId": "eddfa9d4-346e-4cce-a18f-fa6261ad776b"
+ },
+ "recipient": {
+ "id": "28:608cacfd-1cea-40c9-b678-4b93e69bb72b",
+ "name": "Test Bot"
+ },
+ "locale": "en-US",
+ "entities": [
+ {
+ "type": "clientInfo",
+ "locale": "en-US"
+ }
+ ],
+ "conversation": {
+ "isGroup": true,
+ "id": "19:0b7f32667e064dd9b25d7969801541f4@thread.tacv2",
+ "name": "2021 Test Channel",
+ "conversationType": "channel",
+ "tenantId": "b28fdbfd-2b78-4f93-b0f8-8881793f0f8f"
+ },
+ "channelData": {
+ "settings": {
+ "selectedChannel": {
+ "id": "19:0b7f32667e064dd9b25d7969801541f4@thread.tacv2"
+ }
+ },
+ "channel": {
+ "id": "19:0b7f32667e064dd9b25d7969801541f4@thread.tacv2"
+ },
+ "team": {
+ "aadGroupId": "da849743-4259-475f-ae7a-4f4b0fb49943",
+ "name": "TestTeam2022",
+ "id": "19:zFLSDFWsesfzcmKArqKJ-65aOXJz@sgf462H2wz41@thread.tacv2"
+ },
+ "tenant": {
+ "id": "b28fdbfd-2b78-4f93-b0f8-8881793f0f8f"
+ },
+ "source": {
+ "name": "message"
+ }
+ },
+ "action": "add"
+ }
``` # [Python](#tab/python)
async def on_installation_update(self, turn_context: TurnContext):
## Uninstall behavior for personal app with bot
-When you uninstall an app, the bot is also uninstalled. When a user sends a message to your app, they receive a 403 response code. Your bot receives a 403 response code for new messages posted by your bot. The post uninstall behavior for bots in the personal scope with the Teams and groupChat scopes are now aligned. You cannot send or receive messages after an app has been uninstalled.
+When you uninstall an app, the bot is also uninstalled. When a user sends a message to your app, they receive a 403 response code. Your bot receives a 403 response code for new messages posted by your bot. The post uninstall behavior for bots in the personal scope with the Teams and groupChat scopes are now aligned. You can't send or receive messages after an app has been uninstalled.
:::image type="content" source="../../../assets/images/bots/uninstallbot.png" alt-text="Uninstall response code"lightbox="../../../assets/images/bots/uninstallbot.png"border="true"::: ## Event handling for install and uninstall events
-When you use these install and uninstall events, there are some instances where bots give exceptions on receiving unexpected events from Teams. This occurs in the following cases:
+When you use these install and uninstall events, there are some instances where bots give exceptions on receiving unexpected events from Teams, which occurs in the following cases:
* You build your bot without the Microsoft Bot Framework SDK, and as a result the bot gives an exception on receiving an unexpected event. * You build your bot with the Microsoft Bot Framework SDK, and you select to alter the default event behavior by overriding the base event handle.
platform Overview https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/m365-apps/overview.md
The Teams app platform continues to evolve and expand holistically into the Micr
| | App manifest element | Teams support |Outlook* support | Office* support | Notes | |--|--|--|--|--|--| | [**Tabs**](../tabs/what-are-tabs.md) (personal scope) |`staticTabs` | Web, Desktop, Mobile | Web (Targeted Release), Desktop (Beta Channel) | Web (Targeted Release)| Channel and group scope not yet supported for Microsoft 365. See [notes](../tabs/how-to/using-teams-client-sdk.md#microsoft-365-support-running-teams-apps-in-office-and-outlook).
-| [**Message extensions**](../messaging-extensions/what-are-messaging-extensions.md) (search-based)| `composeExtensions` | Web, Desktop, Mobile| Web (Targeted Release), Desktop (Beta Channel)| |Action-based not yet supported for Microsoft 365. See [notes](extend-m365-teams-message-extension.md#preview-your-message-extension-in-outlook). |
+| [**Message extensions**](../messaging-extensions/what-are-messaging-extensions.md) (search-based)| `composeExtensions` | Web, Desktop, Mobile| Web (Targeted Release), Desktop (Beta Channel)| - |Action-based not yet supported for Microsoft 365. See [notes](extend-m365-teams-message-extension.md#preview-your-message-extension-in-outlook). |
| [**Graph connectors**](/microsoftsearch/connectors-overview)| `graphConnector` | Web, Desktop, Mobile| Web, Desktop | Web| See [notes](#graph-connectors)
-| [**Office Add-ins**](/office/dev/add-ins/develop/json-manifest-overview) (preview) | `extensions` | | Web, Desktop | | Only available in [devPreview](../resources/schem) manifest version. See [notes](#office-add-ins-preview).|
+| [**Office Add-ins**](/office/dev/add-ins/develop/json-manifest-overview) (preview) | `extensions` | - | Web, Desktop | - | Only available in [devPreview](../resources/schem) manifest version. See [notes](#office-add-ins-preview).|
-\* The [Microsoft 365 Targeted release](/microsoft-365/admin/manage/release-options-in-office-365) option and [Microsoft 365 Apps update channel](/deployoffice/change-update-channels) enrollment require admin opt-in for the entire organization or selected users.
+\* The [Microsoft 365 Targeted release](/microsoft-365/admin/manage/release-options-in-office-365) option and [Microsoft 365 Apps update channel](/deployoffice/change-update-channels) enrollment require admin opt-in for the entire organization or selected users. Update channels are device specific and apply only to installations of Office running on Windows.
For guidance about the Teams app manifest and SDK versioning guidance, as well as further details about current Teams platform capability support across Microsoft 365, see the [Teams JavaScript client SDK overview](../tabs/how-to/using-teams-client-sdk.md).
platform Team Chat Member Api Changes https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/resources/team-chat-member-api-changes.md
>[!NOTE] > The deprecation process for `TeamsInfo.getMembers` and `TeamsInfo.GetMembersAsync` APIs have started. Initially, they are heavily throttled to five requests per minute and return a maximum of 10K members per team. This results in the full roster not being returned as team size increases.
-> You must update to version 4.10 or higher of the Bot Framework SDK and switch to the paginated API endpoints, or the `TeamsInfo.GetMemberAsync` single user API. This also applies to your bot even if you are not directly using these APIs, as older SDKs call these APIs during [membersAdded](../bots/how-to/conversations/subscribe-to-conversation-events.md#team-members-added) events. To view the list of upcoming changes, see [API changes](team-chat-member-api-changes.md#api-changes).
+> You must update to version 4.10 or higher of the Bot Framework SDK and switch to the paginated API endpoints, or the `TeamsInfo.GetMemberAsync` single user API. This also applies to your bot even if you are not directly using these APIs, as older SDKs call these APIs during [membersAdded](../bots/how-to/conversations/subscribe-to-conversation-events.md#members-added) events. To view the list of upcoming changes, see [API changes](team-chat-member-api-changes.md#api-changes).
Currently, if you want to retrieve information for one or more members of a chat or team, you can use the [Microsoft Teams bot APIs](/microsoftteams/platform/bots/how-to/get-teams-context?tabs=dotnet#fetch-the-roster-or-user-profile) `TeamsInfo.GetMembersAsync` for C# or `TeamsInfo.getMembers` for TypeScript or Node.js APIs. For more information, see [fetch roster or user profile](../bots/how-to/get-teams-context.md#fetch-the-roster-or-user-profile).
platform Whats New https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/whats-new.md
Developer preview is a public program that provides early access to unreleased T
| **Date** | **Update** | **Find here** | | -- | | |
+| 06/06/2022| Update conversation and installation events in your Teams bot | Build bots > Bot conversations > Conversation events in your Teams bot > [Conversation events in your Teams bot](bots/how-to/conversations/subscribe-to-conversation-events.md) |
|05/24/2022| Enhanced collaboration with Live Share SDK | Build apps for Teams meetings > Enhanced collaboration with Live Share > [Overview](apps-in-teams-meetings/teams-live-share-overview.md) | | 04/06/2022 | Share to Teams from personal app or tab | Integrate with Teams > Share to Teams > [Share to Teams from personal app or tab](concepts/build-and-test/share-to-teams-from-personal-app-or-tab.md) | | 02/07/2022 | Tools and SDKs |Teams Toolkit for Visual Studio Code > </br> ΓÇó Add capabilities to Teams app> [Add capabilities to your Teams apps](toolkit/add-capability.md) </br> ΓÇó Add cloud resources to Teams app> [Add cloud resources to your Teams app](toolkit/add-resource.md) |