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