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 @@ -86,3 +86,93 @@ In .NET, reaction APIs are marked with `[Experimental("ExperimentalTeamsReaction
</PropertyGroup>
```
:::


<!-- get-quoted-messages-method-name -->

`GetQuotedMessages()`

<!-- reply-method-name -->

`Reply()`

<!-- quote-reply-method-name -->

`Quote()`

<!-- app-send-method-name -->

`app.Send()`

<!-- add-quoted-reply-method-name -->

`AddQuote()`

<!-- quoted-replies-receive-example -->

```csharp
app.OnMessage(async context =>
{
var quotes = context.Activity.GetQuotedMessages();

if (quotes.Count > 0)
{
var quote = quotes[0].QuotedReply;
await context.Reply(
$"You quoted message {quote.MessageId} from {quote.SenderName}: \"{quote.Preview}\"");
}
});
```

<!-- quoted-replies-reply-example -->

```csharp
app.OnMessage(async context =>
{
// Reply() automatically quotes the inbound message
await context.Reply("Got it!");
});
```

<!-- quoted-replies-quote-reply-example -->

```csharp
app.OnMessage(async context =>
{
// Quote a specific message by its ID
await context.Quote("1772050244572", "Referencing an earlier message");
});
```

<!-- quoted-replies-builder-example -->

```csharp
// Single quote with response below it
var msg = new MessageActivity()
.AddQuote("1772050244572", "Here is my response");
await app.Send(conversationId, msg);

// Multiple quotes with interleaved responses
msg = new MessageActivity()
.AddQuote("msg-1", "response to first")
.AddQuote("msg-2", "response to second");
await app.Send(conversationId, msg);

// Grouped quotes — omit response to group quotes together
msg = new MessageActivity("see below for previous messages")
.AddQuote("msg-1")
.AddQuote("msg-2", "response to both");
await app.Send(conversationId, msg);
```

<!-- quoted-replies-preview-note -->

:::tip[.NET]
In .NET, quoted reply APIs are marked with `[Experimental("ExperimentalTeamsQuotedReplies")]` and will produce a compiler error until you opt in. Suppress the diagnostic inline with `#pragma warning disable ExperimentalTeamsQuotedReplies` or project-wide in your `.csproj`:

```xml
<PropertyGroup>
<NoWarn>$(NoWarn);ExperimentalTeamsQuotedReplies</NoWarn>
</PropertyGroup>
```
:::
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,85 @@ async def handle_message(ctx: ActivityContext[MessageActivity]):
```

<!-- targeted-preview-note -->
N/A

<!-- reactions-preview-note -->
N/A

<!-- get-quoted-messages-method-name -->

`get_quoted_messages()`

<!-- reply-method-name -->

`reply()`

<!-- quote-reply-method-name -->

`quote()`

<!-- app-send-method-name -->

`app.send()`

<!-- add-quoted-reply-method-name -->

`add_quote()`

<!-- quoted-replies-receive-example -->

```python
@app.on_message
async def handle_message(ctx: ActivityContext[MessageActivity]):
quotes = ctx.activity.get_quoted_messages()

if quotes:
quote = quotes[0].quoted_reply
await ctx.reply(
f"You quoted message {quote.message_id} from {quote.sender_name}: \"{quote.preview}\""
)
```

<!-- quoted-replies-reply-example -->

```python
@app.on_message
async def handle_message(ctx: ActivityContext[MessageActivity]):
# reply() automatically quotes the inbound message
await ctx.reply("Got it!")
```

<!-- quoted-replies-quote-reply-example -->

```python
@app.on_message
async def handle_message(ctx: ActivityContext[MessageActivity]):
# Quote a specific message by its ID
await ctx.quote("1772050244572", "Referencing an earlier message")
```

<!-- quoted-replies-builder-example -->

```python
from microsoft_teams.api.activities.message import MessageActivityInput

# Single quote with response below it
msg = (MessageActivityInput()
.add_quote("1772050244572", "Here is my response"))
await app.send(conversation_id, msg)

# Multiple quotes with interleaved responses
msg = (MessageActivityInput()
.add_quote("msg-1", "response to first")
.add_quote("msg-2", "response to second"))
await app.send(conversation_id, msg)

# Grouped quotes — omit response to group quotes together
msg = (MessageActivityInput(text="see below for previous messages")
.add_quote("msg-1")
.add_quote("msg-2", "response to both"))
await app.send(conversation_id, msg)
```

<!-- quoted-replies-preview-note -->
N/A
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,87 @@ app.on('message', async ({ send, activity }) => {
```

<!-- targeted-preview-note -->
N/A

<!-- reactions-preview-note -->
N/A


<!-- get-quoted-messages-method-name -->

`getQuotedMessages()`

<!-- reply-method-name -->

`reply()`

<!-- quote-reply-method-name -->

`quote()`

<!-- app-send-method-name -->

`app.send()`

<!-- add-quoted-reply-method-name -->

`addQuote()`

<!-- quoted-replies-receive-example -->

```typescript
app.on('message', async ({ activity, reply }) => {
const quotes = activity.getQuotedMessages();

if (quotes.length > 0) {
const quote = quotes[0].quotedReply;
await reply(
`You quoted message ${quote.messageId} from ${quote.senderName}: "${quote.preview}"`
);
}
});
```

<!-- quoted-replies-reply-example -->

```typescript
app.on('message', async ({ reply }) => {
// reply() automatically quotes the inbound message
await reply('Got it!');
});
```

<!-- quoted-replies-quote-reply-example -->

```typescript
app.on('message', async ({ quote }) => {
// Quote a specific message by its ID
await quote('1772050244572', 'Referencing an earlier message');
});
```

<!-- quoted-replies-builder-example -->

```typescript
import { MessageActivity } from '@microsoft/teams.api';

// Single quote with response below it
let msg = new MessageActivity()
.addQuote('1772050244572', 'Here is my response');
await app.send(conversationId, msg);

// Multiple quotes with interleaved responses
msg = new MessageActivity()
.addQuote('msg-1', 'response to first')
.addQuote('msg-2', 'response to second');
await app.send(conversationId, msg);

// Grouped quotes — omit response to group quotes together
msg = new MessageActivity('see below for previous messages')
.addQuote('msg-1')
.addQuote('msg-2', 'response to both');
await app.send(conversationId, msg);
```

<!-- quoted-replies-preview-note -->
N/A
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ 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
Expand All @@ -61,6 +60,39 @@ Reactions are currently in preview.

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-preview-note" />

## Quoted Replies

:::info[Preview]
Quoted replies are currently in preview.
:::

Quoted replies let your agent reference a previous message in the conversation. When a user sends a message that quotes another message, your agent receives structured metadata about the quoted content. Your agent can also send messages that quote previous messages.

### Receiving Quoted Replies

When a user quotes a message and sends it to your agent, the quoted reply metadata is available on the inbound activity. Use the <LanguageInclude section="get-quoted-messages-method-name" /> method to access all quoted reply entities.

<LanguageInclude section="quoted-replies-receive-example" />

Each quoted reply entity contains the quoted message's ID, sender information, a preview of the quoted text, and whether the quoted message has been deleted.

### Sending a Quoted Reply

When your agent calls <LanguageInclude section="reply-method-name" />, the SDK automatically stamps a quoted reply entity referencing the inbound message. No extra code is needed — the reply will appear as a quoted reply in Teams.

<LanguageInclude section="quoted-replies-reply-example" />

To quote a different message in the same conversation (not the inbound message), use the <LanguageInclude section="quote-reply-method-name" /> method with the message ID you want to quote.

<LanguageInclude section="quoted-replies-quote-reply-example" />

### Building Quoted Replies for Proactive Send

For proactive scenarios (using <LanguageInclude section="app-send-method-name" />) or when quoting multiple messages, use the <LanguageInclude section="add-quoted-reply-method-name" /> method on a message activity. Pass the message ID and an optional response text.

<LanguageInclude section="quoted-replies-builder-example" />

<LanguageInclude section="quoted-replies-preview-note" />
Loading