Updates from: 12/31/2020 04:07:17
Service Microsoft Docs article Related commit history on GitHub Change details
platform https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/subscribe-to-conversation-events https://github.com/MicrosoftDocs/msteams-docs/commits/master/msteams-platform/bots/how-to/conversations/subscribe-to-conversation-events.md
@@ -18,6 +18,11 @@ Microsoft Teams sends notifications to your bot for events that happen in scopes
## Conversation update events
+> [!Important]
+> New events can be added at any time, and your bot will begin to receive them.
+> You must design for the possibility of receiving unexpected events.
+> If you are using the Bot Framework SDK, your bot will automatically respond with a `200 - OK` to any events you do not choose to handle.
+ A bot receives a `conversationUpdate` event when it has been added to a conversation, other members have been added to or removed from a conversation, or conversation metadata has changed. The `conversationUpdate` event is sent to your bot when it receives information on membership updates for teams where it has been added. It also receives an update when it has been added for the first time specifically for personal conversations.
@@ -29,9 +34,12 @@ The following table shows a list of Teams conversation update events, with links
| channel created | channelCreated | OnTeamsChannelCreatedAsync | [A channel was created](#channel-created) | Team | | channel renamed | channelRenamed | OnTeamsChannelRenamedAsync | [A channel was renamed](#channel-renamed) | Team | | channel deleted | channelDeleted | OnTeamsChannelDeletedAsync | [A channel was deleted](#channel-deleted) | Team |
-| team members added | teamMemberAdded | OnTeamsMembersAddedAsync | [A Member added to team](#team-members-added) | All |
-| team members removed | teamMemberRemoved | OnTeamsMembersRemovedAsync | [A Member was removed from team](#team-members-removed) | groupChat & team |
+| channel restored | channelRestored | OnTeamsChannelRestoredAsync | [A channel was restored](#channel-deleted) | Team |
+| members added | membersAdded | OnTeamsMembersAddedAsync | [A member added](#team-members-added) | All |
+| members removed | membersRemoved | OnTeamsMembersRemovedAsync | [A member was removed](#team-members-removed) | groupChat & team |
| team renamed | teamRenamed | OnTeamsTeamRenamedAsync | [A Team was renamed](#team-renamed) | Team |
+| team archived | teamArchived | OnTeamsTeamArchivedAsync | [A Team was archived](#team-archived) | Team |
+| team restored | teamRestored | OnTeamsTeamRestoredAsync | [A Team was renamed](#team-renamed) | Team |
### Channel created
@@ -282,6 +290,93 @@ 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 that your bot is already installed in.
+
+# [C#/.NET](#tab/dotnet)
+
+```csharp
+protected override async Task OnTeamsChannelRestoredAsync(ChannelInfo channelInfo, TeamInfo teamInfo, ITurnContext<IConversationUpdateActivity> turnContext, CancellationToken cancellationToken)
+{
+ var heroCard = new HeroCard(text: $"{channelInfo.Name} is the Channel restored.");
+ await turnContext.SendActivityAsync(MessageFactory.Attachment(heroCard.ToAttachment()), cancellationToken);
+}
+```
+
+# [TypeScript/Node.js](#tab/typescript)
+
+<!-- From sample: botbuilder-js\libraries\botbuilder\tests\teams\conversationUpdate\src\conversationUpdateBot.ts -->
+
+```typescript
+
+export class MyBot extends TeamsActivityHandler {
+ constructor() {
+ super();
+ this.onTeamsChannelRestoredEvent(async (channelInfo: ChannelInfo, teamInfo: TeamInfo, turnContext: TurnContext, next: () => Promise<void>): Promise<void> => {
+ const card = CardFactory.heroCard('Channel Restored', `${channelInfo.name} is the Channel restored`);
+ const message = MessageFactory.attachment(card);
+ await turnContext.sendActivity(message);
+ await next();
+ });
+ }
+}
+
+```
+
+# [JSON](#tab/json)
+
+```json
+{
+ "type": "conversationUpdate",
+ "timestamp": "2017-02-23T19:34:07.478Z",
+ "localTimestamp": "2017-02-23T12:34:07.478-07:00",
+ "id": "f:dd6ec311",
+ "channelId": "msteams",
+ "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
+ "from": {
+ "id": "29:1wR7IdIRIoerMIWbewMi75JA3scaMuxvFon9eRQW2Nix5loMDo0362st2IaRVRirPZBv1WdXT8TIFWWmlQCizZQ"
+ },
+ "conversation": {
+ "isGroup": true,
+ "conversationType": "channel",
+ "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
+ },
+ "recipient": {
+ "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
+ "name": "SongsuggesterBot"
+ },
+ "channelData": {
+ "channel": {
+ "id": "19:6d97d816470f481dbcda38244b98689a@thread.skype",
+ "name": "FunDiscussions"
+ },
+ "team": {
+ "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
+ },
+ "eventType": "channelRestored",
+ "tenant": {
+ "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
+ }
+ }
+}
+```
+
+# [Python](#tab/python)
+
+```python
+async def on_teams_channel_restored(
+ self, channel_info: ChannelInfo, team_info: TeamInfo, turn_context: TurnContext
+):
+ return await turn_context.send_activity(
+ MessageFactory.text(
+ f"The restored channel is {channel_info.name}. The channel id is {channel_info.id}"
+ )
+ )
+```
+
+* * *
+ ### Team members added The `teamMemberAdded` event is sent to your bot the first time it is added to a conversation and every time a new user is added to a team or group chat that your bot is installed in. The user information (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).
@@ -477,6 +572,8 @@ export class MyBot extends TeamsActivityHandler {
# [JSON](#tab/json)
+The `channelData` object in the following payload example is based on adding a member to a team rather than a group chat, or initiating a new one-to-one conversation:
+ ```json { "membersRemoved": [
@@ -524,7 +621,7 @@ async def on_teams_members_removed(
): for member in teams_members_removed: await turn_context.send_activity(
- MessageFactory.text(f"Say goodbye to your team member {member.id}")
+ MessageFactory.text(f"Say goodbye to {member.id}")
) return ```
@@ -596,7 +693,6 @@ export class MyBot extends TeamsActivityHandler {
} ``` - # [Python](#tab/python) ```python
@@ -610,6 +706,162 @@ async def on_teams_team_renamed(
* * *
+### Team archived
+
+The bot receives a notification when the team it is installed in is archived. It receives a `conversationUpdate` event with `eventType.teamarchived` in the `channelData` object.
+
+# [C#/.NET](#tab/dotnet)
+
+```csharp
+protected override async Task OnTeamsTeamArchivedAsync(TeamInfo teamInfo, ITurnContext<IConversationUpdateActivity> turnContext, CancellationToken cancellationToken)
+{
+ var heroCard = new HeroCard(text: $"{teamInfo.Name} is the team name");
+ await turnContext.SendActivityAsync(MessageFactory.Attachment(heroCard.ToAttachment()), cancellationToken);
+}
+```
+
+# [TypeScript/Node.js](#tab/typescript)
+
+```typescript
+export class MyBot extends TeamsActivityHandler {
+ constructor() {
+ super();
+ this.onTeamsTeamArchivedEvent(async (teamInfo: TeamInfo, turnContext: TurnContext, next: () => Promise<void>): Promise<void> => {
+ const card = CardFactory.heroCard('Team archived', `${teamInfo.name} is the team name`);
+ const message = MessageFactory.attachment(card);
+ await turnContext.sendActivity(message);
+ await next();
+ });
+ }
+}
+```
+
+# [JSON](#tab/json)
+
+```json
+{
+ "type": "conversationUpdate",
+ "timestamp": "2017-02-23T19:35:56.825Z",
+ "localTimestamp": "2017-02-23T12:35:56.825-07:00",
+ "id": "f:1406033e",
+ "channelId": "msteams",
+ "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
+ "from": {
+ "id": "29:1I9Is_Sx0O-Iy2rQ7Xz1lcaPKlO9eqmBRTBuW6XzkFtcjqxTjPaCMij8BVMdBcL9L_RwWNJyAHFQb0TRzXgyQvA"
+ },
+ "conversation": {
+ "isGroup": true,
+ "conversationType": "channel",
+ "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
+ },
+ "recipient": {
+ "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
+ "name": "SongsuggesterLocal"
+ },
+ "channelData": {
+ "team": {
+ "id": "19:efa9296d959346209fea44151c742e73@thread.skype",
+ "name": "Team Name"
+ },
+ "eventType": "teamArchived",
+ "tenant": {
+ "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
+ }
+ }
+}
+```
+
+# [Python](#tab/python)
+
+```python
+async def on_teams_team_archived(
+ self, team_info: TeamInfo, turn_context: TurnContext
+):
+ return await turn_context.send_activity(
+ MessageFactory.text(f"The team name is {team_info.name}")
+ )
+```
+
+* * *
+
+### Team restored
+
+The bot receives a notification when the team it is installed in is restored. It receives a `conversationUpdate` event with `eventType.teamrestored` in the `channelData` object.
+
+# [C#/.NET](#tab/dotnet)
+
+```csharp
+protected override async Task OnTeamsTeamrestoredAsync(TeamInfo teamInfo, ITurnContext<IConversationUpdateActivity> turnContext, CancellationToken cancellationToken)
+{
+ var heroCard = new HeroCard(text: $"{teamInfo.Name} is the team name");
+ await turnContext.SendActivityAsync(MessageFactory.Attachment(heroCard.ToAttachment()), cancellationToken);
+}
+```
+
+# [TypeScript/Node.js](#tab/typescript)
+
+```typescript
+export class MyBot extends TeamsActivityHandler {
+ constructor() {
+ super();
+ this.onTeamsTeamrestoredEvent(async (teamInfo: TeamInfo, turnContext: TurnContext, next: () => Promise<void>): Promise<void> => {
+ const card = CardFactory.heroCard('Team restored', `${teamInfo.name} is the team name`);
+ const message = MessageFactory.attachment(card);
+ await turnContext.sendActivity(message);
+ await next();
+ });
+ }
+}
+```
+
+# [JSON](#tab/json)
+
+```json
+{
+ "type": "conversationUpdate",
+ "timestamp": "2017-02-23T19:35:56.825Z",
+ "localTimestamp": "2017-02-23T12:35:56.825-07:00",
+ "id": "f:1406033e",
+ "channelId": "msteams",
+ "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
+ "from": {
+ "id": "29:1I9Is_Sx0O-Iy2rQ7Xz1lcaPKlO9eqmBRTBuW6XzkFtcjqxTjPaCMij8BVMdBcL9L_RwWNJyAHFQb0TRzXgyQvA"
+ },
+ "conversation": {
+ "isGroup": true,
+ "conversationType": "channel",
+ "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
+ },
+ "recipient": {
+ "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
+ "name": "SongsuggesterLocal"
+ },
+ "channelData": {
+ "team": {
+ "id": "19:efa9296d959346209fea44151c742e73@thread.skype",
+ "name": "Team Name"
+ },
+ "eventType": "teamrestored",
+ "tenant": {
+ "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
+ }
+ }
+}
+```
+
+# [Python](#tab/python)
+
+```python
+async def on_teams_team_restored(
+ self, team_info: TeamInfo, turn_context: TurnContext
+):
+ return await turn_context.send_activity(
+ MessageFactory.text(f"The team name is {team_info.name}")
+ )
+```
+
+* * *
+ ## Message reaction events The `messageReaction` event is sent when a user adds or removes reactions to a message which was sent by your bot. The `replyToId` contains the ID of the specific message, and the `Type` is the type of reaction in text format. The types of reactions include: "angry", "heart", "laugh", "like", "Sad", "surprised". This event does not contain the contents of the original message, so if processing reactions to your messages is important for your bot you'll need to store the messages when you send them.
platform https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-creating https://github.com/MicrosoftDocs/msteams-docs/commits/master/msteams-platform/webhooks-and-connectors/how-to/connectors-creating.md
@@ -2,6 +2,7 @@
title: Office 365 Connectors description: Describes how to get started with Office 365 Connectors in Microsoft Teams keywords: teams o365 connector
+ms.topic: conceptual
ms.date: 04/19/2019 --- # Creating Office 365 Connectors for Microsoft Teams
@@ -36,6 +37,64 @@ You can reuse your existing web configuration experience or create a separate ve
5. Call `microsoftTeams.settings.getSettings()` to fetch webhook properties, including the URL itself. You should call this In addition to during the save event, you should also call this when your page is first loaded in the case of a re-configuration. 6. (Optional) Register a `microsoftTeams.settings.registerOnRemoveHandler()` event handler, which gets called when the user removes your connector. This event gives your service an opportunity to perform any cleanup actions.
+Here's a sample HTML to create a Connector configuration page without the CSS:
+
+```html
+<h2>Send notifications when tasks are:</h2>
+<div class="col-md-8">
+ <section id="configSection">
+ <form id="configForm">
+ <input type="radio" name="notificationType" value="Create" onclick="onClick()"> Created
+ <br>
+ <br>
+ <input type="radio" name="notificationType" value="Update" onclick="onClick()"> Updated
+ </form>
+ </section>
+</div>
+
+<script src="https://statics.teams.microsoft.com/sdk/v1.5.2/js/MicrosoftTeams.min.js" crossorigin="anonymous"></script>
+<script src="/Scripts/jquery-1.10.2.js"></script>
+
+<script type="text/javascript">
+
+ function onClick() {
+ microsoftTeams.settings.setValidityState(true);
+ }
+
+ microsoftTeams.initialize();
+ microsoftTeams.settings.registerOnSaveHandler(function (saveEvent) {
+ var radios = document.getElementsByName('notificationType');
+
+ var eventType = '';
+ if (radios[0].checked) {
+ eventType = radios[0].value;
+ } else {
+ eventType = radios[1].value;
+ }
+
+ microsoftTeams.settings.setSettings({
+ entityId: eventType,
+ contentUrl: "https://YourSite/Connector/Setup",
+ removeUrl:"https://YourSite/Connector/Setup",
+ configName: eventType
+ });
+
+ microsoftTeams.settings.getSettings(function (settings) {
+ // We get the Webhook URL in settings.webhookUrl which needs to be saved.
+ // This can be used later to send notification.
+ });
+
+ saveEvent.notifySuccess();
+ });
+
+ microsoftTeams.settings.registerOnRemoveHandler(function (removeEvent) {
+ var removeCalled = true;
+ alert("Removed" + JSON.stringify(removeEvent));
+ });
+
+</script>
+```
+ #### `GetSettings()` response properties >[!Note]
platform https://docs.microsoft.com/en-us/microsoftteams/platform/whats-new https://github.com/MicrosoftDocs/msteams-docs/commits/master/msteams-platform/whats-new.md
@@ -15,8 +15,7 @@ The change log lists changes to the Microsoft Teams platform and this document s
| **Date** | **Notes** | **Changed topics** | | -------- | --------- | ------------------ | |11/30/2020|New: Identity platform integration with Teams Toolkit and Visual Studio Code for tabs|[Single sign-on authentication with Teams Toolkit and Visual Studio Code for tabs](toolkit/visual-studio-code-tab-sso.md)|
-|11/16/2020|Teams app manifest updated to version 1.8|Reference: Manifest schema for Microsoft Teams|[Reference: Manifest schema for Microsoft Teams](resources/schema/manifest-schema.md)|
-|11/11/2020| Manifest Schema updated to version 1.8| [Reference: Manifest schema for Microsoft Teams](resources/schema/manifest-schema.md)|
+|11/16/2020|Teams app manifest updated to version 1.8|[Reference: Manifest schema for Microsoft Teams](resources/schema/manifest-schema.md)|
|11/10/2020|Teams bot design guidelines|[Bot design guidelines](bots/design/bots.md)| |9/30/2020|Sending and receiving files to bots on mobile devices is now supported.|[Send and receive files through your bot](resources/bot-v3/bots-files.md)| |09/22/2020|New "Get Started with Teams" guidance|[Build your first Teams app overview](build-your-first-app/build-first-app-overview.md)|