microsoft/teams.net

Public

mirrored fromhttps://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
copilot/update-sample-to-blazor

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

core/samples/AFBot/DropTypingMiddleware.cs

16lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4using Microsoft.Teams.Core;
5using Microsoft.Teams.Core.Schema;
6
7namespace AFBot;
8
9internal class DropTypingMiddleware : ITurnMiddleware
10{
11 public Task OnTurnAsync(BotApplication botApplication, CoreActivity activity, NextTurn nextTurn, CancellationToken cancellationToken = default)
12 {
13 if (activity.Type == ActivityType.Typing) return Task.CompletedTask;
14 return nextTurn(cancellationToken);
15 }
16}
17