microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
Libraries/Microsoft.Teams.Apps/Events/ActivityResponseEvent.cs
30lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | using Microsoft.Teams.Apps.Plugins; |
| 5 | |
| 6 | namespace Microsoft.Teams.Apps.Events; |
| 7 | |
| 8 | public class ActivityResponseEvent : Event |
| 9 | { |
| 10 | public required Response Response { get; set; } |
| 11 | } |
| 12 | |
| 13 | public static partial class AppEventExtensions |
| 14 | { |
| 15 | public static App OnActivityResponse(this App app, Action<ISenderPlugin, ActivityResponseEvent> handler) |
| 16 | { |
| 17 | return app.OnEvent(EventType.ActivityResponse, (plugin, @event) => |
| 18 | { |
| 19 | handler((ISenderPlugin)plugin, (ActivityResponseEvent)@event); |
| 20 | }); |
| 21 | } |
| 22 | |
| 23 | public static App OnActivityResponse(this App app, Func<ISenderPlugin, ActivityResponseEvent, CancellationToken, Task> handler) |
| 24 | { |
| 25 | return app.OnEvent(EventType.ActivityResponse, (plugin, @event, token) => |
| 26 | { |
| 27 | return handler((ISenderPlugin)plugin, (ActivityResponseEvent)@event, token); |
| 28 | }); |
| 29 | } |
| 30 | } |