microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
next/core

Branches

Tags

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

Clone

HTTPS

Download ZIP

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

46lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3
4using Microsoft.Teams.Api;
5using Microsoft.Teams.Api.Activities;
6using Microsoft.Teams.Apps.Events;
7
8namespace Microsoft.Teams.Apps.Plugins;
9
10/// <summary>
11/// a plugin that can send activities
12/// </summary>
13public interface ISenderPlugin : IPlugin
14{
15 /// <summary>
16 /// called by the `App`
17 /// to send an activity
18 /// </summary>
19 /// <param name="activity">the activity to send</param>
20 /// <param name="reference">the conversation reference</param>
21 /// <returns>the sent activity</returns>
22 public Task<IActivity> Send(IActivity activity, ConversationReference reference, CancellationToken cancellationToken = default);
23
24 /// <summary>
25 /// called by the `App`
26 /// to send an activity
27 /// </summary>
28 /// <typeparam name="TActivity">the activity type</typeparam>
29 /// <param name="activity">the activity to send</param>
30 /// <param name="reference">the conversation reference</param>
31 /// <returns>the sent activity</returns>
32 public Task<TActivity> Send<TActivity>(TActivity activity, ConversationReference reference, CancellationToken cancellationToken = default) where TActivity : IActivity;
33
34 /// <summary>
35 /// called by the `App`
36 /// to create a new activity stream
37 /// </summary>
38 /// <param name="reference">the conversation reference</param>
39 /// <returns>a new stream</returns>
40 public IStreamer CreateStream(ConversationReference reference, CancellationToken cancellationToken = default);
41
42 /// <summary>
43 /// process an activity
44 /// </summary>
45 public Task<Response> Do(ActivityEvent @event, CancellationToken cancellationToken = default);
46}