Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,36 @@ In .NET, targeted message APIs are marked with `[Experimental("ExperimentalTeams
```
:::

<!-- reactions-example -->

```csharp
app.OnMessage(async context =>
{
// Add a reaction to the message
await context.Api.Reactions.Add(context.Activity.Conversation.Id, context.Activity.Id, "like");

// Remove a reaction from the message
await context.Api.Reactions.Remove(context.Activity.Conversation.Id, context.Activity.Id, "like");
});
```

<!-- reactions-event-example -->

```csharp
app.OnMessageReaction(async context =>
{
foreach (var reaction in context.Activity.ReactionsAdded ?? [])
{
await context.Send($"{reaction.User?.DisplayName ?? "Someone"} added a {reaction.Type} reaction!");
}

foreach (var reaction in context.Activity.ReactionsRemoved ?? [])
{
await context.Send($"{reaction.User?.DisplayName ?? "Someone"} removed a {reaction.Type} reaction.");
}
});
```

<!-- reactions-preview-note -->

:::tip[.NET]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,41 @@ async def handle_message(ctx: ActivityContext[MessageActivity]):

<!-- targeted-preview-note -->

<!-- reactions-example -->

```python
@app.on_message
async def handle_message(ctx: ActivityContext[MessageActivity]):
# Add a reaction to the message
await ctx.api.reactions.add(
conversation_id=ctx.activity.conversation.id,
activity_id=ctx.activity.id,
reaction_type='like'
)

# Remove a reaction from the message
await ctx.api.reactions.delete(
conversation_id=ctx.activity.conversation.id,
activity_id=ctx.activity.id,
reaction_type='like'
)
```

<!-- reactions-event-example -->

```python
from microsoft_teams.api import MessageReactionActivity
from microsoft_teams.apps import ActivityContext

@app.on_message_reaction
async def handle_message_reaction(ctx: ActivityContext[MessageReactionActivity]):
for reaction in ctx.activity.reactions_added or []:
name = reaction.user.display_name if reaction.user else 'Someone'
await ctx.send(f"{name} added a {reaction.type} reaction!")

for reaction in ctx.activity.reactions_removed or []:
name = reaction.user.display_name if reaction.user else 'Someone'
await ctx.send(f"{name} removed a {reaction.type} reaction.")
```

<!-- reactions-preview-note -->
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,30 @@ app.on('message', async ({ send, activity }) => {

<!-- targeted-preview-note -->

<!-- reactions-example -->

```typescript
app.on('message', async ({ activity, api }) => {
// Add a reaction to the message
await api.reactions.add(activity.conversation.id, activity.id, 'like');

// Remove a reaction from the message
await api.reactions.remove(activity.conversation.id, activity.id, 'like');
});
```

<!-- reactions-event-example -->

```typescript
app.on('messageReaction', async ({ activity, send }) => {
for (const reaction of activity.reactionsAdded ?? []) {
await send(`${reaction.user?.displayName ?? 'Someone'} added a ${reaction.type} reaction!`);
}

for (const reaction of activity.reactionsRemoved ?? []) {
await send(`${reaction.user?.displayName ?? 'Someone'} removed a ${reaction.type} reaction.`);
}
});
```

<!-- reactions-preview-note -->
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ Sending a message at `@mentions` a user is as simple including the details of th

## Targeted Messages

:::info[Preview]
Targeted messages are currently in preview.
:::info[Coming Soon]
Targeted messages are coming soon in May 2026.
:::

Targeted messages, also known as ephemeral messages, are delivered to a specific user in a shared conversation. From a single user's perspective, they appear as regular inline messages in a conversation. Other participants won't see these messages, making them useful for authentication flows, help or error responses, personal reminders, or sharing contextual information without cluttering the group conversation.
Expand All @@ -50,17 +50,20 @@ To send a targeted message when responding to an incoming activity, use the <Lan

<LanguageInclude section="targeted-send-example" />

### Targeted messages in preview
<LanguageInclude section="targeted-preview-note" />

## Reactions

:::info[Preview]
Reactions are currently in preview.
:::info[Coming Soon]
Reactions are coming soon in May 2026.
:::

Reactions allow your agent to add or remove emoji reactions on messages in a conversation. The reactions client is available via the API client.

### Reactions in preview
<LanguageInclude section="reactions-example" />

Your agent can also receive `messageReaction` events when users add or remove reactions to messages in a conversation.

<LanguageInclude section="reactions-event-example" />

<LanguageInclude section="reactions-preview-note" />
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ In this example, you see how to get the <LanguageInclude section="conversation-i

## Targeted Proactive Messages

:::info[Preview]
Targeted messages are currently in preview.
:::info[Coming Soon]
Targeted messages are coming soon in May 2026.
:::

Targeted messages, also known as ephemeral messages, are delivered to a specific user in a shared conversation. From a single user's perspective, they appear as regular inline messages in a conversation. Other participants won't see these messages.
Expand Down