microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v2.0.0-preview.13

Branches

Tags

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

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.Apps/Events/ActivitySentEvent.cs

31lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3
4using Microsoft.Teams.Api.Activities;
5using Microsoft.Teams.Apps.Plugins;
6
7namespace Microsoft.Teams.Apps.Events;
8
9public class ActivitySentEvent : Event
10{
11 public required IActivity Activity { get; set; }
12}
13
14public static partial class AppEventExtensions
15{
16 public static App OnActivitySent(this App app, Action<ISenderPlugin, ActivitySentEvent> handler)
17 {
18 return app.OnEvent(EventType.ActivitySent, (plugin, @event) =>
19 {
20 handler((ISenderPlugin)plugin, (ActivitySentEvent)@event);
21 });
22 }
23
24 public static App OnActivitySent(this App app, Func<ISenderPlugin, ActivitySentEvent, CancellationToken, Task> handler)
25 {
26 return app.OnEvent(EventType.ActivitySent, (plugin, @event, token) =>
27 {
28 return handler((ISenderPlugin)plugin, (ActivitySentEvent)@event, token);
29 });
30 }
31}