microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v2.0.0-preview.5

Branches

Tags

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

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.Apps/Plugins/Plugin.cs

45lines · modecode

1using Microsoft.Teams.Apps.Events;
2
3namespace Microsoft.Teams.Apps.Plugins;
4
5/// <summary>
6/// a component for extending the base
7/// `App` functionality
8/// </summary>
9public interface IPlugin
10{
11 /// <summary>
12 /// emitted when the plugin encounters an error
13 /// </summary>
14 public event EventFunction Events;
15
16 /// <summary>
17 /// lifecycle method called by the `App` once during initialization
18 /// </summary>
19 public Task OnInit(App app, CancellationToken cancellationToken = default);
20
21 /// <summary>
22 /// lifecycle method called by the `App` once during startup
23 /// </summary>
24 public Task OnStart(App app, CancellationToken cancellationToken = default);
25
26 /// <summary>
27 /// called by the `App` when an error occurs
28 /// </summary>
29 public Task OnError(App app, IPlugin plugin, ErrorEvent @event, CancellationToken cancellationToken = default);
30
31 /// <summary>
32 /// called by the `App` when an activity is received
33 /// </summary>
34 public Task OnActivity(App app, ISenderPlugin sender, ActivityEvent @event, CancellationToken cancellationToken = default);
35
36 /// <summary>
37 /// called by the `App` when an activity is sent
38 /// </summary>
39 public Task OnActivitySent(App app, ISenderPlugin sender, ActivitySentEvent @event, CancellationToken cancellationToken = default);
40
41 /// <summary>
42 /// called by the `App` when an activity response is sent
43 /// </summary>
44 public Task OnActivityResponse(App app, ISenderPlugin sender, ActivityResponseEvent @event, CancellationToken cancellationToken = default);
45}