microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
core/samples/AFBot/DropTypingMiddleware.cs
16lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | using Microsoft.Teams.Core; |
| 5 | using Microsoft.Teams.Core.Schema; |
| 6 | |
| 7 | namespace AFBot; |
| 8 | |
| 9 | internal 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 | |