Language

TeamsChannelCreatedRouteAttribute Class

Definition

Attribute to define a route that handles Teams channel created events.

[Microsoft.Agents.Builder.App.RouteHandlerType(typeof(Microsoft.Agents.Extensions.MSTeams.Channels.ChannelUpdateHandler))]
[System.AttributeUsage(System.AttributeTargets.Method, Inherited=true)]
public class TeamsChannelCreatedRouteAttribute : Attribute, Microsoft.Agents.Builder.App.IRouteAttribute
[<Microsoft.Agents.Builder.App.RouteHandlerType(typeof(Microsoft.Agents.Extensions.MSTeams.Channels.ChannelUpdateHandler))>]
[<System.AttributeUsage(System.AttributeTargets.Method, Inherited=true)>]
type TeamsChannelCreatedRouteAttribute = class
    inherit Attribute
    interface IRouteAttribute
Public Class TeamsChannelCreatedRouteAttribute
Inherits Attribute
Implements IRouteAttribute
Inheritance
TeamsChannelCreatedRouteAttribute
Attributes
Implements

Remarks

Decorate a method with this attribute to register it as a handler for channel created events in Teams. The method must match the ChannelUpdateHandler delegate signature.

[TeamsChannelCreatedRoute]
public async Task OnChannelCreatedAsync(ITeamsTurnContext turnContext, ITurnState turnState, Microsoft.Teams.Apps.Schema.TeamsChannel channel, CancellationToken cancellationToken)
{
    // Handle channel created event
}

Alternatively, OnCreated(ChannelUpdateHandler, String[], UInt16) can be used to register the handler via the fluent API.

Constructors

Name Description
TeamsChannelCreatedRouteAttribute(Boolean, UInt16, String)

Attribute to define a route that handles Teams channel created events.

Methods

Name Description
AddRoute(AgentApplication, MethodInfo)

Registers a route for the specified method within the given agent application.

Applies to