microsoft/teams.net

Public

mirrored from https://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v2.0.0-preview.6

Branches

Tags

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

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.Apps.Testing/Events/App.cs

28lines · modecode

1using Microsoft.Teams.Apps.Events;
2using Microsoft.Teams.Apps.Testing.Plugins;
3
4namespace Microsoft.Teams.Apps.Testing.Events;
5
6public class TestMessageEvent : Event
7{
8 public required string Message { get; set; }
9}
10
11public static partial class AppExtensions
12{
13 public static App OnTestMessage(this App app, Action<TestPlugin, TestMessageEvent> handler)
14 {
15 return app.OnEvent("test.message", (plugin, @event) =>
16 {
17 handler((TestPlugin)plugin, (TestMessageEvent)@event);
18 });
19 }
20
21 public static App OnTestMessage(this App app, Func<TestPlugin, TestMessageEvent, CancellationToken, Task<object?>> handler)
22 {
23 return app.OnEvent("test.message", (plugin, @event, token) =>
24 {
25 return handler((TestPlugin)plugin, (TestMessageEvent)@event, token);
26 });
27 }
28}