microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v2.1.0-preview-0006

Branches

Tags

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

Clone

HTTPS

Download ZIP

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

30lines · modepreview

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Teams.Apps.Plugins;

namespace Microsoft.Teams.Apps.Events;

public class ActivityResponseEvent : Event
{
    public required Response Response { get; set; }
}

public static partial class AppEventExtensions
{
    public static App OnActivityResponse(this App app, Action<ISenderPlugin, ActivityResponseEvent> handler)
    {
        return app.OnEvent(EventType.ActivityResponse, (plugin, @event) =>
        {
            handler((ISenderPlugin)plugin, (ActivityResponseEvent)@event);
        });
    }

    public static App OnActivityResponse(this App app, Func<ISenderPlugin, ActivityResponseEvent, CancellationToken, Task> handler)
    {
        return app.OnEvent(EventType.ActivityResponse, (plugin, @event, token) =>
        {
            return handler((ISenderPlugin)plugin, (ActivityResponseEvent)@event, token);
        });
    }
}