Skip to content

Implement Reactions following teams.net PR #335#452

Merged
rido-min merged 14 commits into
mainfrom
copilot/add-reactions-feature
Feb 26, 2026
Merged

Implement Reactions following teams.net PR #335#452
rido-min merged 14 commits into
mainfrom
copilot/add-reactions-feature

Conversation

Copilot AI commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

Adds reaction management capabilities via the Bot Framework API v3, mirroring the teams.net implementation.

Changes

ReactionClient (/packages/api/src/clients/reaction/)

  • add(conversationId, activityId, reactionType) - PUT to /v3/conversations/{conversationId}/activities/{activityId}/reactions/{reactionType}
  • remove(conversationId, activityId, reactionType) - DELETE to same endpoint
  • Integrated into main Client class as reactions property

ReactionType Model (/packages/api/src/models/reaction/)

  • Type-safe reaction values: 'like' | 'heart' | 'laugh' | 'surprised' | 'sad' | 'angry'

Breaking Change: MessageReactionActivity

  • Removed addReaction() and removeReaction() helper methods
  • Reactions should now be managed via ReactionClient or set directly on activity properties

Example Application (/examples/reactions/)

  • Added comprehensive example bot demonstrating ReactionClient usage
  • Shows how to add/remove reactions programmatically
  • Demonstrates handling messageReaction activity events
  • Includes interactive commands and detailed documentation

Usage

import { Client } from '@microsoft/teams.api';

const client = new Client(serviceUrl);

// Add a reaction
await client.reactions.add('conversationId', 'activityId', 'like');

// Remove a reaction
await client.reactions.remove('conversationId', 'activityId', 'like');

// MessageReactionActivity now requires direct property assignment
const activity = new MessageReactionActivity({
  reactionsAdded: [{ type: 'like', user: account }],
  reactionsRemoved: [{ type: 'heart', user: account }],
});

See the examples/reactions directory for a complete working example.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add reactions feature based on Microsoft Teams PR 335 Implement Reactions following teams.net PR #335 Feb 17, 2026
Copilot AI requested a review from rido-min February 17, 2026 22:47
@rido-min
rido-min marked this pull request as ready for review February 17, 2026 23:00
@rido-min

Copy link
Copy Markdown
Contributor

@copilot add on sample under examples/ to show how to use the new reactionsclient

Copilot AI commented Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

@copilot add on sample under examples/ to show how to use the new reactionsclient

Added a comprehensive reactions example in examples/reactions/ that demonstrates:

  • Using ReactionClient.add() and ReactionClient.remove() to manage reactions programmatically
  • Handling messageReaction activity events when users add/remove reactions
  • Interactive commands to add/remove reactions from user messages
  • All 6 supported reaction types (like, heart, laugh, surprised, sad, angry)

The example includes a complete bot implementation with help text, error handling, and a detailed README.

Commit: 14b0168

Comment thread examples/reactions/.gitignore Outdated
@corinagum

Copy link
Copy Markdown
Collaborator

what is the status of 'plusOne'?

Comment thread packages/api/src/models/reaction/reaction-type.ts Outdated
Comment thread examples/reactions/src/index.ts Outdated
Comment thread packages/api/src/activities/message/message-reaction.spec.ts Outdated
Comment thread packages/api/src/clients/reaction/reaction.spec.ts Outdated
Comment thread examples/reactions/src/index.ts Outdated
Comment thread packages/api/src/models/message/message-reaction.ts Outdated
Comment thread examples/reactions/src/index.ts
Comment thread packages/api/src/models/message/message-reaction.ts Outdated
@rido-min
rido-min merged commit 07efd04 into main Feb 26, 2026
8 checks passed
@rido-min
rido-min deleted the copilot/add-reactions-feature branch February 26, 2026 21:35
@heyitsaamir heyitsaamir mentioned this pull request Mar 25, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants