SlackAgentExtension.OnEvent Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| OnEvent(SlackRouteHandler, String[], UInt16) |
Registers a message route handler for any Slack event received by the agent. |
| OnEvent(String, SlackRouteHandler, String[], UInt16) |
Registers an event route that triggers the specified handler when an incoming Slack event matches the given name. |
| OnEvent(Regex, SlackRouteHandler, String[], UInt16) |
Registers an event route that triggers the specified handler when an incoming Slack event matches the given name pattern. |
OnEvent(SlackRouteHandler, String[], UInt16)
Registers a message route handler for any Slack event received by the agent.
public Microsoft.Agents.Extensions.Slack.SlackAgentExtension OnEvent(Microsoft.Agents.Extensions.Slack.SlackRouteHandler routeHandler, string[] autoSigninHandlers = default, ushort rank = 32767);
member this.OnEvent : Microsoft.Agents.Extensions.Slack.SlackRouteHandler * string[] * uint16 -> Microsoft.Agents.Extensions.Slack.SlackAgentExtension
Public Function OnEvent (routeHandler As SlackRouteHandler, Optional autoSigninHandlers As String() = Nothing, Optional rank As UShort = 32767) As SlackAgentExtension
Parameters
- routeHandler
- SlackRouteHandler
The delegate that processes incoming Slack event activities. This handler will be invoked when an event activity is received on the Slack channel.
- autoSigninHandlers
- String[]
An optional array of handler names that support automatic sign-in. If specified, these handlers will be used to facilitate OAuth flows for the route.
- rank
- UInt16
The order rank that determines the priority of the route. Use RouteRank.Unspecified to assign the default rank.
Returns
The current instance of SlackAgentExtension to allow method chaining.
Applies to
OnEvent(String, SlackRouteHandler, String[], UInt16)
Registers an event route that triggers the specified handler when an incoming Slack event matches the given name.
public Microsoft.Agents.Extensions.Slack.SlackAgentExtension OnEvent(string eventName, Microsoft.Agents.Extensions.Slack.SlackRouteHandler routeHandler, string[] autoSigninHandlers = default, ushort rank = 32767);
member this.OnEvent : string * Microsoft.Agents.Extensions.Slack.SlackRouteHandler * string[] * uint16 -> Microsoft.Agents.Extensions.Slack.SlackAgentExtension
Public Function OnEvent (eventName As String, routeHandler As SlackRouteHandler, Optional autoSigninHandlers As String() = Nothing, Optional rank As UShort = 32767) As SlackAgentExtension
Parameters
- eventName
- String
The name of the Slack event to handle. This value identifies the event type that triggers the route.
- routeHandler
- SlackRouteHandler
The delegate that processes incoming Slack event activities. This handler will be invoked when an event activity is received on the Slack channel.
- autoSigninHandlers
- String[]
An optional array of handler names that support automatic sign-in. If specified, these handlers will be used to facilitate OAuth flows for the route.
- rank
- UInt16
The order rank that determines the priority of the route. Use RouteRank.Unspecified to assign the default rank.
Returns
The current instance of SlackAgentExtension to allow method chaining.
Remarks
This differs from AgentApplication.OnEvent in that this only matches for the slack channel.
Applies to
OnEvent(Regex, SlackRouteHandler, String[], UInt16)
Registers an event route that triggers the specified handler when an incoming Slack event matches the given name pattern.
public Microsoft.Agents.Extensions.Slack.SlackAgentExtension OnEvent(System.Text.RegularExpressions.Regex eventNamePattern, Microsoft.Agents.Extensions.Slack.SlackRouteHandler routeHandler, string[] autoSigninHandlers = default, ushort rank = 32767);
member this.OnEvent : System.Text.RegularExpressions.Regex * Microsoft.Agents.Extensions.Slack.SlackRouteHandler * string[] * uint16 -> Microsoft.Agents.Extensions.Slack.SlackAgentExtension
Public Function OnEvent (eventNamePattern As Regex, routeHandler As SlackRouteHandler, Optional autoSigninHandlers As String() = Nothing, Optional rank As UShort = 32767) As SlackAgentExtension
Parameters
- eventNamePattern
- Regex
The regular expression pattern that matches the name of the Slack event to handle. This value identifies the event type that triggers the route.
- routeHandler
- SlackRouteHandler
The delegate that processes incoming Slack event activities. This handler will be invoked when an event activity is received on the Slack channel.
- autoSigninHandlers
- String[]
An optional array of handler names that support automatic sign-in. If specified, these handlers will be used to facilitate OAuth flows for the route.
- rank
- UInt16
The order rank that determines the priority of the route. Use RouteRank.Unspecified to assign the default rank.
Returns
The current instance of SlackAgentExtension to allow method chaining.
Remarks
This differs from AgentApplication.OnEvent in that this only matches for the slack channel.